A confidence interval for the population mean gives an indication of how accurately the sample mean estimates the population mean. A 95% confidence interval is defined as an interval calculated in such a way that if a large number of samples were drawn from a population and the interval calculated for each of these samples, 95% of the intervals will contain the true population mean value.

A prediction interval gives an indication of how accurately the sample mean predicts the value of a further observation drawn from the population.

Confidence interval defines like: *estimate ± margin of error*.

A 95% confidence interval (CI) is twice the standard error (also called margin of error) plus or minus the mean. In our example, suppose the *mean* is 990 and *standard deviation* as computed is 47.4, then we would have a confidence interval (895.2, 1084.8) i.e. 990 ± 2 * 47. 4 . If we repeatedly choose many samples, each would have a different confidence interval but statistics tells us 95% of the time, CI will contain the true population *mean*. There are other stringent CIs like 99.7% but 95% is a golden standard for all practical purposes.

The simplest way to obtain a confidence interval for a sample mean is with the t.test function, which provides one with the output.

x = rnorm(30, 195, 17) t.test(rnorm(30, 195, 17)) One Sample t-test data: rnorm(30, 195, 17) t = 59.174, df = 29, p-value < 2.2e-16 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: 190.1872 203.8047 sample estimates: mean of x 196.9959

From the results, you can see that the mean is 196.99, with a 95% confidence interval of 190.18 to 203.804.

Leave nothing for tomorrow which can be done today
*Abraham Lincoln*

- Android
- AngularJS
- Databases
- Development
- Django
- iOS
- Java
- JavaScript
- LaTex
- Linux
- Meteor JS
- Python
- Science

- September 2024
- December 2023
- November 2023
- October 2023
- March 2022
- February 2022
- January 2022
- July 2021
- June 2021
- May 2021
- April 2021
- August 2020
- July 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- February 2019
- January 2019
- December 2018
- November 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013