| Do two groups differ in their means? |
Independent t-test |
lm(y ~ group) |
Comparing Means |
| Did scores change from pre to post? |
Paired t-test |
lm(post - pre ~ 1) |
Comparing Means |
| Do three or more groups differ? |
One-way ANOVA |
lm(y ~ factor(group)) |
Comparing Means |
| How strongly are two continuous variables related? |
Correlation |
lm(scale(y) ~ scale(x)) |
Correlation and Regression |
| How do several predictors relate to an outcome? |
Multiple regression |
lm(y ~ x1 + x2) |
Correlation and Regression |
| The outcome is binary, ordinal, or a count |
Logistic, ordinal, Poisson regression |
glm(y ~ x, family = binomial) |
Generalized Linear Model |