Hexa Scholar

Standard errors of regression coefficients

A hanging spring with a gold weight beside a plain measuring rail on a workbench.
A weight stretches a spring, and a rail beside it gives a reference for measuring its length.

The question

You have a fixed number of spring readings. Where would you place them to get the most precise slope?

  1. 1 SeeChoose where to measure a spring.
  2. 2 TryMove the zero point of the load.
  3. 3 ProveDerive the spread of each coefficient.
  4. 4 ApplyCompute and interpret standard errors.
Before you start · 3 quick checks on means, slopes and standard deviation

Two ideas before you start

2 ideas

New 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.

1 See

Choose a measurement plan

2 Try

Change where the load scale starts

3 Prove

Follow the noise through the fit

Theorem

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.

4 Apply

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.

Key point Check what the coefficient measures and keep its units. If you use residuals to estimate the noise variance, count the fitted coefficients when you choose the divisor. Exact small-sample \(t\) inference here also uses normal, independent errors.
Level Intermediate Prerequisites Least squares, means and variance Time ~25 min

Further reading