From Observations to an Interval
A confidence interval for a population mean is often reported using summary statistics, but an analysis may begin with a short list of measurements. In that case, the interval cannot be calculated correctly until the observations have been summarized: the sample mean locates the center, and the sample standard deviation measures the observed spread. The t critical value and standard error then determine how far to extend from that center.
This tutorial works through that process using small, hypothetical data sets. The emphasis is on moving carefully from the raw values to the final endpoints, while keeping track of what each calculation means and which assumptions make the interval appropriate.
Summary Statistics from Raw Data
To calculate \(s\), subtract the mean from each observation, square those deviations, add the squared deviations, divide by \(n-1\), and take the square root. The denominator is \(n-1\), not \(n\). The resulting quantity before taking the square root is the sample variance, \(s^2\).
A useful alternative for calculating the sum of squared deviations is
This identity can reduce repeated subtraction when the data set is small. It gives the same sum of squared deviations as calculating each deviation from \(\bar{x}\), provided the arithmetic is carried out accurately.
The identity is a calculation tool, not a different definition of standard deviation. In either form, \(s\) is measured in the original data units, while \(s^2\) is measured in squared units.
Model and Interval Formula
Before using the one-sample t procedure, specify the setting it is intended for. The data should be a random, independent sample from a population, and the measurements should be quantitative. For a small sample, the population distribution should be approximately normal; the interval can be sensitive to strong departures from this assumption. The specific checks for sampling and distribution shape are considered separately in the course.
When these conditions are appropriate, the one-sample t interval estimates the population mean \(\mu\). Its degrees of freedom are \(df=n-1\). For confidence level \(C\), let \(t^*\) be the positive critical value that leaves probability \((1-C)/2\) in each tail of a t distribution with \(n-1\) degrees of freedom. The standard error is \(SE=s/\sqrt{n}\), and the margin of error is \(t^*SE\).
For an independent sample from a normally distributed population, the statistic \((\bar{x}-\mu)/(s/\sqrt{n})\) follows a t distribution with \(n-1\) degrees of freedom. That result explains why the procedure uses a t critical value rather than a z critical value. In practice, once the assumptions are judged appropriate, the task is to calculate \(\bar{x}\) and \(s\) from the raw observations, select \(t^*\) using the confidence level and \(df\), and form the two endpoints.
Worked Calculations
Worked Example: Five Laboratory Measurements
Suppose five randomly selected, independent batches produce hypothetical measurements of a substance concentration, in milligrams per litre: \(8, 10, 9, 11, 7\). Assume the population distribution is approximately normal. Construct a 95% one-sample t interval for the population mean concentration.
Calculate the mean. The sum is \(8+10+9+11+7=45\), so
Calculate the sample standard deviation. The deviations from 9 are \(-1,1,0,2,-2\), so their squared deviations sum to \(1+1+0+4+4=10\). Thus
Find the standard error and critical value. Here \(n=5\), so \(df=4\). For a two-sided 95% interval, \(t^*=2.776\). Therefore,
Form the interval. Subtract and add the margin of error to the mean:
The 95% t interval extends from about 7.037 to 10.963 mg/L. Its center is the observed sample mean, 9 mg/L, and its half-width is the calculated margin of error. The sampling setup and approximate-normality assumption stated above are what justify using this procedure for these small-sample data.
Worked Example: Using the Computational Identity
Suppose six hypothetical, independently sampled wait times, in minutes, are \(12,15,11,14,13,17\). Assume the population distribution is approximately normal. Construct a 90% t interval for the population mean wait time.
Calculate the mean. The observations sum to \(82\), so \(\bar{x}=82/6=13.6667\) minutes.
Calculate the sample standard deviation. The sum of the squared observations is \(12^2+15^2+11^2+14^2+13^2+17^2=1144\). By the computational identity, the squared deviations sum to
Then
Calculate the standard error and margin of error. With \(n=6\), the degrees of freedom are \(df=5\). For a 90% interval, \(t^*=2.015\). Thus
Form the interval.
The interval endpoints are about 11.89 and 15.44 minutes. The computational identity avoids rounding the mean before finding the squared deviations; using rounded intermediate values can shift the result slightly.
Worked Example: A Smaller Sample and a 90% Interval
Consider four hypothetical, independently selected specimens with thicknesses \(4,5,5,6\) millimetres. Suppose the population distribution is approximately normal. Calculate a 90% t interval for the population mean thickness.
Find the mean and spread. The observations sum to 20, so \(\bar{x}=20/4=5\) mm. The deviations are \(-1,0,0,1\), with squared deviations summing to 2. Therefore,
Find the critical value and margin of error. The degrees of freedom are \(df=3\). For a 90% interval, \(t^*=2.353\). The standard error and margin of error are
Calculate both endpoints.
The resulting 90% interval is about 4.039 to 5.961 mm. With only four observations, this calculation depends particularly strongly on the assumption that the population distribution is approximately normal; the numerical steps alone cannot establish that assumption.
Checks and Common Mistakes
A few quick checks can catch many arithmetic or setup errors before an interval is reported:
- The sample mean and standard deviation should have the same units as the measurements; the variance has squared units.
- The degrees of freedom should be \(n-1\), where \(n\) is the number of observations.
- The standard error is \(s/\sqrt{n}\). For \(n>1\), \(SE\leq s\), with strict inequality when \(s>0\).
- The interval should be centered on \(\bar{x}\), and its half-width should equal \(t^*SE\).
A common mistake is to divide the sum of squared deviations by \(n\) when calculating the sample standard deviation. For the first example, that would give a variance of \(10/5=2\), rather than the sample variance \(10/4=2.5\), and would make the estimated spread too small. The correction is to use \(n-1\) in the sample variance formula. Another mistake is to use a critical value for the wrong degrees of freedom: the confidence level alone does not determine \(t^*\); \(df\) matters too.
If all observations are identical, then \(s=0\) and \(SE=0\); the inequality \(SE\leq s\) is an equality in that case. The formula would produce a zero-width interval, but that result does not establish that the population mean is known exactly. It signals that the observed data provide no measured spread for the usual t procedure to reflect, so the data and the model should be examined rather than treating the degenerate interval as conclusive.
Check Your Understanding
For each question, show enough work to make your calculation checkable.
- For the observations \(3,5,4,6\), calculate \(\bar{x}\), the sum of squared deviations, and \(s\).
- A sample has \(n=8\). What are the degrees of freedom for its one-sample t interval?
- Explain why the sample variance divides the sum of squared deviations by \(n-1\), rather than \(n\), in the formula for \(s^2\).
- A sample has \(s=2.4\) units and \(n=9\). Calculate its standard error and state whether it is less than or equal to \(s\).
- What two pieces of information determine the t critical value for a two-sided confidence interval?