StudyVisuallyStart studying
Part 08 · Correlation and regression · Card 7 of 9

Inference for the slope

To test whether x really predicts y, test H0: true slope = 0. The statistic is t = b1 / SE(b1) with n - 2 degrees of freedom, where SE(b1) = s / square root of Sxx and s = square root of (residual SS / (n - 2)).

Last updated

Analogy

It asks whether the slope you found is bigger than the wobble you would expect from a line fitted to pure noise.

Example

Testing the slope

Residual SS = 2.4, n = 5s = square root of (2.4 / 3) = 0.894SE = 0.894 / square root of 10 = 0.283t = 0.6 / 0.283 = 2.12, df = 3p about 0.12: not significant

In practice

Tells you if a link is real or could be a fluke of a small sample.

Practice

Flashcards

  • Degrees of freedom for the slope t test?n minus 2.

Questions people ask

Why does the slope test use n minus 2 degrees of freedom?

Fitting the line uses two estimated numbers, the intercept and the slope, so two degrees of freedom are used up. That leaves n minus 2 to estimate the error spread. With 5 points that leaves just 3, so evidence is weak.

How do I build a confidence interval for the slope?

Take the slope plus or minus the critical t value times the standard error, using n minus 2 degrees of freedom. If the interval excludes zero, the slope test is significant at the matching level. The interval also shows how large the effect might be.