Is a group comparison a regression? (groups as a 0/1 column, reference group, linear model)
In brief
A group comparison is a regression model with a 0/1 column: b₀ is the mean of the reference group, b₁ the difference of the means. The t value for b₁ equals the t value of the t test for two groups.
An example by hand
Six people, test points. Group 0 (without flash cards): 4, 6, 8. Group 1 (with flash cards): 8, 10, 15. Model: points = b₀ + b₁ · group + error.
- For group = 0 only b₀ is left. The best model predicts their mean for them: b₀ = 6.
- For group = 1 the model predicts b₀ + b₁, the mean of group 1, which is 11. So b₁ = 11 − 6 = 5: the difference of the means.
- The residual of a person is measured minus prediction, for example 15 − 11 = 4. The residuals of both calculations are the same, so t test and regression give the same t (here 2.10).
Why use regression?
- Further variables (for example age) can simply be put into the model.
- Groups with more than two levels need one 0/1 column (dummy) fewer than levels; the level without a column is the reference. All levels together with the constant would give no unique solution.
- Whoever makes another group the reference changes b₀ and the sign of b₁, but not the predictions.
How it works in Statable
- Under "Learning" open the unit: "Work it out yourself", then "Example" with the example "Cars".
- In the example first open the step "How far do automatic and manual cars go?" (group comparison), then the step "A 0/1 variable in the table" (regression): the constant is the mean of the automatic cars, the B of the transmission row the difference.
What is often misunderstood
- The constant is not the mean of everybody but the mean of the reference group (the group with 0).
For specialists
With 0/1 coding and a constant, b₀ = ȳ₀ and b₁ = ȳ₁ − ȳ₀; the t test for b₁ corresponds to the pooled t test (equal variances, n₁ + n₂ − 2 degrees of freedom). With two groups the F of the analysis of variance is the square of this t.
Sources
Backhaus, K., Erichson, B., Gensler, S., Weiber, R. & Weiber, T. Multivariate Analysemethoden, chapter 2 (dummy variables). Bortz, J. & Schuster, C. Statistik für Human- und Sozialwissenschaftler, chapters 8 and 12.
Take away
- A group comparison is a regression model with a 0/1 column.
- b₀ is the mean of the reference group, b₁ the difference of the means.
- The t value for b₁ equals the t value of the pooled t test.
- If the reference group changes, only the sign of b₁ changes.