Review of Regression Analysis Review of Regression Analysis PSYC 575 PSYC 575 Mark Lai Mark Lai University of Southern California University of Southern California 2020/08/04 (updated: 2020-08-10) 2020/08/04 (updated: 2020-08-10) 1 / 18 1 / 18
Statistical Model A set of statistical assumptions describing how data are generated Deterministic/fixed component Y i = β 0 + β 1 X 1 i + β 2 X 2 i + … Stochastic/random component Y i = β 0 + β 1 X 1 i + β 2 X 2 i + … + e i e i ∼ N (0, σ ) 2 / 18
Why Regression? MLM is an extension of multiple regression to deal with data from multiple levels 3 / 18
Learning Objectives Refresh your memory on regression Describe the statistical model Write out the model equations Simulate data based on a regression model Plot interactions 4 / 18
R Demonstration R Demonstration 5 / 18 5 / 18
Salary Data From Cohen, Cohen, West & Aiken (2003) Examine factors related to annual salary of faculty in a university department time = years after receiving degree pub = # of publications sex = gender (0 = male, 1 = female) citation = # of citations salary = annual salary 6 / 18
Data Exploration How does the distribution of salary look? Are there more males or females in the data? How would you describe the relationship between number of publications and salary? 7 / 18
Simple Linear Regression Sample regression line Con�dence intervals Centering 8 / 18
Simulation Simulation 9 / 18 9 / 18
Categorical Predictors Dummy Coding With categories, one needs dummy variables k k – 1 The coefficients are differences relative to the reference group 10 / 18
Categorical Predictors Dummy Coding With categories, one needs dummy variables k k – 1 The coefficients are differences relative to the reference group Male = 0 y = β 0 + β 1 (0) = β 0 11 / 18
Categorical Predictors Dummy Coding With categories, one needs dummy variables k k – 1 The coefficients are differences relative to the reference group Male = 0 y = β 0 + β 1 (0) = β 0 Female = 1 y = β 0 + β 1 (1) = β 0 + β 1 12 / 18
Multiple Regression Multiple Regression 13 / 18 13 / 18
Partial E�ects Interpretations Every unit increase in is associated with salary i = β 0 + β 1 pub c i + β 2 time i + e i X unit increase in , when all other β 1 Y predictors are constant 14 / 18
Interactions Regression slope of a predictor depends on another predictor salary = 54238 + 105 × pub c + 964 × time c ˆ + 15(pub c )(time c ) time = 7 time_c = 0.21 ⇒ salary = 54238 + 105 × pub c + 964(0.21) ˆ + 15(pub c )(0.21) = 54440 + 120 × pub c time = 15 time_c = 8.21 ⇒ salary = 54238 + 105 × pub c + 964(8.21) ˆ + 15(pub c )(8.21) = 62152 + 228 × pub c 15 / 18
Interactions Regression slope of a predictor depends on another predictor salary = 54238 + 105 × pub c + 964 × time c ˆ + 15(pub c )(time c ) time = 7 time_c = 0.21 ⇒ salary = 54238 + 105 × pub c + 964(0.21) ˆ + 15(pub c )(0.21) = 54440 + 120 × pub c time = 15 time_c = 8.21 ⇒ salary = 54238 + 105 × pub c + 964(8.21) ˆ + 15(pub c )(8.21) = 62152 + 228 × pub c 16 / 18
modelsummary::msummary() library (modelsummary) msummary(list("M3 + Interaction" = m4), fmt = "%.1f") # keep one digit M3 + Interaction (Intercept) 54238.1 (1183.0) pub_c 104.7 (98.4) pub_c:time_c 15.1 (17.3) time_c 964.2 (339.7) Num.Obs. 62 R2 0.399 17 / 18
Summary Concepts What is a statistical model Linear/Multiple Regression Centering Categorical predictor Interpretations Interactions HW 2 Try replicating the examples in the Rmd �le 18 / 18
Recommend
More recommend