Skip to content
We use only essential cookies to keep you signed in and remember your preferences. See our Cookie Policy.
TestStop
MocksPracticeResourcesIndiaBlogPricing
Sign in
Resources › Statistical inference › 6. Confidence intervals
Statistical inference · Lesson 6 of 13

Confidence intervals

A sample mean of ₹28,000 is a good guess. A statement of how wrong it could be is far more useful, and that is what a confidence interval gives. It is also the most misread object in statistics, including by examiners’ options. This lesson builds the interval from the standard error, shows by simulation what its confidence level promises and what it does not, and covers the distributions, t, chi-square and F, that the intervals and the tests of the next two lessons are built on.

← Statistical inference moduleLesson 6 of 13 · about 50 minutes
1Joint distributions2Sampling3CLT4Estimators5Likelihood6Intervals7Testing8Tests in practice9Two samples10Chi-square tests11ANOVA12Regression inference13Hard problems
A question to hold on to
An OLS regression on a random sample gives the 95% confidence interval 0.43 < β < 0.59 for a slope. Which statement is false? (A) The interval contains β with probability 0.95. (B) The point estimate of β always lies within the interval. (C) The 90% confidence interval for β is a subset of this one. (D) If such intervals are built from repeated samples, on average 95 out of 100 will contain the true value.
DSE 2010Solved at the end ↓
New here?What is Ashanagar?The invented district behind this page's examples: 60 households, with incomes you can inspect.

Ashanagar is an invented district. The statistics lessons use it for every worked example, so you meet the same households again as the ideas build: first as a list of numbers, then as a spread, then as a population to sample from.

It has 60 households, each with a monthly income in rupees. Unless a page says otherwise, those 60 are the whole population, and a “sample” means a few of them drawn at random. Where a page needs two variables, it uses a smaller set of 12 households with the head’s years of schooling beside income.

The figures are illustrative, made up once and fixed. They are not official statistics.

Households
60
Mean income
₹28,783 a month
Median income
₹25,000 a month
Standard deviation
₹13,366
Lowest and highest
₹10,500 and ₹72,000

Meet the full data set →

In this guide
Lesson · about 50 minutes
  1. An estimate, and how far it could be out
  2. What 95% means, and what it does not
  3. z or t? The three distributions behind intervals
  4. What makes an interval wide
  5. Intervals for a proportion and for a variance
  6. When there is no formula: the bootstrap
  7. The opening question, solved
  8. The lesson on one screen
  9. Check yourself
  10. Past papers, by level
01
The idea

An estimate, and how far it could be out

Lesson 3 gave us the standard error: the typical distance between a sample mean and the truth. A confidence interval turns that into a statement with two ends. Because the sample mean is close to normal, it falls within about two standard errors of μ in 95% of samples. Turn that around and μ lies within about two standard errors of the sample mean, in 95% of samples.

Confidence interval for a mean, σ known
xˉ ± zα/2​n​σ​
z is 1.645 for 90%, 1.96 for 95% and 2.576 for 99%.

The piece after the ± is the margin of error or maximum error of the estimate. For 100 cattle whose weights have a standard deviation of 100 kg, the margin at 95% confidence is 1.96 × 100 ÷ √100 = 19.6, roughly 20 kg (DSE 2016). For a normal population with σ = 2 and a sample of 25 whose mean is 10, the margin is 1.96 × 2 ÷ 5 = 0.784 and the interval is 9.22 to 10.78, so 9.3, 9.8 and 10.6 all lie inside it (DSE 2012).

Derive it

Deriving the confidence interval x̄ ± z·σ/√n

We want to show
If σ is known and x̄ is the mean of n draws, the interval xˉ±1.96σ/n​ is produced by a method that contains μ in 95% of samples.
  1. 1
    Start from what the sampling distribution says.

    The sample mean X̄ has mean μ and standard error σ ÷ √n (derived earlier in this module), and for a normal population, or a large enough sample, it is normal. Standardising,

    Z=σ/n​Xˉ−μ​∼N(0,1)

    The normal table gives P(−1.96 ≤ Z ≤ 1.96) = 0.95. Everything here is a statement about the random X̄ for a fixed μ.

  2. 2
    Write the 95% statement out.
    P(−1.96≤σ/n​Xˉ−μ​≤1.96)⟺P(−1.96n​σ​≤Xˉ−μ≤1.96n​σ​)​=0.95=0.95​

    This says X̄ lands within 1.96 standard errors of μ in 95% of samples. It is the shaded band in the top picture below.

  3. 3
    Flip the inequality.

    Multiply −1.96 SE ≤ X̄ − μ ≤ 1.96 SE through by −1, which reverses both signs and the direction of each inequality: −1.96 SE ≤ μ − X̄ ≤ 1.96 SE. Add X̄ to all three parts:

    P(Xˉ−1.96n​σ​≤μ≤Xˉ+1.96n​σ​)=0.95

    It is the same event described from the other side: “X̄ is within 1.96 SE of μ” and “μ is within 1.96 SE of X̄” are one statement. The pictures show both on every draw.

  4. 4
    Say what is random.

    In the last line μ is a fixed number and the ends of the interval move with the sample. The 0.95 is therefore a property of the method before the sample is drawn. Once x̄ is known the interval is a fixed pair of numbers, and it either contains μ or it does not: the probability that this particular interval contains μ is 0 or 1. That is the meaning, and the standard misreading, tested in the next chapter.

  5. 5
    Put numbers in.

    Sixteen Ashanagar households give x̄ = 31 (₹ thousand). With σ = 13.37, the standard error is 13.37 ÷ 4 = 3.34 and the half-width is 1.96 × 3.34 = 6.55, so the 95% interval is 31 ± 6.55 = (24.45, 37.55). It catches the true mean, 28.78. A different sample of 16 would give a different interval, and about one in twenty of them would miss.

    Replacing 1.96 by another point of the normal table changes the confidence level: 1.645 for 90% and 2.576 for 99%. When σ is estimated by s the table must be the t table, because the extra uncertainty in s widens the intervals.

Step 1 of 5
So
The interval is the inequality that describes where the sample mean falls, solved for μ. Its half-width is a critical value times the standard error, which is why every quantity that shrinks the standard error shrinks the interval.
02
Interactive

What 95% means, and what it does not

Here is the sentence that causes the trouble: “there is a 95% probability that μ lies between 40 and 48”. It sounds right and is wrong. The population mean is a fixed number. It is either between 40 and 48 or it is not, and no randomness remains once the interval is written down. The randomness was in which sample you drew. The 95% describes the procedure: over repeated samples, 95% of the intervals it produces contain the true value.

The lab makes this concrete. Each row is the interval from one sample of Ashanagar households. The dashed line is the true mean, ₹28.78 thousand, which no one sample can see. Draw fifty samples at a time and count the rows that miss. Then change the confidence level, the sample size and the method, and watch the long-run percentage under the plot.

Uses the sample's own s and the t critical value with n − 1 degrees of freedom.

020406080mean income, ₹ thousand (dashed: the true mean 28.78)
Of these 50, caught the truth47 of 50
Long run, 3,000 intervals93.3%
Promised95%
Average width, ₹ thousand18.4

The count out of 50 moves around each time you redraw, about 47.5 on average. The 95% belongs to the method: over many samples about that share of intervals catch the true mean. It is not a probability attached to any one interval, which either contains the dashed line or does not.

Pause and predict
A 95% interval for the mean is (40, 48). Which statement is correct?

The same reading disposes of other tempting statements:

  • “The estimate lies in the interval with 95% probability.” The estimate is the centre of the interval and always lies inside it (DSE 2010 B).
  • “95% of the data lie in the interval.” The interval is about the mean. Individual values spread far more widely.
  • The 90% interval is inside the 95% one. Both are centred on the same estimate, and the 90% margin is smaller, so it is a subset (DSE 2010 C is true).
Intervals and tests

A 95% interval holds exactly the values of μ that a two-sided test at the 5% level would not reject. It tells you everything the test does and a good deal more, since it shows the plausible size of the effect as well as whether zero is excluded. That is why confidence intervals are preferred to significance tests: they provide more information (Hyderabad 2016).

03
Interactive

z or t? The three distributions behind intervals

The formula above needs σ, which you almost never know. In practice σ is replaced by the sample standard deviation s, and that substitution adds a second source of error: s is itself a random variable. The ratio (x̄ − μ) ÷ (s/√n) is no longer standard normal. For a normal population it follows Student’s t distribution with n − 1 degrees of freedom, which looks like the normal curve with heavier tails.

Confidence interval for a mean, σ unknown
xˉ ± tα/2,n−1​n​s​
Normal population, or a large enough sample. df = n − 1.

The critical value t is larger than z, much larger for small n: with 5 degrees of freedom, the 95% value is 2.571, not 1.96, and with 15 degrees it is 2.131. The extra width pays for the uncertainty about s. As the sample grows the two converge. The coverage lab’s third button shows what happens if you ignore this: with n = 5 and the normal critical value, roughly 87% of intervals catch the truth, not 95%.

Three distributions turn up again and again in inference, all from a normal sample, and the next lab lets you stretch each one and read off its critical values.

−2.5712.571-5-4-3-2-1012345
t densitytail(s) of area 0.025 eachdashed: standard normal
t critical, two-tailed 5%, 5 df2.5706
Normal z, same tail area1.96
Variance of t1.667
Tail area beyond each mark0.025

With 5 degrees of freedom the tails are visibly fatter than the normal's, so the critical value (2.571) is well above 1.96. Slide df up and the two curves merge.

DistributionBuilt fromUsed for
Standard normal, ZA normal variable minus its mean, over its standard deviation.Means when σ is known; large samples; proportions.
Chi-square, χ²The sum of squares of n independent standard normal variables (n degrees of freedom).Variances: (n − 1)S²/σ² is χ² with n − 1 df. Goodness-of-fit and independence tests.
Student’s tA standard normal divided by the square root of an independent chi-square over its degrees of freedom.Means when σ is estimated by s.
FThe ratio of two independent chi-squares, each divided by its degrees of freedom.Comparing two variances; analysis of variance.

These four definitions are a matching question in UGC NET 2023: the sum of squares of n independent standard normals is chi-square, a standard normal over the root of a chi-square over its df is t, the ratio of two chi-squares each over its df is F, and a normal minus its mean over its standard deviation is standard normal.

04
Precision

What makes an interval wide

An interval is estimate ± critical value × standard error, so its width is 2 × critical value × s/√n. Three things move it, and exam questions ask about each.

  • The confidence level. A higher level needs a bigger critical value. A 99% interval is wider than a 95% interval on the same data (DSE 2012), which is the same as saying a 95% interval is shorter (JNU 2012). You buy confidence with width.
  • The sample size. Width falls with √n: four times the sample halves it.
  • The variability of the data. A larger s or σ widens it.

Hyderabad 2018 asks the same thing from the other side: more accurate estimation, meaning a smaller interval, comes from accepting a higher significance level (a lower confidence level), not from a lower one, and not from a higher population variance. The sample mean itself does not enter the width at all.

DSE 2008 · moderate
A symmetric 90% confidence interval for the mean of a normal population, with unknown variance, is built from 400 observations. Which change shortens it by the greatest amount? (A) Confidence level changed to 80%. (B) Sample mean halved. (C) Sample size four times. (D) Sample standard deviation one third of its value.
  1. 1
    Width.
    Width = 2 t s/√n. The sample mean is not in it, so (B) does nothing.
  2. 2
    Compare each change as a multiplier.
    (A) 80% instead of 90%: the critical value falls from 1.649 to 1.284, a factor of 0.78. (C) n × 4: the width is halved, a factor of 0.5 (the critical value barely moves at 399 df). (D) s ÷ 3: a factor of one third.
Answer
Option D: one third beats one half, and one half beats 0.78. Notice that cutting the confidence level, the cheapest change, shortens the interval least.
In economics

Reports of estimated effects, from the return to a year of schooling to a state’s growth rate, are most useful with their intervals, and a wide interval is information too. An estimated 2 percentage point rise in enrolment with an interval from −1 to 5 says the data cannot tell a rise from a fall.

05
Beyond the mean

Intervals for a proportion and for a variance

A proportion

Replace the standard error with that of Lesson 3 and estimate p by p̂. In the survey of 400 likely voters, 215 back the ruling party, so p̂ = 0.5375 and the standard error is 0.0249. The 95% interval is 0.5375 ± 1.96 × 0.0249 = 0.489 to 0.586. The interval includes 0.5, so the survey cannot rule out an even split.

Confidence interval for a proportion
p^​ ± zα/2​np^​(1−p^​)​​

A variance

For a normal sample, (n − 1)S²/σ² follows a chi-square distribution with n − 1 degrees of freedom. Pin that ratio between the chi-square points that cut off α/2 in each tail, then turn the inequality round to isolate σ². Because the chi-square curve is not symmetric the interval is not symmetric about S².

Confidence interval for a variance
[ χα/2,n−12​(n−1)S2​ , χ1−α/2,n−12​(n−1)S2​ ]
Here the subscript is the area to the right of the point, as in DSE 2012. The larger point gives the lower limit.
DSE 2012 · hard
A sample of n = 10 from a normal population has s² = 25. Find a 95% confidence interval for σ².
  1. 1
    Degrees of freedom.
    n − 1 = 9. (n − 1)s² = 9 × 25 = 225.
  2. 2
    Chi-square points.
    Area 0.025 to the right of 19.023, and area 0.975 to the right of 2.700. The chi-square tab of the lab shows both points for 9 degrees of freedom.
  3. 3
    Divide.
    Lower limit = 225 ÷ 19.023 = 11.83. Upper limit = 225 ÷ 2.700 = 83.33.
Answer
(11.8, 83.3). The interval is very wide because there are only 9 degrees of freedom, and it is lopsided: s² = 25 sits well below its centre. In the multiple-choice form of DSE 2012, the correct option divides (n − 1)S² by the right-tail point χ²α/2 for the lower end and χ²1−α/2 for the upper: option A. Options with n in place of n − 1 or with the two points swapped fail.
06
A modern tool

When there is no formula: the bootstrap

Standard errors and intervals have formulas for means, proportions and variances. For a median, a ratio or a Gini coefficient there is no simple formula. The bootstrap gets round that by treating the sample as a stand-in for the population: draw many new samples, with replacement, from the sample itself, compute the statistic each time, and use the spread of those values as an estimate of the sampling distribution. Its purpose is to obtain the sampling distribution of the parameters of interest (UGC NET 2025). It is exactly what the labs in this module have been doing, except that they resample from a known population and the bootstrap resamples from the one sample you have.

Watch out for

The mistakes examiners are fishing for

  • “95% probability that μ is in the interval.” μ is fixed. The interval is random. The 95% is the long-run share of intervals that catch μ.
  • Using z when σ is estimated. With small n, use t with n − 1 degrees of freedom. The z interval is too narrow.
  • Thinking a wider confidence level is more precise. Higher confidence means a wider interval.
  • Forgetting the square root. Quadruple the sample to halve the width.
  • Variance intervals are lopsided. They are not s² ± something. The larger chi-square point gives the lower limit.
07
Solving the opening question

The opening question, solved

DSE 2010 · moderate
The 95% confidence interval for a slope is 0.43 < β < 0.59. Which statement is false?
  1. 1
    (A) The interval contains β with probability 0.95.
    β is a fixed number, and the interval has already been written down. It either contains β or it does not. The 95% is a property of the procedure over repeated samples. False.
  2. 2
    (B) The point estimate always lies within the interval.
    The estimate is its midpoint, 0.51. True.
  3. 3
    (C) The 90% interval is a subset.
    Same centre, smaller margin. True.
  4. 4
    (D) On average 95 of 100 repeated intervals contain the true value.
    That is exactly what 95% confidence means. True.
Answer
(A) is the false statement, which is why the question asks for it. This is the single most common trap in confidence intervals, and the lab shows it directly: each row either touches the dashed line or it does not.
08
Revise

The lesson on one screen

The lesson on one screen
Known σ
x̄ ± z σ/√n. z = 1.645, 1.96, 2.576 at 90%, 95%, 99%.
Unknown σ
x̄ ± t s/√n with n − 1 degrees of freedom. t > z, converging as n grows. Using z with s undercovers at small n.
Meaning
The 95% belongs to the procedure: in repeated samples 95% of intervals contain μ. Not a probability that μ is in this interval.
Width
2 × critical value × standard error. Wider for higher confidence and larger s, narrower for larger n (by √n). The mean does not enter.
Proportion
p̂ ± z √(p̂(1 − p̂)/n).
Variance
[(n − 1)S² / χ²(α/2), (n − 1)S² / χ²(1 − α/2)], with right-tail points. Lopsided.
Distributions
χ² = sum of squared normals. t = normal ÷ √(χ²/df). F = ratio of two χ²/df. Bootstrap: resample the sample.
09
Practice

Check yourself

0 of 13 correct so far

Compute

The margin of error
σ = 15 is known and n = 36. Find the margin of error of a 95% confidence interval for the mean (z = 1.96).
A t interval
n = 16, x̄ = 50 and s = 8, with σ unknown. The t critical value for 15 degrees of freedom at 95% is 2.1314. Find the upper limit of the 95% interval.
A proportion
In a sample of 200 households, 40% own a two-wheeler. Find the margin of error of a 95% interval for the proportion (z = 1.96).
The sample size
σ = 5 is known. How many observations give a 99% interval (z = 2.576) with a margin of error of at most 1?
A variance
n = 10 and s² = 25 from a normal population. The right-tail chi-square point with area 0.025 and 9 df is 19.023. Find the lower limit of the 95% interval for σ².
The price of confidence
With σ known and n unchanged, how many times as wide is a 99% interval as a 95% interval? (z = 2.576 and 1.96.)
A t critical value
Read the two-tailed 95% critical value of the t distribution with 24 degrees of freedom. The tab in the lab will show it.
Back out the confidence level
A sample of n = 64 from a population with σ = 32 gives the interval (112, 128). What is the confidence level, in per cent? (z = half-width ÷ standard error; use the normal table.)

Quick questions

1A 95% confidence interval for μ is (40, 48). The correct interpretation is that
2On the same data, a 99% confidence interval compared with a 95% interval is
3Other things equal, quadrupling the sample size makes a confidence interval for the mean
4A sample of 12 comes from a normal population with unknown σ. The right interval for the mean uses
5The chi-square distribution with k degrees of freedom is the distribution of
10
Real questions

Past papers, by level

Foundation

Definitions and one-step calculations. Most CUET and Hyderabad questions sit here.

3 questionsPractise →

Standard

Joint tables, standard errors and statement questions, up to JNU and IIT JAM level.

4 questionsPractise →

Delhi School level

This topic’s hardest questions, from the DSE entrance, are worked through in Lesson 13: Estimation and confidence intervals.

6 questionsLesson 13 →
All 7 past-paper questions for this lesson, easiest first: practise the full set →

✦These are questions from the TestStop bank. A free account answers 10 a day, each with its worked solution; All-Access opens every set with no daily limit.

← Lesson 5Maximum likelihood and the method of momentsLesson 7 →Hypothesis testing: errors, power and p-values

Read next

All resources →
StatisticsInference 7: hypothesis testing, errors, power and p-valuesNull and alternative hypotheses, test statistics and rejection regions, type I and type II errors, size and power, one and two tails, and what a p-value does not mean.Complete guide · 50 minStatisticsInference 5: maximum likelihood and the method of momentsThe likelihood function and log-likelihood, maximum likelihood estimators for the Bernoulli, exponential, normal and uniform, the method of moments and invariance.Complete guide · 45 minStatisticsStatistical inference for economics students, from joint distributions to hypothesis testsA module in thirteen lessons: joint distributions and covariance, sampling and the sampling distribution, the standard error and the central limit theorem, estimators and maximum likelihood, confidence intervals, hypothesis tests and p-values, two-sample tests, chi-square tests, analysis of variance and regression inference, on one running example with labs to move and graded past papers.Module · 635 min