Tutorials › Introduction to Statistics › Deriving the Margin of Error

Confidence Intervals for Means · Tutorial 581 of 996

Deriving the Margin of Error

Learn why the one-sample t interval has margin of error \(t^*s/\sqrt{n}\) and how to interpret each part of that expression.

Intermediate 9 min read

What You'll Learn

  • Derive the margin of error from the endpoints of a one-sample t interval
  • Define the t critical value used for a two-sided confidence interval
  • Calculate a margin of error and interpret it in the measurement’s units
  • Explain how the sample standard deviation and sample size enter the calculation
  • Describe how the confidence level and degrees of freedom affect the critical value
  • Avoid confusing a margin of error with a standard error or a full interval width

Why Derive the Margin of Error?

A confidence interval for a population mean reports a range of plausible values, but its margin of error describes the range’s precision in one number. Knowing how that number is constructed helps you check a calculation and understand why two intervals based on different samples may have different widths.

For a one-sample t interval, the margin of error is the t critical value multiplied by the estimated standard error of the sample mean. The critical value reflects the confidence level and degrees of freedom; the standard error reflects the sample’s variability and size. The derivation below makes their roles explicit.

Model and Notation

Suppose \(X_1,\ldots,X_n\) are observations from a population with mean \(\mu\). The sample mean is \(\bar{x}\), the sample standard deviation is \(s\), and the standard error used to estimate the variability of the sample mean is \(s/\sqrt{n}\). For a two-sided confidence level \(C=1-\alpha\), \(t^*\) denotes the positive critical value for the chosen degrees of freedom \(df=n-1\), satisfying a central probability of \(C\) under that t distribution.

Before using a one-sample t interval, its sampling conditions must be reasonable. The observations should be independent, and the sampling distribution of the mean should be well represented by the t procedure. If the observations are independent and normally distributed, the t-statistic has an exact t distribution. For a sufficiently large sample from a nonnormal population, the t procedure can be an approximation when the data do not have severe skewness or extreme outliers; in that setting, the resulting interval has approximate rather than exact coverage.

Definition: The margin of error (ME) is the distance from the center of a two-sided confidence interval to either endpoint. For the one-sample t interval, \(ME=t^*s/\sqrt{n}\). It has the same units as the observations.

Under independent sampling from a normal population, the standardized statistic \((\bar{X}-\mu)/(S/\sqrt{n})\) has an exact t distribution with \(n-1\) degrees of freedom. Under appropriate large-sample conditions, the t distribution is an approximation for this statistic. In either case, using the corresponding critical value produces the one-sample t interval in the form

$$ \bar{x}\ \pm\ t^*\frac{s}{\sqrt{n}}. $$

Here, \(\bar{x}\) is the center, while the amount added and subtracted is the margin of error. The exact-distribution statement and the approximate-distribution statement should not be confused: the algebraic form of the interval is the same, but the coverage claim is exact only under the exact model.

Deriving the Formula

Write the interval using its lower endpoint \(L\) and upper endpoint \(U\). The two endpoints are found by subtracting and adding the same quantity to the sample mean:

$$ L=\bar{x}-t^*\frac{s}{\sqrt{n}}, \qquad U=\bar{x}+t^*\frac{s}{\sqrt{n}}. $$

The width of the interval is the upper endpoint minus the lower endpoint. Substituting the endpoint expressions and simplifying gives

$$ \begin{aligned} U-L &=\left(\bar{x}+t^*\frac{s}{\sqrt{n}}\right) -\left(\bar{x}-t^*\frac{s}{\sqrt{n}}\right)\\ &=2t^*\frac{s}{\sqrt{n}}. \end{aligned} $$

The margin of error is half the total width, so dividing by two yields

$$ ME=\frac{U-L}{2} =\frac{2t^*s/\sqrt{n}}{2} =t^*\frac{s}{\sqrt{n}}. $$

This also shows why the margin is not the full width: the full width is \(2ME\). The interval is centered at \(\bar{x}\), and each endpoint is exactly one margin of error away from that center.

What Each Quantity Contributes

The formula \(ME=t^*s/\sqrt{n}\) separates the margin into components with different meanings. The sample standard deviation \(s\) measures the observed spread of individual values around their sample mean. Holding \(t^*\) and \(n\) fixed, doubling \(s\) doubles the margin of error. More variable observations therefore lead to a wider interval.

The sample size \(n\) appears inside a square root in the denominator. Holding \(s\) and \(t^*\) fixed, increasing \(n\) reduces \(s/\sqrt{n}\), the estimated standard error of the mean. The effect is not a simple inverse relationship with \(n\): for example, multiplying \(n\) by four divides \(1/\sqrt{n}\) by two. In practice, \(t^*\) also depends on \(df=n-1\), so comparisons across sample sizes should use the appropriate critical value for each sample.

The critical value \(t^*\) is dimensionless: it multiplies the standard error to set how many standard errors extend from the center to each endpoint. At a fixed \(df\), a higher two-sided confidence level requires a larger critical value and therefore a larger margin of error. Because \(t^*\) depends on both the confidence level and the degrees of freedom, it is not interchangeable with a universal constant.

Worked Example: Calculating a Margin of Error

In a hypothetical study, a random sample of 16 independent adults is drawn from a normally distributed population. The sample standard deviation of their resting heart rates is 12 beats per minute. For a 95% confidence interval, the t critical value with \(df=15\) is approximately \(2.131\). Calculate the margin of error.

The sample is specified as independent and drawn from a normal population, so the t model is exact. The degrees of freedom are \(n-1=16-1=15\), matching the supplied critical value. First calculate the standard error:

$$ SE=\frac{s}{\sqrt{n}} =\frac{12\ \text{beats per minute}}{\sqrt{16}} =3\ \text{beats per minute}. $$

Now multiply the standard error by the critical value:

$$ ME=t^*SE =2.131(3) =6.393\ \text{beats per minute}. $$

The margin of error is approximately 6.393 beats per minute. If the sample mean were 72 beats per minute, the interval endpoints would be \(72-6.393=65.607\) and \(72+6.393=78.393\) beats per minute. The margin describes the distance from the sample mean to either endpoint, not the total interval width, which is \(2(6.393)=12.786\) beats per minute.

Worked Example: How the Sample Standard Deviation Changes the Margin

Consider two hypothetical independent random samples, each of size 25, from normally distributed populations. Suppose both are analyzed at 95% confidence, for which \(t^*=2.064\) with \(df=24\). Sample A has \(s=8\) kilograms, while Sample B has \(s=16\) kilograms. Calculate and compare the margins of error.

The samples have the same size and confidence level, so they use the same degrees of freedom and critical value. For Sample A:

$$ ME_A=2.064\frac{8\ \text{kg}}{\sqrt{25}} =2.064(1.6\ \text{kg}) =3.3024\ \text{kg}. $$

For Sample B:

$$ ME_B=2.064\frac{16\ \text{kg}}{\sqrt{25}} =2.064(3.2\ \text{kg}) =6.6048\ \text{kg}. $$

Sample B’s standard deviation is twice Sample A’s, and its margin of error is also twice as large. This is the direct effect of \(s\) in the formula when \(t^*\) and \(n\) are held fixed. Each margin is in kilograms because the critical value is dimensionless and \(s/\sqrt{n}\) retains the units of the measurement.

Worked Example: Comparing Sample Sizes

Two hypothetical independent random samples come from normally distributed populations and are measured in centimeters. Both have a sample standard deviation of 10 centimeters and use 95% confidence. Sample A has \(n=25\), with \(t^*=2.064\) for \(df=24\). Sample B has \(n=100\), with \(t^*=1.984\) for \(df=99\). Find both margins of error.

For Sample A, the standard error is \(10/\sqrt{25}=2\) centimeters, so

$$ ME_A=2.064\left(\frac{10}{\sqrt{25}}\right) =2.064(2) =4.128\ \text{cm}. $$

For Sample B, the standard error is \(10/\sqrt{100}=1\) centimeter, so

$$ ME_B=1.984\left(\frac{10}{\sqrt{100}}\right) =1.984(1) =1.984\ \text{cm}. $$

The larger sample has a smaller margin of error. The standard error is halved when the sample size increases from 25 to 100, while the critical value also changes because the degrees of freedom change. Thus the exact comparison uses both sample-specific critical values, rather than considering \(1/\sqrt{n}\) alone.

Worked Example: How Confidence Level Affects the Margin

A hypothetical independent random sample of 20 observations comes from a normally distributed population. The sample standard deviation is 5 units. For \(df=19\), the critical values are \(1.729\) for a two-sided 90% interval and \(2.093\) for a two-sided 95% interval. Compare the margins of error.

The standard error is the same for both intervals:

$$ SE=\frac{5}{\sqrt{20}} \approx 1.1180\ \text{units}. $$

Using each confidence level’s critical value gives

$$ ME_{90\%}=1.729\left(\frac{5}{\sqrt{20}}\right) \approx 1.933\ \text{units}, \qquad ME_{95\%}=2.093\left(\frac{5}{\sqrt{20}}\right) \approx 2.340\ \text{units}. $$

The 95% interval has the larger margin because its critical value is larger. At a given sample size and standard deviation, a wider interval is needed to achieve the higher confidence level.

Common Mistakes

  • Using \(s/\sqrt{n}\) as the margin of error. That expression is the estimated standard error. The t interval’s margin is \(t^*\) times that standard error.
  • Reporting the full width as the margin. The full interval width is \(2ME\); the margin is half that width.
  • Using \(n\) instead of \(\sqrt{n}\). The standard error of the sample mean is \(s/\sqrt{n}\), not \(s/n\).
  • Treating the t distribution as exact under every condition. The statistic has an exact t distribution for independent normal observations. With suitable large-sample conditions for a nonnormal population, the t procedure is approximate.
  • Ignoring units. The critical value has no units, so the margin of error has the same units as \(s\) and the original measurements.

A useful check is to ask whether the result is a distance from the sample mean, whether it has the measurement’s units, and whether it includes the t critical value as well as the standard error. If any answer is no, revisit the calculation.

Key takeaway: The one-sample t interval is centered at \(\bar{x}\), with \(ME=t^*s/\sqrt{n}\) extending in either direction. The sample spread, sample size, confidence level, and degrees of freedom all contribute to the interval’s precision.

Check Your Understanding

Use the formula and the explanations above to answer these questions.

  1. In a two-sided confidence interval, how is the margin of error related to the interval’s full width?
  2. A sample has \(n=36\), \(s=9\) seconds, and \(t^*=2.030\). Calculate the standard error and margin of error, including units.
  3. If \(s\) doubles while \(n\) and \(t^*\) stay fixed, what happens to the margin of error? Explain using the formula.
  4. Why must the critical value be recalculated when the confidence level changes?
  5. When is the t-statistic’s t distribution exact, and how should it be described under suitable large-sample conditions for a nonnormal population?