1/22
Looks like no tags are added yet.
General Linear Model (GLM) main idea
ANOVA and regression are the same model: group membership is converted into coded predictor variables and analyzed with regression
How many coded variables for a categorical variable with k levels?
k - 1 (the last category is redundant)
Why drop one category when coding?
If you know a person is in none of the first k - 1 categories, they must be in the last one, so a k-th column adds no information
Dummy coding
Each retained category gets 1 if the person is in it, else 0; the dropped (reference) group is 0 on every dummy variable
Reference group in dummy coding
The dropped category, coded 0 on all dummy variables; all other groups are compared to it
Does it matter which group is dropped in dummy coding?
Statistically no; choose the group that makes the most meaningful comparison (e.g., Time 1 when studying change over time)
Dummy coding: the intercept equals…
The mean of the reference group (deck: Time 1 mean = 11.625)
Dummy coding: each coefficient equals…
That group's mean minus the reference group's mean (deck: T3 = 17.625 - 11.625 = 6.000)
Dummy coding: a group's mean from the coefficients
Intercept + that group's coefficient (deck: Time 2 = 11.625 + 1.375 = 13.000)
Dummy coding: what does the t-test on a coefficient test?
Whether that group's mean differs from the reference group's mean
Effect coding
Like dummy coding (k - 1 variables, 1 for the person's group, 0 otherwise), but the dropped group is coded -1 on every variable
Why use effect coding?
When there is no obvious reference group; it matches ANOVA, which compares groups to the grand mean
Effect coding: the intercept equals…
The grand mean (deck: 14.656)
Effect coding: each coefficient equals…
That group's effect: its mean minus the grand mean (deck: Time 1 = 11.625 - 14.656 = -3.031)
Effect coding: how do you get the effect of the group coded -1?
All effects sum to 0, so it is minus the sum of the other effects (deck: -(-3.031 - 1.656 + 2.969) = 1.719)
Which codes sum to 0: dummy or effect?
Effect codes: each code column sums to 0 across the groups (1, 0, 0, -1), and the group effects sum to 0. Dummy codes do not.
Effect coding and ANOVA sum of squares
SS between = n times the sum of the squared effects (deck: 8 x 23.70 = 189.6, matching the ANOVA table)
Are the residual SS the same in GLM and ANOVA?
Yes; the regression residual SS equals the ANOVA residual (within) SS
ANOVA df in the GLM deck example
Between (Time) df = k - 1 = 3; residual df = N - k = 28
When do the effect coefficients all have the same SE?
When the design is balanced (equal n in every group)
Design matrix
The matrix of predictor columns (intercept column of 1s, group codes of 1, 0, -1, and/or continuous variables) used in the GLM; a representation of the score model
Can the GLM mix categorical and continuous predictors?
Yes; effect- or dummy-coded group variables sit alongside continuous predictors (e.g., pay, tenure) in one design matrix