ECON 3334/ LINEAR REGRESSION
01:00
ECON 3334 · Introduction to econometrics · L2

Linear regression.
Let’s make it
make sense.

Fit a line. Read a result. Question the conclusion.

50 minutes · predict → discuss → reveal
Discuss your prediction with a neighbour before each reveal.

Today’s question:
What does a regression actually let us say?
01 · Think in averages · 5 min

An average is not a promise.

Population · equal probabilities
Predict, then explain

Three play sessions. An activity score of 18.
How far is this cat from “typical”?

We can compare it with the average at X = 3, or with the best straight-line prediction.

One cat can differ from its group’s average
Possible outcomesf(X) = E[Y | X]β₀ + β₁X = 11 + X
Observed cat18

Each of 15 outcomes is equally likely. The group means are 10, 14, 16, 16, 14.

02 · Fit the line · 7 min

Can your line beat OLS?

Sample fit · 6 cats
Two volunteers, one line

One person chooses the intercept. Another chooses the slope. Make the squared vertical errors as small as possible.

Ŷ = 8.00 + 1.20X
—
RSS · total squared error
—
Mean residual
The error is measured vertically
Observed catsYour prediction┆ residual+ sample average

X = minutes of feather-wand play; Y = toy pounces.

03 · Read a coefficient · 5 min

46 more treat packs. What does that mean?

Choose A, B, C or D

A cat-treat brand has a TV coefficient of 0.04576. Which interpretation fits?

A cat-treat brand’s campaign

TermCoefficient
Intercept2.93889
TV0.04576
Radio0.18853
Newspaper−0.00104

Sales: 1,000 treat packs. Budgets: $1,000.
Compare two predictions: TV changes;
radio and newspaper stay the same.

+45.8
Predicted change in treat packs sold

ISL resources.

Test a budget reallocation

Moving $1,000 from radio to TV predicts a change of −142.77 packs. Its standard error is 60 packs. Test whether the adjusted slopes are equal at 5% using a two-sided cutoff of 2. What would justify a causal recommendation?

Worked answer

The contrast is TV minus radio. Under equal slopes, its expected value under the null is zero. The statistic is −142.77 / 60 ≈ −2.38. Reject at 5%. The interval is −142.77 ± 120, or [−262.77, −22.77] packs. A causal interpretation also needs a source of variation in the reallocation unrelated to other sales determinants, such as random assignment.

04 · Question the story · 5 min

Should I drink my way to an A?

Coffee and exam scores
Think → pair → share

Students who drink more coffee have higher scores. Would you prescribe another cup?

What if well-prepared students also tend to buy more coffee?

+8.0
Pooled slope · points/cup

Optional formula: β₁short = β₁ + β₂ Cov(X,W)/Var(X), when Cov(X,u)=0 in the full model.

One pooled relationship

X = coffee cups; Y = exam score. The dots do not tell us what would happen if we changed a student’s coffee intake.

05 · Think in standard errors · 5 min

Same slope. Different confidence.

Cat-play regression
Predict before moving the slider

The estimated slope stays at 0.20 toy pounces per extra minute of cat play. What happens when its standard error grows?

One sample of cats → One fitted slope → Repeat with new samples

SE estimates how much the fitted slope varies across repeated samples.

Interval for the cat-play slope · pounces per minute
[0.122, 0.278]
95% confidence interval
5.00
t for H₀: β = 0

Over repeated samples, a valid 95% interval procedure covers the fixed population slope approximately 95% of the time.

06 · Read the uncertainty · 5 min

“Not significant” does not mean “zero”.

One minute with your neighbour

Cat-treat newspaper-ad estimate: −0.001037.
HC1 standard error: 0.006423.
What can we conclude?

Work from estimate ÷ uncertainty

t = −0.001037 − 00.006423

Translate the interval into cat-treat packs.

Test the business decision

The campaign pays for itself above 8 extra packs per $1,000. The estimated newspaper slope is −1.037 packs, with SE 6.423. Write and test the directional claim at 5%, using 1.6 as the normal cutoff. Can you rule out a profitable campaign?

Worked answer

Use H₀: β ≤ 8 against H₁: β > 8. At the boundary, t = (−1.037 − 8) / 6.423 ≈ −1.41. This is below +1.6, so the data do not establish profitability. To rule out a profitable effect, check the upper one-sided bound. It is −1.037 + 1.6 × 6.423 ≈ 9.24 packs, above 8. Both conclusions remain possible.

07 · Look beyond the summary · 5 min

Four cat shelters. One regression summary.

Anscombe’s quartet · shelter cats
3 + 0.5X
Fitted line · approximately
0.67
R² · approximately
Prediction, then diagnosis

Compare 11 cats in each shelter: play minutes and activity scores. The four regression summaries almost match. Would you trust them equally?

R’s original dataset documentation

Shelter I

Shelter II

Shelter III

Shelter IV

?

What could the cats’ data look like?

The four regression summaries match only approximately.

08 · Interpret indicators · 4 min

New reference cat. Same predictions.

Toy playtime records · three cats
Predict before switching

Make Miso the reference cat. What happens to the intercept? To the other coefficients? To predicted playtime?

Mean daily playtime · minutes

CatCoefficient / meaning

Each daily record belongs to exactly one cat: Mochi, Nori, or Miso.

09 · Diagnose before fixing · 4 min

What are the residuals telling you?

Name the issue and a next step

Our model predicts cats’ activity scores from playtime. What pattern remains in the residuals? Would new standard errors fix it?

Cat-activity residuals. In C, we observe the same cat on successive days. A pattern suggests what to investigate, not a definitive cause.

Cat-activity residuals against playtime
10 · Exit ticket · 3 min

Three claims. Can you explain each?

Write your answers alone for 60 seconds. Compare with a neighbour for 30 seconds, then explain your reasons.

01

Mochi’s activity: Ŷ = 10 + 2X.
X is play minutes. At X = 4, observed Y = 17.
What is the residual?

02

A 95% interval for the cat-play slope is [−0.4, 0.7].
Have we proved “no relationship”?

03

Adding a random “lucky collar number” to the cat-activity model raises training R².
Is the model now better?

A good answer names the comparison, the units, and the uncertainty.
Extension A · Sampling and precision

More cats. Less wobble.

Change one thing at a time

In our cat-activity model, which helps precision: more cats, less noise, or more variation in playtime?

100 fitted slopes · true β₁ = 2
—
Average estimated slope
—
Theoretical slope SD

40 cats → one fitted slope. Repeat 100 times.

X: centered playtime. Y: activity score.
Y = 5 + 2X + u. SD(β̂₁ | X) = σ / √Σ(Xᵢ − X̄)².

Extension B · Interactions

A coefficient is not always the whole gap.

Cat-play model
E[Y | D,Z] = 18 + 0.8Z + 6D + 0.4ZD

Y: cat activity score. Z: playtime in minutes.
D = 1: wand toy; D = 0: ball toy.

Derive it by substitution

Is the wand-versus-ball gap always 6 activity points? Compare cats at the same play duration.

Different intercepts and different slopes
22.0
Ball toy · D = 0
30.0
Wand toy · D = 1
8.0
Activity-point gap at this Z
Extension C · Log transformations

“Eight percent” is an approximation.

E[log Y | S] = β₀ + β₁S

A cat-video channel: Y > 0 is daily views; S is the number of cat videos posted that day.

Compare the exact and approximate changes

When β₁ = 0.08, does one more cat video mean exactly 8% more views?

8.33%
Exact · 100(eᵝ¹ − 1)%
8.00%
Approximate · 100β₁%

The approximation is closer when |β₁| is small.

Example: exp(E[log Y | S=s+1]) / exp(E[log Y | S=s]) = exp(β₁). This concerns an association unless causal assumptions justify more.

Extension D · Linear combinations

You cannot just add standard errors.

Predict the effect of covariance

A cat-activity model has slopes 0.04 for wand-play minutes and 0.01 for ball-play minutes. Their SEs are 0.02 and 0.03. How uncertain is the sum?

SE(β̂₁ + β̂₂)
= √(SE₁² + SE₂² + 2 Cov(β̂₁,β̂₂))

Test H₀: β₁ + β₂ = 0

0.05
Extra activity points · +1 minute of each toy
0.0361
SE of the sum
1.39
Large-sample t statistic

This is one restriction. It is different from requiring both β₁ = 0 and β₂ = 0.

Extension E · Joint tests

A zero sum is not two zeros.

Try a counterexample

For the cat-treat campaign, suppose βR = 0.20 and βN = −0.20. Which null is satisfied?

A. βR + βN = 0

B. βR = 0 and βN = 0

Campaign joint test

Extension F · Assumptions versus identities

Not all “zero errors” say the same thing.

Model a cat’s activity score using playtime. Which zero-error statements are automatic, and which need a linear conditional mean?

THE CEF ERROR
ε = Y − E[Y | X]
E[ε | X] = 0
THE POPULATION PROJECTION
u = Y − X′β
E[Xu] = 0
THE OLS SAMPLE RESIDUAL
ûᵢ = Yᵢ − Xᵢ′β̂
ΣXᵢûᵢ = 0
THE LINEAR CONDITIONAL MEAN
E[u | X] = 0

Here Y is cat activity; X contains playtime and an intercept. In vector notation k counts the intercept.

Core tutorial complete

Keep your three explanations. Name the comparison, the units, and the uncertainty.

Choose an activity

50-minute core route

Optional extensions

Use these if the class is ready, or revisit them after the session. They are not included in the 50 minutes.

Sources & notation

Course materials

Jiaming Huang, Linear Regression I: Prediction, interpretation, and inference, and its companion appendix.

Web additions

  1. R datasets: Anscombe’s quartet. Four datasets demonstrate why nearly identical regression summaries need not imply similar data patterns. Original paper: F. J. Anscombe (1973), Graphs in Statistical Analysis, DOI 10.1080/00031305.1973.10478966.
  2. An Introduction to Statistical Learning, second-edition resources. Advertising dataset and resources. Regression estimates and HC1 inference: course lecture.

Notation and inference

f(X) = E[Y | X]; ε is the CEF error; u is the population projection residual; û is a fitted sample residual. β is a population coefficient; β̂ is its sample estimate. In the scalar illustrations, the intercept is β₀ and slope β₁. The lecture’s general vector notation instead labels the intercept β₁ and counts k total regressors including the intercept.

The cat-treat regressions use HC1 standard errors. An estimate of a projection is not automatically an estimate of the true CEF at every X, and neither a good fit nor a small p-value establishes causality.

Web references checked 12 October 2026.