Tutorials › Regression Analysis (Undergraduate) › Constructing a Confidence Interval for a Coefficient

Standard Errors and Confidence Intervals · Tutorial 206 of 991

Constructing a Confidence Interval for a Coefficient

Use a coefficient estimate and its standard error to calculate and interpret a two-sided regression confidence interval.

Beginner 9 min read

What You'll Learn

  • Identify the estimate, standard error, confidence level, and residual degrees of freedom needed for a coefficient interval.
  • Construct a two-sided interval by adding and subtracting a critical t value times the standard error.
  • Distinguish simple-regression degrees of freedom from multiple-regression degrees of freedom.
  • Interpret a slope interval in context, including its units and any adjustment for other predictors.
  • Recognize why the estimate plus or minus 1.96 standard errors is not always the correct regression interval.

From a Coefficient Estimate to an Interval

A regression coefficient is estimated from a sample, so the reported estimate is not usually the only value compatible with the data and model. Its standard error describes the sampling variability of the estimate. A confidence interval combines these two quantities to show a range of plausible values for the population coefficient, while accounting for the fact that the standard error is estimated.

For a two-sided interval, start with the coefficient estimate and extend a margin in both directions. That margin is the coefficient's standard error multiplied by a critical value from a \(t\) distribution. The critical value depends on the desired confidence level and the model's residual degrees of freedom. In the examples below, the appropriate critical value is supplied so that the focus remains on constructing the interval.

Definition: A two-sided confidence interval for a regression coefficient \(\beta_j\), based on its estimate \(\hat{\beta}_j\), standard error \(SE(\hat{\beta}_j)\), and critical \(t\) value \(t^*\), is
$$ \hat{\beta}_j \pm t^*SE(\hat{\beta}_j) $$
Equivalently, its lower and upper endpoints are \(\hat{\beta}_j-t^*SE(\hat{\beta}_j)\) and \(\hat{\beta}_j+t^*SE(\hat{\beta}_j)\). The interval estimates the coefficient in the units of that coefficient.

Here, \(\hat{\beta}_j\) is the sample estimate of the population coefficient \(\beta_j\), and \(SE(\hat{\beta}_j)\) is the estimated standard deviation of that estimate over repeated samples under the model. The standard error is not the same as the residual standard deviation: the former measures uncertainty in a coefficient estimate, while the latter measures the spread of the response around the fitted regression model.

Why the Critical Value Multiplies the Standard Error

The formula is based on a standardized coefficient estimate. For the usual regression \(t\) interval, suppose the response follows a linear regression model with independent errors having mean zero, a common variance \(\sigma^2\), and a normal distribution conditional on the predictors. The model must be correctly specified for the coefficient being estimated, and the predictor values must allow the coefficients to be estimated. Under these conditions, the estimate minus its population coefficient, divided by its estimated standard error, has a \(t\) distribution with the model's residual degrees of freedom.

In simple linear regression, the fitted model has an intercept and a slope, so the residual degrees of freedom are \(n-2\). In a multiple regression with \(q\) estimated coefficients in total, including the intercept, they are \(n-q\). The appropriate \(t^*\) is the value that leaves equal tail areas of \(\alpha/2\) in a two-sided interval with confidence level \(1-\alpha\).

$$ T=\frac{\hat{\beta}_j-\beta_j}{SE(\hat{\beta}_j)}\sim t_{df} $$

To see how this gives the interval, take the central \(1-\alpha\) part of this \(t\) distribution. By the definition of the critical value, the standardized estimate lies between \(-t^*\) and \(t^*\) with probability \(1-\alpha\). Multiplying all parts of that inequality by the positive standard error and then isolating \(\beta_j\) gives the interval formula.

$$ P\left(-t^*\leq \frac{\hat{\beta}_j-\beta_j}{SE(\hat{\beta}_j)} \leq t^*\right)=1-\alpha $$
$$ P\left(\hat{\beta}_j-t^*SE(\hat{\beta}_j) \leq \beta_j \leq \hat{\beta}_j+t^*SE(\hat{\beta}_j)\right)=1-\alpha $$

The \(t\) distribution accounts for estimating the error variance rather than knowing it. The resulting interval is centered on the coefficient estimate, and its margin of error is \(t^*SE(\hat{\beta}_j)\). A larger standard error or critical value produces a wider interval.

Worked Example: A 95% Interval for a Simple Regression Slope

In a hypothetical study, 12 independently measured greenhouse plots are used to examine the relationship between hours of light per day and plant growth over four weeks. A simple linear regression estimates the slope as \(1.80\) centimeters of growth per additional hour of light per day, with standard error \(0.62\) centimeters per hour. Suppose the scatterplot is reasonably linear, the residuals show no evident change in spread across fitted values, and the residual distribution is reasonably close to normal. Given independent plots, these conditions support using the conventional \(t\) interval. For \(n=12\), the residual degrees of freedom are \(12-2=10\); the supplied 95% critical value is \(t^*=2.228\).

First calculate the margin of error:

$$ 2.228(0.62)=1.38136\text{ centimeters per hour} $$

Then subtract and add this margin to the estimated slope:

$$ 1.80\pm1.38136 = (1.80-1.38136,\ 1.80+1.38136) = (0.4186,\ 3.181)\text{ centimeters per hour} $$

The 95% confidence interval for the population slope is approximately \(0.419\) to \(3.18\) centimeters of growth per additional hour of light per day. It describes the slope in the specified linear model; it does not establish that changing light exposure would cause a particular change in growth.

Reading the Interval in Context

An interval should be reported with the coefficient's context and units. A slope's units are response units per predictor unit. In a multiple regression, a coefficient for one predictor describes its association with the response while the other included predictors are held fixed. That adjusted interpretation does not, by itself, establish a causal effect.

The interval's endpoints represent the range of coefficient values produced by the calculation. In repeated use of this procedure under its assumptions, intervals constructed this way have the stated confidence level. The confidence level does not mean there is a probability of 95% that a fixed population coefficient is inside this particular calculated interval.

A useful reading is therefore: “Using this model and procedure, the data give a 95% confidence interval from [lower endpoint] to [upper endpoint] for the population coefficient, in [units and context].” Do not omit the coefficient's meaning, especially when a regression output contains several coefficients.

Worked Example: An Adjusted Coefficient in Multiple Regression

Consider a hypothetical analysis of wait time across 40 clinics. A multiple regression includes staffing level and two other predictors, so it estimates four coefficients in total, including the intercept. The estimated coefficient for staffing is \(-2.40\) minutes per additional staff member, with standard error \(1.10\) minutes per staff member. Suppose the model's conditional mean is reasonably represented by the included predictors, observations are independent, residual spread is approximately constant, and residuals are reasonably normal. Assume the design permits the coefficients to be estimated. The residual degrees of freedom are \(40-4=36\), and the supplied 95% critical value is \(t^*=2.028\).

The margin of error is

$$ 2.028(1.10)=2.2308\text{ minutes per staff member}. $$

Thus the interval is

$$ -2.40\pm2.2308 = (-2.40-2.2308,\ -2.40+2.2308) = (-4.631,\ -0.1692)\text{ minutes per staff member}. $$

The interval estimates the staffing coefficient as between about \(-4.63\) and \(-0.169\) minutes per additional staff member, holding the two other included predictors fixed. Both endpoints are negative, but the result remains an adjusted association in this hypothetical model; it does not alone show that adding staff would cause wait times to fall.

Choosing the Inputs and Checking the Arithmetic

Before calculating, identify which coefficient the question asks about and use that coefficient's own standard error. Then identify the confidence level and the model's residual degrees of freedom. The critical value must match both. The next step is arithmetic: multiply the standard error by \(t^*\), subtract the margin from the estimate for the lower endpoint, and add it for the upper endpoint.

The critical value is positive, so a correctly calculated two-sided interval is centered on the estimate and has the same margin of error on each side. This gives a quick check: the estimate should be the midpoint of the two endpoints, apart from rounding. Also check that both endpoints have the coefficient's units. A slope interval should not be reported only in response units; it is measured in response units per predictor unit.

Worked Example: A 90% Interval for a Study-Time Slope

In a hypothetical sample of 12 adult learners, a simple regression relates weekly study time to exam score. The estimated slope is \(0.75\) exam points per additional study hour, and its standard error is \(0.28\) points per hour. Assume learners' observations are independent, the relationship is reasonably linear, residual spread is roughly constant, and residuals are reasonably normal. With two fitted coefficients, the residual degrees of freedom are \(12-2=10\). For a 90% interval, use the supplied critical value \(t^*=1.812\).

Calculate the margin:

$$ 1.812(0.28)=0.50736\text{ exam points per hour}. $$

Subtract and add the margin:

$$ 0.75\pm0.50736 = (0.24264,\ 1.25736) \approx (0.243,\ 1.26)\text{ exam points per hour}. $$

The 90% confidence interval for the population slope is approximately \(0.243\) to \(1.26\) exam points per additional study hour. Its midpoint is \(0.75\), and its endpoints have the expected units. The interval describes a modeled association and does not by itself prove that additional study causes higher scores.

Common Mistake: Using the Wrong Margin

A frequent error is to multiply the standard error by \(1.96\) automatically. That value is a familiar standard normal critical value, but the conventional regression coefficient interval uses a \(t\) critical value because the error variance is estimated. In particular, the \(t\) critical value depends on the residual degrees of freedom and is generally larger than the corresponding normal critical value for finite degrees of freedom.

For the greenhouse example, using \(1.96\) would give a margin of \(1.96(0.62)=1.2152\), rather than the correct \(1.38136\) from the supplied \(t^*=2.228\). It would therefore produce a narrower interval than the specified \(t\) procedure. A different mistake is to report \(1.80\pm0.62\), using one standard error as though it were the confidence margin. The correction is to use the matching critical value times the standard error, and to show the resulting endpoints.

Key takeaway: For a two-sided regression coefficient interval, calculate \(\hat{\beta}_j-t^*SE(\hat{\beta}_j)\) and \(\hat{\beta}_j+t^*SE(\hat{\beta}_j)\). Match \(t^*\) to the confidence level and residual degrees of freedom, then interpret both endpoints in the coefficient's context and units.

Check Your Understanding

Use the interval formula and explain each answer in context.

  1. A simple regression has \(n=18\), a slope estimate of \(2.1\) units per hour, and slope standard error \(0.70\). What are the residual degrees of freedom?
  2. For a coefficient estimate of \(4.0\), standard error \(1.2\), and supplied critical value \(2.10\), calculate the two-sided interval.
  3. Why is the standard error alone not the margin of error for a conventional coefficient confidence interval?
  4. A multiple-regression coefficient is measured in minutes per additional worker. How should its interval be interpreted if the model also includes patient volume?
  5. What is wrong with interpreting a calculated 95% interval as giving a 95% probability that the fixed population coefficient is inside that particular interval?