IAN HELFRICH / SITE INDEXFind anything.
71 records

Teaching · applied econometrics

OLS assumptions

Seven simulations of classical linear-regression assumptions. Each changes one feature of the data-generating process and measures its effect on estimation and inference.

Bias, precision, and test size

Bias is the difference between the expected estimate and the target coefficient. Under the Gauss-Markov conditions, OLS has the smallest variance among linear unbiased estimators. The simulations compare coefficient bias, the reported standard error, and the frequency of rejecting a true null.

Each panel runs the same experiment. It builds a world where the true slope is exactly 1, draws 500 samples from it, estimates the slope in each, and tests a hypothesis that is true by construction. That gives three readings:

  1. Does the estimate still centre on the truth? The gap between the dashed line and the blue line is bias.
  2. Does the reported standard error match the real spread? The teal bar is how much the estimate actually moves between samples. The rust bar is how much the regression claims it moves.
  3. How often does a 5% test reject a true null? A correctly sized test rejects in 5% of repetitions; simulation estimates that frequency with sampling variation.

Every panel opens with its assumption satisfied. The first slider introduces the violation, and the three readings show which property of the estimate it affects.

Simulation results

Results at the maximum violation setting.
Assumption brokenEstimate still centred?Standard error accurate?Actual size of a 5% test
1 · SpecificationNo, bias −0.5Roughly99%
2 · Zero-mean errorYesYes5%
3 · ExogeneityNo, bias +1.2Roughly100%
4 · IndependenceYesNo, understates 6×~70%
5 · HomoskedasticityYesNo, understates 1.6×~22%
6 · No collinearityYesYes5%
7 · NormalityYesUnderstates on average5% or below

Specification and exogeneity failures bias the coefficient in these examples. Serial correlation and heteroskedasticity affect inference without shifting the coefficient’s mean. The remaining examples concern intercept normalization, near-collinearity, and nonnormal errors.

Seven experiments at a glance

Each graph shows forty simulated 95% intervals at the maximum setting, ordered by their coefficient estimate. Highlighted intervals exclude the true coefficient.

  1. 01Correct specification98 in 100 miss
  2. 02Zero-mean error5 in 100 miss
  3. 03Exogeneity100 in 100 miss
  4. 04Independent errors73 in 100 miss
  5. 05Constant variance22 in 100 miss
  6. 06No exact collinearity5 in 100 miss
  7. 07Normal errors2 in 100 miss

Assumption 1

The model is linear, correctly specified, and has an additive error

Yᵢ = β₀ + β₁X₁ᵢ + ⋯ + βₖXₖᵢ + εᵢ

Protects Unbiasedness

The policy setting

Spending per pupil raises test scores, and the first thousand dollars does more than the tenth. A budget office fits a line and reports a single per-dollar effect.

What breaks

The omitted squared term pulls the fitted slope down. At full curvature the true relationship is y = 1 + x − 0.5x², so the marginal effect falls from 1 at the lowest spending level to 0 at the highest. The average estimate is 0.5, the average of that marginal effect over the sample, against a linear-term coefficient of 1. A single per-dollar figure understates the return to the first dollars and overstates the return to the last.

How you detect it

Plot residuals against fitted values and regressors. Systematic curvature can indicate a missing nonlinear term; RESET tests for certain specification errors.

What you do about it

Consider a squared term, a log specification, or a spline, according to the relationship being modeled. Changing standard errors leaves the misspecified coefficient unchanged.

Question

What does a straight line cost you when the policy actually has diminishing returns?

A quadratic spending relationship fitted with a straight line. The slider controls the omitted curvature.

01 Correct specification

Where five hundred estimates land, and whether one hundred confidence intervals cover the true slopeThe upper panel is the distribution of the estimated slope across repeated samples, against the true slope. The lower panel draws one hundred confidence intervals as vertical lines; those that fail to cross the true slope are marked as misses. Every quantity is repeated in the text below the figure.Where five hundred estimates land00.511.5true β₁ = 1averagehow far estimates really move: ±0.119how far the regression says they move: ±0.11300.511.5One hundred 95% intervals, one per study5 of these 100 missthe truth, β₁ = 1a misssorted by estimate, smallest to largest
Each vertical line is one study's 95% interval. A line that fails to cross the horizontal rule is a study that would have reported a confidently wrong answer. Five in a hundred is the promise. These hundred are themselves a sample, so they wobble around the rate in the verdict, which uses all five hundred.
  1. Centre

    On target

    the estimate centres on the truth

  2. Honesty

    Honest

    the reported error matches the real spread

  3. The test

    Test holds

    6% across all 500 samples, against a promised 5%

All three readings are clean. The estimate centres on the truth, the reported uncertainty matches the real spread, and the test rejects the true null in 6% of the 500 samples, against a promised 5%. Of the hundred intervals drawn, 5 miss the truth; 95% coverage means five misses per hundred on average, and the count in any particular hundred varies around that figure.

Assumption 2

The error term has a population mean of zero

E(εᵢ) = 0

Protects Intercept normalization

The policy setting

A benefits survey collects self-reported spending. Respondents understate by roughly the same amount regardless of income, so every observation sits below its true value.

What breaks

The intercept absorbs the offset. Replacing the intercept by β₀ + 4 and the error by ε − 4 gives the same model with a zero-mean error.

How you detect it

OLS residuals sum to zero when a constant is included. That identity cannot establish the mean of the population error.

What you do about it

Include an intercept to absorb the common offset. Its interpretation depends on the outcome scale.

Question

If every household understates its spending by the same amount, what happens to the slope?

A common offset shifts the intercept and leaves the slope unchanged.

02 Zero-mean error

Where five hundred estimates land, and whether one hundred confidence intervals cover the true slopeThe upper panel is the distribution of the estimated slope across repeated samples, against the true slope. The lower panel draws one hundred confidence intervals as vertical lines; those that fail to cross the true slope are marked as misses. Every quantity is repeated in the text below the figure.Where five hundred estimates land0.50.7511.251.5true β₁ = 1averagehow far estimates really move: ±0.119how far the regression says they move: ±0.1130.50.7511.251.5One hundred 95% intervals, one per study5 of these 100 missthe truth, β₁ = 1a misssorted by estimate, smallest to largest
Each vertical line is one study's 95% interval. A line that fails to cross the horizontal rule is a study that would have reported a confidently wrong answer. Five in a hundred is the promise. These hundred are themselves a sample, so they wobble around the rate in the verdict, which uses all five hundred.
  1. Centre

    On target

    the estimate centres on the truth

  2. Honesty

    Honest

    the reported error matches the real spread

  3. The test

    Test holds

    6% across all 500 samples, against a promised 5%

All three readings are clean. The estimate centres on the truth, the reported uncertainty matches the real spread, and the test rejects the true null in 6% of the 500 samples, against a promised 5%. Of the hundred intervals drawn, 5 miss the truth; 95% coverage means five misses per hundred on average, and the count in any particular hundred varies around that figure.

Assumption 3

No regressor is correlated with the error term

Cov(Xⱼᵢ, εᵢ) = 0 for every j

Protects Unbiasedness

The policy setting

A job-training programme is evaluated on earnings. Motivation is unmeasured, raises earnings on its own, and predicts who enrols in the first place.

What breaks

At full strength, the average estimate is 2.2 against a true effect of 1. The simulation rejects the true null in nearly every repetition.

How you detect it

Residual diagnostics alone cannot establish exogeneity. Examine how enrollment was determined and which common causes of enrollment and earnings were measured.

What you do about it

A randomized assignment, valid instrument, discontinuity, or credible difference-in-differences design may address selection. Each requires its own identifying assumptions.

Question

How does selection into training affect the estimated earnings effect?

An unmeasured driver raises earnings and also predicts who enrols. The slider is how strongly enrolment and that driver move together.

03 Exogeneity

Where five hundred estimates land, and whether one hundred confidence intervals cover the true slopeThe upper panel is the distribution of the estimated slope across repeated samples, against the true slope. The lower panel draws one hundred confidence intervals as vertical lines; those that fail to cross the true slope are marked as misses. Every quantity is repeated in the text below the figure.Where five hundred estimates land0.511.522.5true β₁ = 1averagehow far estimates really move: ±0.209how far the regression says they move: ±0.2010.511.522.5One hundred 95% intervals, one per study6 of these 100 missthe truth, β₁ = 1a misssorted by estimate, smallest to largest
Each vertical line is one study's 95% interval. A line that fails to cross the horizontal rule is a study that would have reported a confidently wrong answer. Five in a hundred is the promise. These hundred are themselves a sample, so they wobble around the rate in the verdict, which uses all five hundred.
  1. Centre

    On target

    the estimate centres on the truth

  2. Honesty

    Honest

    the reported error matches the real spread

  3. The test

    Test holds

    6% across all 500 samples, against a promised 5%

All three readings are clean. The estimate centres on the truth, the reported uncertainty matches the real spread, and the test rejects the true null in 6% of the 500 samples, against a promised 5%. Of the hundred intervals drawn, 6 miss the truth; 95% coverage means five misses per hundred on average, and the count in any particular hundred varies around that figure.

Assumption 4

Observations of the error term are uncorrelated with each other

Corr(εᵢ, εⱼ) = 0 for i ≠ j

Protects Efficiency and valid standard errors

The policy setting

State unemployment is tracked quarterly after a stimulus. A bad quarter does not clear by the next one, so the shock persists.

What breaks

In this simulation, the slope remains unbiased. At full persistence, its sampling spread is about six times the reported standard error, and the nominal 5% test rejects roughly 70% of the time.

How you detect it

Plot residuals in time order and inspect their autocorrelation. Durbin-Watson and Breusch-Godfrey tests address specified forms of serial correlation.

What you do about it

Use a dependence-appropriate variance estimator, such as Newey-West. HC1 alone does not account for correlation across periods.

Question

How does serial correlation affect the standard error?

Errors follow an AR(1) process along a time trend. Total error variance is held fixed, so the only thing the slider changes is persistence.

04 Independent errors

Where five hundred estimates land, and whether one hundred confidence intervals cover the true slopeThe upper panel is the distribution of the estimated slope across repeated samples, against the true slope. The lower panel draws one hundred confidence intervals as vertical lines; those that fail to cross the true slope are marked as misses. Every quantity is repeated in the text below the figure.Where five hundred estimates land−0.500.511.522.5true β₁ = 1averagehow far estimates really move: ±0.146how far the regression says they move: ±0.154−0.500.511.522.5One hundred 95% intervals, one per study6 of these 100 missthe truth, β₁ = 1a misssorted by estimate, smallest to largest
Each vertical line is one study's 95% interval. A line that fails to cross the horizontal rule is a study that would have reported a confidently wrong answer. Five in a hundred is the promise. These hundred are themselves a sample, so they wobble around the rate in the verdict, which uses all five hundred.
  1. Centre

    On target

    the estimate centres on the truth

  2. Honesty

    Honest

    the reported error matches the real spread

  3. The test

    Test holds

    5% across all 500 samples, against a promised 5%

All three readings are clean. The estimate centres on the truth, the reported uncertainty matches the real spread, and the test rejects the true null in 5% of the 500 samples, against a promised 5%. Of the hundred intervals drawn, 6 miss the truth; 95% coverage means five misses per hundred on average, and the count in any particular hundred varies around that figure.

Assumption 5

The error term has constant variance

Var(εᵢ) = σ² for every i

Protects Efficiency and valid standard errors

The policy setting

Municipal expenditure is regressed on resident income across cities. A town of four thousand and a city of four million are one observation each, and the large ones vary enormously.

What breaks

The slope stays unbiased and the reported standard error reports only about 60% of the true spread. A nominal 5% test rejects a true null roughly 22% of the time. The noisiest observations are also the highest-leverage ones, which is what makes the distortion this severe.

How you detect it

Plot residuals against fitted values and look for a fan opening to the right. The White and Breusch-Pagan tests formalise it, with White the more general and Breusch-Pagan the cheaper in degrees of freedom.

What you do about it

HC1 reduces the rejection rate from about 22% to about 9% in this example. Its finite-sample performance can remain imperfect; the choice of variance estimator and functional form needs further checking.

Question

Large cities are noisier than small ones. What does that do to a significance test?

Error spread grows with the regressor, and the regressor is skewed the way municipal data actually is: many small units, a few very large ones.

05 Constant variance

Where five hundred estimates land, and whether one hundred confidence intervals cover the true slopeThe upper panel is the distribution of the estimated slope across repeated samples, against the true slope. The lower panel draws one hundred confidence intervals as vertical lines; those that fail to cross the true slope are marked as misses. Every quantity is repeated in the text below the figure.Where five hundred estimates land−0.500.511.522.5true β₁ = 1averagehow far estimates really move: ±0.123how far the regression says they move: ±0.116−0.500.511.522.5One hundred 95% intervals, one per study4 of these 100 missthe truth, β₁ = 1a misssorted by estimate, smallest to largest
Each vertical line is one study's 95% interval. A line that fails to cross the horizontal rule is a study that would have reported a confidently wrong answer. Five in a hundred is the promise. These hundred are themselves a sample, so they wobble around the rate in the verdict, which uses all five hundred.
  1. Centre

    On target

    the estimate centres on the truth

  2. Honesty

    Honest

    the reported error matches the real spread

  3. The test

    Test holds

    7% across all 500 samples, against a promised 5%

All three readings are clean. The estimate centres on the truth, the reported uncertainty matches the real spread, and the test rejects the true null in 7% of the 500 samples, against a promised 5%. Of the hundred intervals drawn, 4 miss the truth; 95% coverage means five misses per hundred on average, and the count in any particular hundred varies around that figure.

Assumption 6

No exact linear relationship between regressors

No Xⱼ is an exact linear combination of the others

Protects Identification, and then precision

The policy setting

Programme need is modelled on both the poverty rate and median household income across census tracts. The two are close to mirror images of each other.

What breaks

In this near-collinearity example, the estimate stays centered on the true coefficient while its spread grows about tenfold. The rejection rate remains near 5%.

How you detect it

Variance inflation factors, and the tell-tale pattern of a jointly significant F with no individually significant t. Wide confidence intervals on coefficients you expected to be sharp.

What you do about it

Additional independent variation can improve precision. Combining predictors changes the estimand; dropping one may change the specification. Exact collinearity prevents a unique coefficient estimate.

Question

If two predictors say almost the same thing, which one gets the credit?

Increasing the correlation between regressors widens the coefficient distribution and its reported standard error.

06 No exact collinearity

Where five hundred estimates land, and whether one hundred confidence intervals cover the true slopeThe upper panel is the distribution of the estimated slope across repeated samples, against the true slope. The lower panel draws one hundred confidence intervals as vertical lines; those that fail to cross the true slope are marked as misses. Every quantity is repeated in the text below the figure.Where five hundred estimates land−0.500.511.522.5true β₁ = 1averagehow far estimates really move: ±0.032how far the regression says they move: ±0.033−0.500.511.522.5One hundred 95% intervals, one per study0 of these 100 missthe truth, β₁ = 1a misssorted by estimate, smallest to largest
Each vertical line is one study's 95% interval. A line that fails to cross the horizontal rule is a study that would have reported a confidently wrong answer. Five in a hundred is the promise. These hundred are themselves a sample, so they wobble around the rate in the verdict, which uses all five hundred.
  1. Centre

    On target

    the estimate centres on the truth

  2. Honesty

    Honest

    the reported error matches the real spread

  3. The test

    Test holds

    4% across all 500 samples, against a promised 5%

All three readings are clean. The estimate centres on the truth, the reported uncertainty matches the real spread, and the test rejects the true null in 4% of the 500 samples, against a promised 5%. Of the hundred intervals drawn, 0 miss the truth; 95% coverage means five misses per hundred on average, and the count in any particular hundred varies around that figure.

Assumption 7

The error term is normally distributed

εᵢ ~ N(0, σ²)

Protects Exact finite-sample inference

The policy setting

Disaster relief payouts are regressed on damage assessments. Most claims are modest and a few are enormous, so the errors are nothing like a bell curve.

What breaks

For the sample sizes and error distributions shown here, the two-sided rejection rate stays near or below 5%. Other nonnormal distributions or test statistics can behave differently.

How you detect it

A QQ plot of the residuals, or Jarque-Bera. Both will correctly tell you the errors are not normal, which is a different question from whether it matters.

What you do about it

Check the behavior of the statistic for the relevant sample size and error distribution. Normality also affects prediction intervals and other distribution-dependent calculations.

Question

Disaster payouts are wildly skewed. Does that invalidate the t-test?

Mean-zero lognormal errors vary in skewness and tail weight.

07 Normal errors

Where five hundred estimates land, and whether one hundred confidence intervals cover the true slopeThe upper panel is the distribution of the estimated slope across repeated samples, against the true slope. The lower panel draws one hundred confidence intervals as vertical lines; those that fail to cross the true slope are marked as misses. Every quantity is repeated in the text below the figure.Where five hundred estimates land0.250.50.7511.251.51.75true β₁ = 1averagehow far estimates really move: ±0.390how far the regression says they move: ±0.3890.250.50.7511.251.51.75One hundred 95% intervals, one per study2 of these 100 missthe truth, β₁ = 1a misssorted by estimate, smallest to largest
Each vertical line is one study's 95% interval. A line that fails to cross the horizontal rule is a study that would have reported a confidently wrong answer. Five in a hundred is the promise. These hundred are themselves a sample, so they wobble around the rate in the verdict, which uses all five hundred.
  1. Centre

    On target

    the estimate centres on the truth

  2. Honesty

    Honest

    the reported error matches the real spread

  3. The test

    Test holds

    4% across all 500 samples, against a promised 5%

All three readings are clean. The estimate centres on the truth, the reported uncertainty matches the real spread, and the test rejects the true null in 4% of the 500 samples, against a promised 5%. Of the hundred intervals drawn, 2 miss the truth; 95% coverage means five misses per hundred on average, and the count in any particular hundred varies around that figure.

Implications for applied work

Specification and identification determine what a coefficient estimates. Variance assumptions determine whether the reported uncertainty is appropriate. These examples isolate one issue at a time; an empirical analysis may face several together.

Heteroskedasticity-robust standard errors address unequal error variance. They do not remove omitted-variable bias or establish a causal interpretation.