Confidence interval
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

In frequentist statistics, a confidence interval (CI) is a range of estimates for an unknown parameter. A confidence interval is computed at a designated confidence level; the 95% confidence level is most common, but other levels, such as 90% or 99%, are sometimes used.^{[1]}^{[2]} The confidence level represents the longrun proportion of corresponding CIs that contain the true value of the parameter. For example, out of all intervals computed at the 95% level, 95% of them should contain the parameter's true value.^{[3]}
Factors affecting the width of the CI include the confidence level, the sample size, and the variability in the sample.^{[4]} All else being the same, a larger sample would produce a narrower confidence interval. Likewise, greater variability in the sample produces a wider confidence interval, and a higher confidence level would demand a wider confidence interval.^{[5]}
Definition
Let X be a random sample from a probability distribution with statistical parameter θ, which is a quantity to be estimated, and φ, representing quantities that are not of immediate interest. A confidence interval for the parameter θ, with confidence level or coefficient γ, is an interval determined by random variables and with the property:
The number γ, whose typical value is close to but not greater than 1, is sometimes given in the form (or as a percentage ), where is a small positive number, often 0.05 .
It is important for the bounds and to be specified in such a way that as long as X is collected randomly, every time we compute a confidence interval, there is probability γ that it would contain θ, the true value of the parameter being estimated. This should hold true for any actual θ and φ.^{[2]}
Approximate confidence intervals
In many applications, confidence intervals that have exactly the required confidence level are hard to construct, but approximate intervals can be computed. The rule for constructing the interval may be accepted as providing a confidence interval at level if
to an acceptable level of approximation. Alternatively, some authors^{[6]} simply require that
which is useful if the probabilities are only partially identified or imprecise, and also when dealing with discrete distributions. Confidence limits of form
 and
are called conservative;^{[7]}^{(p 210)} accordingly, one speaks of conservative confidence intervals and, in general, regions.
Desired properties
When applying standard statistical procedures, there will often be standard ways of constructing confidence intervals. These will have been devised so as to meet certain desirable properties, which will hold given that the assumptions on which the procedure relies are true. These desirable properties may be described as: validity, optimality, and invariance.
Of the three, "validity" is most important, followed closely by "optimality". "Invariance" may be considered as a property of the method of derivation of a confidence interval, rather than of the rule for constructing the interval. In nonstandard applications, these same desirable properties would be sought:
Validity
This means that the nominal coverage probability (confidence level) of the confidence interval should hold, either exactly or to a good approximation.
Optimality
This means that the rule for constructing the confidence interval should make as much use of the information in the dataset as possible.
Recall that one could throw away half of a dataset and still be able to derive a valid confidence interval. One way of assessing optimality is by the length of the interval so that a rule for constructing a confidence interval is judged better than another if it leads to intervals whose lengths are typically shorter.
Invariance
In many applications, the quantity being estimated might not be tightly defined as such.
For example, a survey might result in an estimate of the median income in a population, but it might equally be considered as providing an estimate of the logarithm of the median income, given that this is a common scale for presenting graphical results. It would be desirable that the method used for constructing a confidence interval for the median income would give equivalent results when applied to constructing a confidence interval for the logarithm of the median income: Specifically the values at the ends of the latter interval would be the logarithms of the values at the ends of former interval.
Methods of derivation
For nonstandard applications, there are several routes that might be taken to derive a rule for the construction of confidence intervals. Established rules for standard procedures might be justified or explained via several of these routes. Typically a rule for constructing confidence intervals is closely tied to a particular way of finding a point estimate of the quantity being considered.
Summary statistics
This is closely related to the method of moments for estimation. A simple example arises where the quantity to be estimated is the population mean, in which case a natural estimate is the sample mean. Similarly, the sample variance can be used to estimate the population variance. A confidence interval for the true mean can be constructed centered on the sample mean with a width which is a multiple of the square root of the sample variance.
Likelihood theory
Estimates can be constructed using the maximum likelihood principle, the likelihood theory for this provides two ways of constructing confidence intervals or confidence regions for the estimates.
Estimating equations
The estimation approach here can be considered as both a generalization of the method of moments and a generalization of the maximum likelihood approach. There are corresponding generalizations of the results of maximum likelihood theory that allow confidence intervals to be constructed based on estimates derived from estimating equations.^{[citation needed]}
Hypothesis testing
If hypothesis tests are available for general values of a parameter, then confidence intervals/regions can be constructed by including in the 100 p % confidence region all those points for which the hypothesis test of the null hypothesis that the true value is the given value is not rejected at a significance level of (1 − p) .^{[7]}^{(§ 7.2 (iii))}
Bootstrapping
In situations where the distributional assumptions for the above methods are uncertain or violated, resampling methods allow construction of confidence intervals or prediction intervals. The observed data distribution and the internal correlations are used as the surrogate for the correlations in the wider population.
Central limit theorem
The central limit theorem is a refinement of the law of large numbers. For a large number of independent identically distributed random variables with finite variance, the average approximately has a normal distribution, no matter what the distribution of the is, with the approximation roughly improving in proportion to ^{[2]}
Example
Suppose {X_{1}, …, X_{n}} is an independent sample from a normally distributed population with unknown parameters mean μ and variance σ^{2}. Let
Where X is the sample mean, and S^{2} is the sample variance. Then
has a Student's t distribution with n − 1 degrees of freedom.^{[8]} Note that the distribution of T does not depend on the values of the unobservable parameters μ and σ^{2}; i.e., it is a pivotal quantity. Suppose we wanted to calculate a 95% confidence interval for μ. Then, denoting c as the 97.5th percentile of this distribution,
Note that "97.5th" and "0.95" are correct in the preceding expressions. There is a 2.5% chance that will be less than and a 2.5% chance that it will be larger than . Thus, the probability that will be between and is 95%.
Consequently,
and we have a theoretical (stochastic) 95% confidence interval for μ.
After observing the sample we find values x for X and s for S, from which we compute the confidence interval
Interpretation
Various interpretations of a confidence interval can be given (taking the 95% confidence interval as an example in the following).
 The confidence interval can be expressed in terms of a longrun frequency in repeated samples (or in resampling): "Were this procedure to be repeated on numerous samples, the proportion of calculated 95% confidence intervals that encompassed the true value of the population parameter would tend toward 95%."^{[9]}
 The confidence interval can be expressed in terms of probability with respect to a single theoretical (yet to be realized) sample: "There is a 95% probability that the 95% confidence interval calculated from a given future sample will cover the true value of the population parameter." ^{[10]} This essentially reframes the "repeated samples" interpretation as a probability rather than a frequency. See Neyman construction.
 The confidence interval can be expressed in terms of statistical significance, e.g.: "The 95% confidence interval represents values that are not statistically significantly different from the point estimate at the .05 level".^{[11]}
Common misunderstandings
Confidence intervals and levels are frequently misunderstood, and published studies have shown that even professional scientists often misinterpret them.^{[12]}^{[13]}^{[14]}^{[15]}^{[16]}^{[17]}
 A 95% confidence level does not mean that for a given realized interval there is a 95% probability that the population parameter lies within the interval (i.e., a 95% probability that the interval covers the population parameter).^{[18]} According to the strict frequentist interpretation, once an interval is calculated, this interval either covers the parameter value or it does not; it is no longer a matter of probability. The 95% probability relates to the reliability of the estimation procedure, not to a specific calculated interval.^{[19]} Neyman himself (the original proponent of confidence intervals) made this point in his original paper:^{[10]}
It will be noticed that in the above description, the probability statements refer to the problems of estimation with which the statistician will be concerned in the future. In fact, I have repeatedly stated that the frequency of correct results will tend to α. Consider now the case when a sample is already drawn, and the calculations have given [particular limits]. Can we say that in this particular case the probability of the true value [falling between these limits] is equal to α? The answer is obviously in the negative. The parameter is an unknown constant, and no probability statement concerning its value may be made...
 Deborah Mayo expands on this further as follows:^{[20]}
It must be stressed, however, that having seen the value [of the data], Neyman–Pearson theory never permits one to conclude that the specific confidence interval formed covers the true value of 0 with either (1 − α)100% probability or (1 − α)100% degree of confidence. Seidenfeld's remark seems rooted in a (not uncommon) desire for Neyman–Pearson confidence intervals to provide something which they cannot legitimately provide; namely, a measure of the degree of probability, belief, or support that an unknown parameter value lies in a specific interval. Following Savage (1962), the probability that a parameter lies in a specific interval may be referred to as a measure of final precision. While a measure of final precision may seem desirable, and while confidence levels are often (wrongly) interpreted as providing such a measure, no such interpretation is warranted. Admittedly, such a misinterpretation is encouraged by the word 'confidence'.
 A 95% confidence level does not mean that 95% of the sample data lie within the confidence interval.
 A confidence interval is not a definitive range of plausible values for the sample parameter, though it is often heuristically taken as a range of plausible values.
 A particular confidence level of 95% calculated from an experiment does not mean that there is a 95% probability of a sample parameter from a repeat of the experiment falling within this interval.^{[16]}
Counterexamples
Since confidence interval theory was proposed, a number of counterexamples to the theory have been developed to show how the interpretation of confidence intervals can be problematic, at least if one interprets them naïvely.
Confidence procedure for uniform location
Welch^{[21]} presented an example which clearly shows the difference between the theory of confidence intervals and other theories of interval estimation (including Fisher's fiducial intervals and objective Bayesian intervals). Robinson^{[22]} called this example "[p]ossibly the best known counterexample for Neyman's version of confidence interval theory." To Welch, it showed the superiority of confidence interval theory; to critics of the theory, it shows a deficiency. Here we present a simplified version.
Suppose that are independent observations from a Uniform(θ − 1/2, θ + 1/2) distribution. Then the optimal 50% confidence procedure for is^{[23]}
A fiducial or objective Bayesian argument can be used to derive the interval estimate
which is also a 50% confidence procedure. Welch showed that the first confidence procedure dominates the second, according to desiderata from confidence interval theory; for every , the probability that the first procedure contains is less than or equal to the probability that the second procedure contains . The average width of the intervals from the first procedure is less than that of the second. Hence, the first procedure is preferred under classical confidence interval theory.
However, when , intervals from the first procedure are guaranteed to contain the true value : Therefore, the nominal 50% confidence coefficient is unrelated to the uncertainty we should have that a specific interval contains the true value. The second procedure does not have this property.
Moreover, when the first procedure generates a very short interval, this indicates that are very close together and hence only offer the information in a single data point. Yet the first interval will exclude almost all reasonable values of the parameter due to its short width. The second procedure does not have this property.
The two counterintuitive properties of the first procedure—100% coverage when are far apart and almost 0% coverage when are close together—balance out to yield 50% coverage on average. However, despite the first procedure being optimal, its intervals offer neither an assessment of the precision of the estimate nor an assessment of the uncertainty one should have that the interval contains the true value.
This counterexample is used to argue against naïve interpretations of confidence intervals. If a confidence procedure is asserted to have properties beyond that of the nominal coverage (such as relation to precision, or a relationship with Bayesian inference), those properties must be proved; they do not follow from the fact that a procedure is a confidence procedure.
Confidence procedure for ω^{2}
Steiger^{[24]} suggested a number of confidence procedures for common effect size measures in ANOVA. Morey et al.^{[18]} point out that several of these confidence procedures, including the one for ω^{2}, have the property that as the F statistic becomes increasingly small—indicating misfit with all possible values of ω^{2}—the confidence interval shrinks and can even contain only the single value ω^{2} = 0; that is, the CI is infinitesimally narrow (this occurs when for a CI).
This behavior is consistent with the relationship between the confidence procedure and significance testing: as F becomes so small that the group means are much closer together than we would expect by chance, a significance test might indicate rejection for most or all values of ω^{2}. Hence the interval will be very narrow or even empty (or, by a convention suggested by Steiger, containing only 0). However, this does not indicate that the estimate of ω^{2} is very precise. In a sense, it indicates the opposite: that the trustworthiness of the results themselves may be in doubt. This is contrary to the common interpretation of confidence intervals that they reveal the precision of the estimate.
History
Confidence intervals were introduced by Jerzy Neyman in 1937.^{[25]} Statisticians quickly took to the idea, but adoption by scientists was more gradual. Some authors in medical journals promoted confidence intervals as early as the 1970s. Despite this, confidence intervals were rarely used until the following decade, when they quickly became standard.^{[26]} By the late 1980s, medical journals began to require the reporting of confidence intervals.^{[27]}
See also
 CLs upper limits (particle physics)
 68–95–99.7 rule
 Confidence band, an interval estimate for a curve
 Confidence distribution
 Confidence region, a higher dimensional generalization
 Credence (statistics)
 Credible interval, a Bayesian alternative for interval estimation
 Cumulative distribution functionbased nonparametric confidence interval
 Error bar – Graphical representations of the variability of data
 Estimation statistics – Data analysis approach in frequentist statistics
 Margin of error, the CI halfwidth
 pvalue – Function of the observed sample results
 Prediction interval, an interval estimate for a random variable
 Probable error
 Robust confidence intervals
Confidence interval for specific distributions
 Confidence interval for binomial distribution
 Confidence interval for exponent of the power law distribution
 Confidence interval for mean of the exponential distribution
 Confidence interval for mean of the Poisson distribution
 Confidence intervals for mean and variance of the normal distribution
References
 ^ Zar, Jerrold H. (199). Biostatistical Analysis (4th ed.). Upper Saddle River, N.J.: Prentice Hall. pp. 43–45. ISBN 9780130815422. OCLC 39498633.
 ^ ^{a} ^{b} ^{c} Dekking, Frederik Michel; Kraaikamp, Cornelis; Lopuhaä, Hendrik Paul; Meester, Ludolf Erwin (2005). "A Modern Introduction to Probability and Statistics". Springer Texts in Statistics. doi:10.1007/1846281687. ISBN 9781852338961. ISSN 1431875X.
 ^ Illowsky, Barbara. Introductory statistics. Dean, Susan L., 1945, Illowsky, Barbara., OpenStax College. Houston, Texas. ISBN 9781947172050. OCLC 899241574.
 ^ Hazra, Avijit (October 2017). "Using the confidence interval confidently". Journal of Thoracic Disease. 9 (10): 4125–4130. doi:10.21037/jtd.2017.09.14. ISSN 20721439. PMC 5723800. PMID 29268424.
 ^ Khare, Vikas; Nema, Savita; Baredar, Prashant (2020). Ocean Energy Modeling and Simulation with Big Data Computational Intelligence for System Optimization and Grid Integration. ISBN 9780128189054. OCLC 1153294021.
 ^ Roussas, George G. (1997). A Course in Mathematical Statistics (2nd ed.). Academic Press. p. 397.
 ^ ^{a} ^{b} Cox, D.R.; Hinkley, D.V. (1974). Theoretical Statistics. Chapman & Hall.
 ^ Rees. D.G. (2001) Essential Statistics, 4th Edition, Chapman and Hall/CRC. ISBN 1584880074 (Section 9.5)
 ^ Cox D.R., Hinkley D.V. (1974) Theoretical Statistics, Chapman & Hall, p49, p209
 ^ ^{a} ^{b} Neyman, J. (1937). "Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability". Philosophical Transactions of the Royal Society A. 236 (767): 333–380. Bibcode:1937RSPTA.236..333N. doi:10.1098/rsta.1937.0005. JSTOR 91337.
 ^ Cox D.R., Hinkley D.V. (1974) Theoretical Statistics, Chapman & Hall, pp 214, 225, 233
 ^ Kalinowski, Pawel (2010). "Identifying Misconceptions about Confidence Intervals" (PDF). Retrieved 20211222.
 ^ "Archived copy" (PDF). Archived from the original (PDF) on 20160304. Retrieved 20140916.
{{cite web}}
: CS1 maint: archived copy as title (link)  ^ Hoekstra, R., R. D. Morey, J. N. Rouder, and EJ. Wagenmakers, 2014. Robust misinterpretation of confidence intervals. Psychonomic Bulletin Review, in press. [1]
 ^ Scientists’ grasp of confidence intervals doesn’t inspire confidence, Science News, July 3, 2014
 ^ ^{a} ^{b} Greenland, Sander; Senn, Stephen J.; Rothman, Kenneth J.; Carlin, John B.; Poole, Charles; Goodman, Steven N.; Altman, Douglas G. (April 2016). "Statistical tests, P values, confidence intervals, and power: a guide to misinterpretations". European Journal of Epidemiology. 31 (4): 337–350. doi:10.1007/s1065401601493. ISSN 03932990. PMC 4877414. PMID 27209009.
 ^ Helske, Jouni; Helske, Satu; Cooper, Matthew; Ynnerman, Anders; Besancon, Lonni (20210801). "Can Visualization Alleviate Dichotomous Thinking? Effects of Visual Representations on the Cliff Effect". IEEE Transactions on Visualization and Computer Graphics. Institute of Electrical and Electronics Engineers (IEEE). 27 (8): 3397–3409. arXiv:2002.07671. doi:10.1109/tvcg.2021.3073466. ISSN 10772626. PMID 33856998. S2CID 233230810.
 ^ ^{a} ^{b} Morey, R. D.; Hoekstra, R.; Rouder, J. N.; Lee, M. D.; Wagenmakers, E.J. (2016). "The Fallacy of Placing Confidence in Confidence Intervals". Psychonomic Bulletin & Review. 23 (1): 103–123. doi:10.3758/s1342301509478. PMC 4742505. PMID 26450628.
 ^ "1.3.5.2. Confidence Limits for the Mean". nist.gov. Archived from the original on 20080205. Retrieved 20140916.
 ^ Mayo, D. G. (1981) "In defence of the Neyman–Pearson theory of confidence intervals", Philosophy of Science, 48 (2), 269–280. JSTOR 187185
 ^ Welch, B. L. (1939). "On Confidence Limits and Sufficiency, with Particular Reference to Parameters of Location". The Annals of Mathematical Statistics. 10 (1): 58–69. doi:10.1214/aoms/1177732246. JSTOR 2235987.
 ^ Robinson, G. K. (1975). "Some Counterexamples to the Theory of Confidence Intervals". Biometrika. 62 (1): 155–161. doi:10.2307/2334498. JSTOR 2334498.
 ^ Pratt, J. W. (1961). "Book Review: Testing Statistical Hypotheses. by E. L. Lehmann". Journal of the American Statistical Association. 56 (293): 163–167. doi:10.1080/01621459.1961.10482103. JSTOR 2282344.
 ^ Steiger, J. H. (2004). "Beyond the F test: Effect size confidence intervals and tests of close fit in the analysis of variance and contrast analysis". Psychological Methods. 9 (2): 164–182. doi:10.1037/1082989x.9.2.164. PMID 15137887.
 ^ [Neyman, J., 1937. Outline of a theory of statistical estimation based on the classical theory of probability. Philosophical Transactions of the Royal Society of London. Series A, Mathematical and Physical Sciences, 236(767), pp.333380]
 ^ Altman, Douglas G. (1991). "Statistics in medical journals: Developments in the 1980s". Statistics in Medicine. 10 (12): 1897–1913. doi:10.1002/sim.4780101206. ISSN 10970258. PMID 1805317.
 ^ Sandercock, Peter A.G. (2015). "Short History of Confidence Intervals". Stroke. Ovid Technologies (Wolters Kluwer Health). 46 (8): e1847. doi:10.1161/strokeaha.115.007750. ISSN 00392499. PMID 26106115.
Bibliography
 Fisher, R.A. (1956) Statistical Methods and Scientific Inference. Oliver and Boyd, Edinburgh. (See p. 32.)
 Freund, J.E. (1962) Mathematical Statistics Prentice Hall, Englewood Cliffs, NJ. (See pp. 227–228.)
 Hacking, I. (1965) Logic of Statistical Inference. Cambridge University Press, Cambridge. ISBN 0521051657
 Keeping, E.S. (1962) Introduction to Statistical Inference. D. Van Nostrand, Princeton, NJ.
 Kiefer, J. (1977). "Conditional Confidence Statements and Confidence Estimators (with discussion)". Journal of the American Statistical Association. 72 (360a): 789–827. doi:10.1080/01621459.1977.10479956. JSTOR 2286460.
 Mayo, D. G. (1981) "In defence of the Neyman–Pearson theory of confidence intervals", Philosophy of Science, 48 (2), 269–280. JSTOR 187185
 Neyman, J. (1937) "Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability" Philosophical Transactions of the Royal Society of London A, 236, 333–380. (Seminal work.)
 Robinson, G.K. (1975). "Some Counterexamples to the Theory of Confidence Intervals". Biometrika. 62 (1): 155–161. doi:10.1093/biomet/62.1.155. JSTOR 2334498.
 Savage, L. J. (1962), The Foundations of Statistical Inference. Methuen, London.
 Smithson, M. (2003) Confidence intervals. Quantitative Applications in the Social Sciences Series, No. 140. Belmont, CA: SAGE Publications. ISBN 9780761924999.
 Mehta, S. (2014) Statistics Topics ISBN 9781499273533
 "Confidence estimation", Encyclopedia of Mathematics, EMS Press, 2001 [1994]
 Morey, R. D.; Hoekstra, R.; Rouder, J. N.; Lee, M. D.; Wagenmakers, E.J. (2016). "The fallacy of placing confidence in confidence intervals". Psychonomic Bulletin & Review. 23 (1): 103–123. doi:10.3758/s1342301509478. PMC 4742505. PMID 26450628.
External links
 The Exploratory Software for Confidence Intervals tutorial programs that run under Excel
 Confidence interval calculators for RSquares, Regression Coefficients, and Regression Intercepts
 Weisstein, Eric W. "Confidence Interval". MathWorld.
 CAUSEweb.org Many resources for teaching statistics including Confidence Intervals.
 An interactive introduction to Confidence Intervals
 Confidence Intervals: Confidence Level, Sample Size, and Margin of Error by Eric Schulz, the Wolfram Demonstrations Project.
 Confidence Intervals in Public Health. Straightforward description with examples and what to do about small sample sizes or rates near 0.