The General Linear Model (GLM) is a statistical model that is used to model the relationship between a single dependent variable and one or more independent variables. Multiple regression and ANOVA are specific applications of the GLM. In fact, the t-test, correlation, regression, ANOVA, and ANCOVA are really one technique seen from different angles. Learn the one, and the rest come with it.
13.1 Learning Objectives
State the General Linear Model in one equation.
See that covariance is what drives it.
Watch a t-test, an ANOVA, and a regression return the same answer.
Understand what “general” does and does not mean.
13.2 One Equation to Rule Them All
Strip away the vocabulary and every model in this section is:
An outcome \(Y\) is modeled as a weighted sum of predictors plus error \(e\). That is it. Whether the \(X\)’s are continuous (regression), categorical (ANOVA), or a mix (ANCOVA) changes only how we code them - never the underlying machine. And, as we saw in the covariance chapter, the weights themselves are built from covariances and variances. Covariance is the fuel; the GLM is the engine.
13.3 The Same Answer, Three Ways
Let’s take one simple question, do two groups differ on an outcome, and answer it with three “different” methods. Watch the p-value:
* Same question, three ways: t-test, ANOVA, regression.
T-TEST GROUPS=group('control' 'treatment') /VARIABLES=y.
ONEWAY y BY group /STATISTICS DESCRIPTIVES.
REGRESSION /STATISTICS COEFF R ANOVA /DEPENDENT y /METHOD=ENTER group.
Three identical p-values. The t-test, the ANOVA, and the regression are literally the same model here - the t-test is a two-group ANOVA, the two-group ANOVA is a regression with one dummy-coded predictor, and (as a bonus) \(F = t^2\):
t_stat <-t.test(y ~ group, var.equal =TRUE)$statisticF_stat <-summary(aov(y ~ group))[[1]][["F value"]][1]round(c(t_squared = t_stat^2, F = F_stat), 4) # F = t^2
t_squared.t F
14.6466 14.6466
Once you see this, a huge amount of statistics stops being a pile of disconnected recipes and becomes a single, learnable idea.
13.4 What “General” Means (and What It Doesn’t)
The GLM is general because it swallows so many named procedures. But it does carry assumptions - chiefly that the errors are roughly normal and that the relationship is linear in the parameters. When the outcome is not continuous-and-normal (a yes/no, a count), we need the generalized linear model, logistic and Poisson regression, which we met briefly at the end of the ANOVA & GLM chapter. Do not confuse the two: the general linear model is the unifying frame for this whole section; the generalized linear model extends it to other kinds of outcomes.
ImportantThe Roadmap From Here
Everything remaining in this book is a special case of the equation above:
Basic ANOVA - partitioning variance, the classical view.
Same model, different predictors. Keep the one equation in your head and you will not get lost.
13.5 Challenge
TipDo One Yourself
Generate your own two-group data. Confirm that t.test(..., var.equal = TRUE), aov(), and lm() give the identical p-value, and that \(F = t^2\).
Add a continuous covariate to the outcome and fit lm(y ~ group + covariate). You have just run an ANCOVA without learning a new technique - explain to a friend why that is not cheating.
In one sentence, state the difference between the general linear model and the generalized linear model.
13.6 Where We Go Next
Let’s build the bridge that makes the “categorical predictors are just regression” claim concrete, using the simplest possible categorical predictor - a single yes/no. That is the point-biserial correlation.