Linear Regression for Experimental Research
Least squares fits a line, or a hyperplane, by minimising squared residuals, and supplies coefficients with standard errors from which tests and intervals follow. Two things it does not supply: a causal reading, which comes from the design rather than the fit, and evidence of a good model, which R-squared does not measure. A randomized treatment effect can be entirely credible with a low R-squared.
Definition
The simple linear model is
Fitted values and residuals are
Formal statement
Assumptions and scope
A coefficient is an association. A causal reading requires a design or an identification argument, and the fit supplies neither.
measures in-sample fit. It is not evidence of correctness, and a low value is compatible with a credible and precisely estimated treatment effect. Each coefficient is conditional on the other predictors in the model. Adding or removing a variable changes what the remaining coefficients mean.
The classical variance formula
assumes homoskedastic uncorrelated errors. Robust or design-based standard errors are appropriate when those assumptions fail. requiresto be invertible; perfectly collinear predictors make the coefficients individually undefined. Residual degrees of freedom are
minus the number of estimated coefficients, which is for an intercept and one slope.Extrapolating the fitted line beyond the range of the observed predictors asserts a relationship the data do not cover.
Worked material
Example
The same effect at two very different R-squareds
Two regressions from the same randomized trial of a tutoring programme,
Regression 1: outcome on treatment alone.
Regression 2: outcome on treatment, baseline score, and school.
What changed and what did not. The estimated effect barely moved, which randomization leads you to expect. The standard error more than halved, because baseline score explains much of the outcome variation that was previously in the residual.
What the
Reading Regression 1 on its own. An
Non-example
Claims a fitted regression does not support
"
"
Selecting the specification with the highest
Reading a coefficient without naming what is held fixed. "The effect of advertising is 1.85" omits that the comparison is between stores alike on the other predictors. Change the predictor set and the number changes meaning.
Using classical standard errors when the variance is not constant.
Predicting outside the observed range of the predictors. The fitted line is estimated where the data are. Extending it asserts a relationship over a region the data do not cover.
Contrast
Explained variation against causal warrant
| What | What a causal reading requires | |
|---|---|---|
| Question answered | How much outcome variation does the model track here? | What would happen under an intervention? |
| Computed from | Fitted versus observed values | Nothing in the output — it comes from the design |
| Improved by | Adding predictors, always | Randomization, or an identification argument |
| High value implies | Good in-sample tracking | Nothing |
| Low value implies | Much variation unexplained | Nothing |
Why the two get conflated. They appear in the same output, and "explains 71% of the variance" sounds like a claim about explanation in the ordinary sense. It is not; it is a claim about squared distances.
The clean separation. Ask where the comparison came from. If treatment was randomized, the coefficient is causal at any
A useful case to hold onto. A well-run trial with
Where
Common errors
Common misconception
A high R-squared shows the model is correct and its coefficients can be trusted, while a low R-squared means the analysis has failed and its estimates are not worth reporting.
Related units
Requires
Connected
- Regression Adjustment in Experiments (used by)
- Indicator Variables and Interactions (suggested next)