Standard errors of regression coefficients
The question
You have a fixed number of spring readings. Where would you place them to get the most precise slope?
- 1 SeeChoose where to measure a spring.
- 2 TryMove the zero point of the load.
- 3 ProveDerive the spread of each coefficient.
- 4 ApplyCompute and interpret standard errors.
Before you start · 3 quick checks on means, slopes and standard deviation
Two ideas before you start
2 ideasNew readings give a new line
Two sets of readings use the same input settings. Each set has its own fitted line.
Keep the load settings fixed and take fresh readings. The new readings can change both the fitted height and the slope.
Exact definition
Write \(x_i\) for the fixed input at reading \(i\), \(Y_i\) for its random response, and \(y_i\) for a value we observe. The model is \(Y_i = a + bx_i + \varepsilon_i\). The fixed coefficients \(a\) and \(b\) are the true intercept and slope. The error \(\varepsilon_i\) is the random difference from the true line.
Ordinary least squares (OLS) picks \(\hat a,\hat b\) to minimize the sum of squared vertical misses. The formula for the fit is in least squares. The hats denote quantities computed from the readings, so they can vary from one repetition to the next.
Put the slopes on a number line
The slopes from the two sets of readings appear as ticks on a horizontal scale.
Each fit contributes one slope. Repeat the same experiment many times and ask how spread out the slopes are.
Exact definition
The distribution of an estimate over repetitions is its sampling distribution. For fixed loads its standard deviation is the standard error of the estimator. The true sampling spread depends on the noise in the model. A regression output usually reports an estimated standard error computed from the observed data.
A residual is \(y_i - \hat a - \hat b x_i\). It measures how far a reading lies above or below its fitted line. The error in the model uses the true line. The slope estimation error is a third quantity, \(\hat b - b\), with units of response per unit of input.
What stays fixed when you repeat a design?
Schedule the loads in advance. Each run uses the same loads, the same underlying line and the same measurement process. With mean-zero errors, the line gives the expected reading at each load. In the simulation, errors are independent and have a common standard deviation at all loads.
The real spring is an illustration. The experiment assumes the spring stays in a range where a straight line is an adequate model and the reading noise has the same variance throughout that range.
Choose a measurement plan
- Compare the loads in the three plans. They have the same number of readings and the same lightest and heaviest loads.
- Choose the plan you think gives the smallest sampling standard deviation for the slope. Check it to see the fitted lines and scores.
| Plan | SD of simulated slopes | Model SD |
|---|
How the repeated fits are made
Change where the load scale starts
- Predict what happens when you subtract the same constant from every load.
- After checking, move the zero point to compare the two coefficient standard errors.
Keep the physical loads and all readings fixed. For a chosen reference load \(c\), use \(x_i-c\) as the input. The new intercept estimates the mean response at physical load \(c\). Each fitted line still assigns the same height to each physical load.
Read the two formulas
Write \(\bar x\) for the mean load and \(S_{xx} = \sum_i(x_i-\bar x)^2\) for the centered sum of squares. With \(n\) readings and common error standard deviation \(\sigma\), the formulas are
\[\begin{aligned} \operatorname{SD}(\hat b)&=\frac{\sigma}{\sqrt{S_{xx}}},\\ \operatorname{SD}(\hat a_c)&=\sigma\sqrt{\frac1n+\frac{(\bar x-c)^2}{S_{xx}}}. \end{aligned}\]Moving the origin preserves the centered deviations. The second formula measures the precision of a fitted mean at \(c\), including at a reference load outside the observed range if the same straight-line model holds there. Predicting an individual new reading with independent error of variance \(\sigma^2\) adds \(\sigma^2\) to the variance of the prediction error.
Follow the noise through the fit
Fit a line with an intercept to \(Y_i=a+bx_i+\varepsilon_i\) at \(n\ge3\) fixed, nonconstant inputs \(x_i\). Suppose the errors have mean zero, common variance \(\sigma^2\gt0\) and zero pairwise covariance.
Write \(S_{xx}=\sum_i(x_i-\bar x)^2\), where \(\bar x\) is the input mean. Let \(R=\sum_i(Y_i-\hat a-\hat b x_i)^2\) be the residual sum of squares. Then
\[\begin{aligned} \operatorname{Var}(\hat b)&=\frac{\sigma^2}{S_{xx}},\\ \operatorname{Var}(\hat a)&=\sigma^2\left(\frac1n+\frac{\bar x^2}{S_{xx}}\right),\\ \operatorname{E}[R]&=(n-2)\sigma^2. \end{aligned}\]Start with the OLS formulas. The weights \(w_i=(x_i-\bar x)/S_{xx}\) give \(\hat b=\sum_i w_iY_i\). The intercept is \(\hat a=\bar Y-\bar x\hat b\), with \(\bar Y\) the response mean. Choose the next true statement about this model at each step.
From a variance formula to a reported standard error
Use \(s^2=R/(n-2)\) as an unbiased estimate of the error variance and let \(s=\sqrt{s^2}\). Replace \(\sigma\) by \(s\) in the standard deviations. The reported slope standard error is \(s/\sqrt{S_{xx}}\). The reported intercept standard error is \(s\sqrt{1/n+\bar x^2/S_{xx}}\). Unbiasedness applies to the variance estimate. Taking its square root need not preserve unbiasedness.
The calculation for \(R\) is a projection. The constant vector and the centered input vector span the space of fitted values. The residual vector lies in the perpendicular space. See OLS as a projection for the geometry of this decomposition.
When does a coefficient have a t interval?
Add the assumption of independent normal errors with the same positive variance. Rotate the error vector into orthonormal coordinates with the first two axes along the fitted space. After division by \(\sigma\), the coordinates are independent standard normals. The coefficient errors use the first two coordinates. The residual sum of squares divided by \(\sigma^2\) is the sum of squares of the remaining \(n-2\) coordinates.
So either coefficient error, divided by its estimated standard error, has a \(t\) distribution with \(n-2\) degrees of freedom. The denominator is positive with probability one in this model. For a confidence interval, multiply the estimated standard error by the corresponding two-sided critical value and add and subtract that amount from the estimate. The lesson on the t distribution explains the normal divided by an independent estimated scale.
Compute the uncertainty of a coefficient
Use the formulas for a line with an intercept and fixed, nonconstant inputs. Each problem supplies its noise assumptions. The hints are available before you submit.
Further reading
- Jeffrey M. Wooldridge, Introductory Econometrics: A Modern Approach, the chapter “The Simple Regression Model.”