80 likes | 381 Views
Soc 3306a Lecture 11: Multivariate 4. ANOVA and Regression Models Using GLM and Linear Regression. One-Way ANOVA (Figure 1). Used when model has a quantitative response variable (DV) and a categorical explanatory variable (IV) Actually special type of multiple regression.
E N D
Soc 3306a Lecture 11:Multivariate 4 ANOVA and Regression Models Using GLM and Linear Regression
One-Way ANOVA (Figure 1) • Used when model has a quantitative response variable (DV) and a categorical explanatory variable (IV) • Actually special type of multiple regression. • Need a post hoc test for more information (to tell you which groups different) • Most common are the Tukey b test (displays group means) or the Bonferroni or the Tukey multiple comparison methods (confidence intervals)
Regression with Dummy Variable (Figure 2) • Can get same result with regression model if create dummy variable • Provides more information • Advantage is that regression calculates slopes to use for prediction as well as standardized coefficients, plots, etc. • With binary categorical variable can create dummy coded 1 and 0 • But if categorical variable has 2+ categories, need to create K-1 dummies
Creating Dummy Variables for Race (1 White, 2 Black, 3 Other) • Use Recode into Different Variable • Code Dummy1 as White = 1, Else = 0 • Code Dummy2 as Black = 1, Else = 0 • Don’t need a dummy variable for last group • Dummy Coding: Race Dummy1 Dummy2 White 1 0 Black 0 1 Other 0 0
Interpretation of Dummy Variable • E(Y) = a + b1(Dummy1) + b2(Dummy2) • For White: Dummy1 = 1, Dummy2 = 0 • For Black: Dummy1 = 0, Dummy2 = 1 • For Other: Dummy1 = 0, Dummy2 = 0 (See Agresti Table 12.5)
Regression Using 2 Dummies (Race and Sex) Figure 3 • Dummysex coded Male=1 and Female=0 • E(Y) = a + b1(Dummy1) + b2(Dummy2)+ b3(Dummysex) • White Male: Dummy1 = 1, Dummy2 = 0, Dummysex = 1 • Black Male: Dummy1 = 0, Dummy2 = 1, Dummysex = 1 • Other Male: Dummy1 = 0, Dummy2 = 0, Dummysex = 1 • White Female: Dummy1 = 1, Dummy2 = 0, Dummysex = 0 • Black Female: Dummy1 = 0, Dummy2 = 1, Dummysex = 0 • Other Female: Dummy1 = 0, Dummy2 = 0, Dummysex = 0
GLM and Two Way ANOVAFigure 4 • Two way ANOVA, using GLM, handles 2 or more categorical predictors at the same time • Recoding as dummies not needed • Compares means of response variable (DV) for all combinations of 2+ categorical IV’s • Can test main effects as well as interaction effects simultaneously
GLM vs Linear Regression Figure 5 • GLM can be used for linear regression using both categorical and quantitative predictors. • Categorical IV’s entered as fixed factors and quantitative IV’s are entered as covariates • GLM • Dummy coding not needed • Interactions between categorical IV’s handled easily • Need to ask for parameter estimates • Linear regression • Gives parameter estimates and standardized coefficients (i.e. to estimate causal models using path analysis)