10.5 Do two groups share the same line?

The intercepts differ and the slopes differ. Is one regression adequate for both groups, or not?

We now have two things that might differ between groups, and a question that asks about both at once:

\[H_0 : \beta_2 = 0 \;\text{ and }\; \beta_3 = 0\]

Under this null, urban and rural workers share the same intercept and the same slope — a single line describes everyone.

Section 8.6 established that a claim about two coefficients at once needs an \(F\) test, not two \(t\) tests. Applied to a group split, this test has a name of its own: the Chow test.

Two ways to see it

The first way is the one the test is usually taught with. Fit the regression three times — once on the pooled sample, once on each group separately — and ask whether splitting the sample improved the fit by more than chance.

pooled <- lm(lw ~ education, data = wages)
rural  <- lm(lw ~ education, data = subset(wages, urban == 0))
urban  <- lm(lw ~ education, data = subset(wages, urban == 1))

ssr <- function(m) sum(residuals(m)^2)

round(c(pooled = ssr(pooled), rural = ssr(rural), urban = ssr(urban),
        separate_total = ssr(rural) + ssr(urban)), 2)
#>         pooled          rural          urban separate_total 
#>          27385          18048           6405          24453

Separate regressions must fit at least as well as a pooled one, for the reason given in Section 8.6: the pooled model is the separate model with the differences restricted to zero. The question is whether the improvement is larger than restricting nothing would produce by chance.

With \(k\) parameters in each group’s regression and \(n_1\), \(n_2\) observations,

\[F = \frac{\big[\text{SSR}_P - (\text{SSR}_1 + \text{SSR}_2)\big] \big/ k} {(\text{SSR}_1 + \text{SSR}_2) \big/ (n_1 + n_2 - 2k)}\]

The numerator is the improvement per restriction; the denominator estimates \(\sigma^2\) from the unrestricted model. The degrees of freedom are \(k\) and \(n_1 + n_2 - 2k\).

n <- nrow(wages); k <- 2

f_chow <- ((ssr(pooled) - (ssr(rural) + ssr(urban))) / k) /
          ((ssr(rural) + ssr(urban)) / (n - 2 * k))

round(c(F = f_chow, critical_5pct = qf(0.95, k, n - 2 * k),
        p_value = 1 - pf(f_chow, k, n - 2 * k)), 4)
#>             F critical_5pct       p_value 
#>      1198.536         2.996         0.000

\(F = 1198.5\) against a critical value of 3.00. The rural and urban wage equations are not the same.

The second way is the interaction model

The other route is to fit the interacted model of Section 10.4 and test its two extra coefficients jointly.

anova(pooled, interacted)
#> Analysis of Variance Table
#> 
#> Model 1: lw ~ education
#> Model 2: lw ~ education * urban
#>   Res.Df   RSS Df Sum of Sq    F              Pr(>F)    
#> 1  19998 27385                                          
#> 2  19996 24453  2      2931 1199 <0.0000000000000002 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The same \(F\) statistic and the same degrees of freedom. R has rounded it to 1199 in the table; the two are the same number.

Running separate regressions and fitting one interacted regression are the same thing.

round(c(separate_ssr  = ssr(rural) + ssr(urban),
        interacted_ssr = ssr(interacted)), 4)
#>   separate_ssr interacted_ssr 
#>          24453          24453

The sums of squared residuals are identical, because the two models fit identical lines to identical data. Section 10.4 already showed the coefficients matching: the interacted model’s base coefficients are the rural regression, and adding the interaction terms gives the urban one.

Given that they are the same test, the interaction approach is usually the more useful one.

Splitting the sample gives a yes-or-no answer about whether the groups differ. The interacted regression gives that and tells you which coefficient differs, by how much, and with what standard error — here, that the intercepts differ enormously and the slopes differ by \(-0.011\).

It also scales. Adding controls to the interacted model changes nothing structural:

\[y = \beta_0 + \beta_1 x + \beta_2 D + \beta_3 (xD) + \beta_4 z + u\]

is still one regression, with one set of standard errors, and \(z\) is held fixed across the whole comparison. The split-sample version would require estimating two separate multiple regressions and then finding some way to compare coefficients across them, with no ready standard error for the difference.

Finally, the split estimates a separate error variance for each group, where the interacted model pools them.

It is worth knowing how far this idea reaches.

A great deal of modern empirical economics is built by interacting dummy variables with other variables. Difference-in-differences interacts a treated-group dummy with a post-reform dummy; event studies interact a treatment dummy with a full set of time dummies; work on heterogeneous treatment effects interacts treatment with the characteristics of the people receiving it.

None of those methods is developed in this book. All of them are assembled from the two ideas in this unit.

What rejecting does and does not mean

The Chow test says the groups differ. It does not say why.

Urban and rural workers differ in education, occupation, industry, and much else. A rejection is consistent with a genuinely different labour market and equally consistent with the two groups differing in variables the model omits — the omitted variable problem of Section 8.7, which does not go away because a group indicator was added.

There is also a failure mode in the other direction. With 20,000 observations, this test detects a slope difference of 0.011 — a difference that may be too small to matter for any decision anyone would make.

A significant Chow test means the groups are detectably different, not importantly different.

That distinction is the one from Section 4.9: with enough data, any difference that is not exactly zero will eventually be rejected. Whether it matters is a question about economics, and the test cannot answer it.