18. Inference for Linear Regression

b. Confidence Interval for the Slope
Math 115

Yurk

From Testing to Estimating

Where we left off. 168 NYC Italian restaurants (Zagat): does food rating (0–30 scale) predict the price of dinner? The fitted slope was b_1 = 2.94 dollars per rating point, and the test rejected H_0: \beta_1 = 0 with p < 0.001.

That test answered “Is the slope different from zero?” — a yes or no.

The natural follow-up: “How big is the population slope?”

Rejecting H_0 rules out exactly zero and nothing more. We need a range.

Solution: a confidence interval for \beta_1 — the same t machinery we used for means, applied to the regression slope.

CI Formula for the Slope

When conditions are met:

b_1 \;\pm\; t^*_{df} \times SE_{b_1}

  • b_1 — sample slope (point estimate)
  • t^*_{df} — critical value with df = n - 2 (from a t-table or statistical software)
  • SE_{b_1} — standard error of the slope (from regression output)

Computing the CI

The regression output from 18a — everything you need is in the Food row:

Term Estimate (b) Std. Error (SE) T p-value
(Intercept) -17.83 5.863 -3.04 0.003
Food 2.94 0.283 10.37 < 0.001

Critical value for 95% confidence, df = 166: t^*_{166} = 1.974.

  1. Compute the margin of error. ME = t^* \times SE_{b_1} = 1.974 \times 0.283 \approx 0.56

  2. Build the 95% CI for \beta_1. b_1 \pm ME = 2.94 \pm 0.56 \approx (2.38, \; 3.50) dollars per food-rating point.

Interpreting the CI

95% CI for \beta_1: (2.38,\; 3.50) dollars per food rating point.

In plain terms:

We are 95% confident that for each additional point of food rating, the average meal price at NYC Italian restaurants increases by between \$2.38 and \$3.50.

Note the units. The slope is dollars per food-rating point, so the CI is in those same units.

Does the CI include 0? No — the whole interval sits above zero. That’s consistent with rejecting H_0 in 18a.

New Predictor

New research question: Is the price of dinner at an NYC Italian restaurant related to its décor rating? Same 168 restaurants, but the predictor is now décor rating (also Zagat’s 0–30 scale) instead of food rating.

Try it — a new question needs its own condition check. Work through all four.

Linearity ✓ and constant variance ✓ — the scatter rises in a straight band; the residuals show no curve and no fan. Normality ✓ — no extreme points or lopsided spread in the residuals. Independence ✓ — from the design: each restaurant was surveyed separately.

CI for the Décor Slope

Conditions are met — here’s the regression output for the décor model:

Term Estimate (b) Std. Error (SE) T p-value
(Intercept) -1.36 3.292 -0.41 0.68
Decor 2.49 0.184 13.54 < 0.001
  1. Compute the 95% CI for \beta_1 and write a one-sentence interpretation. (Still df = 166, so t^* = 1.974 as before.) ME = 1.974 \times 0.184 \approx 0.36; 95% CI = 2.49 \pm 0.36 \approx (2.13, \; 2.85) dollars per décor point. We are 95% confident that each additional décor-rating point is associated with between \$2.13 and \$2.85 more in average meal price.

  2. Does the CI include 0? What does that imply for the hypothesis test H_0: \beta_1 = 0? No — the entire CI sits above zero. So we’d reject H_0 at \alpha = 0.05. Décor rating, like food rating, is significantly related to price.

What We’ve Built — The Whole Course

We started by describing data — distributions, summaries, graphs, the least-squares line. Inference layers on top: a statistic, a reference distribution for how much it varies from sample to sample, and either a test or a CI.

Question Statistic Reference
One proportion (T3, T6) \hat{p} Normal
Two proportions (T9, T10) \hat{p}_1 - \hat{p}_2 Normal
One mean (T11) \bar{x} t
Two means independent (T12) \bar{x}_1 - \bar{x}_2 t
Paired means (T13) \bar{x}_d t
Two categorical (T14) X^2 Chi-square
Multiple means (T15) F F
Slope (T18) \boldsymbol{b_1} \boldsymbol{t}

Scope of Inference, Always

Two questions you should ask of any inferential result, before quoting it:

  1. Generalization. Was this a random sample of some population?
    • Yes → conclusion generalizes to that population.
    • No → conclusion is confined to the units actually studied.
  2. Causation. Was the explanatory variable randomly assigned?
    • Yes → a causal claim is justified.
    • No → only an association.

Try it — apply both to our restaurant result.

Generalization: these are Zagat-guide restaurants with enough diner reviews to be listed — not a random sample of NYC Italian restaurants. Strictly, the result describes the restaurants studied; extending it further is a judgment call, not something the sampling justifies. Causation: nobody assigned food ratings, so association only.

Thank You

Thank you for working through this course together.

References

  • Introduction to Modern Statistics (2e) textbook by Mine Çetinkaya-Rundel and Johanna Hardin
  • Sections 24.5, 24.6
  • Sheather, S. J. (2009). A Modern Approach to Regression with R. Springer. (restNYC data.)