Review of Regression Analysis Review of Regression Analysis PSYC - - PowerPoint PPT Presentation

review of regression analysis review of regression
SMART_READER_LITE
LIVE PREVIEW

Review of Regression Analysis Review of Regression Analysis PSYC - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

A set of statistical assumptions describing how data are generated

Deterministic/fixed component Stochastic/random component

Statistical Model

Yi = β0 + β1X1i + β2X2i + … Yi = β0 + β1X1i + β2X2i + … + ei ei ∼ N(0, σ)

2 / 18

slide-3
SLIDE 3

Why Regression?

MLM is an extension of multiple regression to deal with data from multiple levels

3 / 18

slide-4
SLIDE 4

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

slide-5
SLIDE 5

R Demonstration R Demonstration

5 / 18 5 / 18

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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?

Data Exploration

7 / 18

slide-8
SLIDE 8

Simple Linear Regression

Sample regression line Condence intervals Centering

8 / 18

slide-9
SLIDE 9

Simulation Simulation

9 / 18 9 / 18

slide-10
SLIDE 10

Dummy Coding

With categories, one needs dummy variables The coefficients are differences relative to the reference group

Categorical Predictors

k k– 1

10 / 18

slide-11
SLIDE 11

Dummy Coding

With categories, one needs dummy variables The coefficients are differences relative to the reference group Male = 0

Categorical Predictors

k k– 1 y = β0 + β1(0) = β0

11 / 18

slide-12
SLIDE 12

Dummy Coding

With categories, one needs dummy variables The coefficients are differences relative to the reference group Male = 0 Female = 1

Categorical Predictors

k k– 1 y = β0 + β1(0) = β0 y = β0 + β1(1) = β0 + β1

12 / 18

slide-13
SLIDE 13

Multiple Regression Multiple Regression

13 / 18 13 / 18

slide-14
SLIDE 14

Partial Eects Interpretations

Every unit increase in is associated with unit increase in , when all other predictors are constant

salaryi = β0 + β1pubc

i + β2timei + ei

X β1 Y

14 / 18

slide-15
SLIDE 15

Interactions

Regression slope of a predictor depends on another predictor

time = 7 time_c = 0.21 time = 15 time_c = 8.21

ˆ salary = 54238 + 105 × pubc + 964 × timec + 15(pubc)(timec) ⇒ ˆ salary = 54238 + 105 × pubc + 964(0.21) + 15(pubc)(0.21) = 54440 + 120 × pubc ⇒ ˆ salary = 54238 + 105 × pubc + 964(8.21) + 15(pubc)(8.21) = 62152 + 228 × pubc

15 / 18

slide-16
SLIDE 16

time = 7 time_c = 0.21 time = 15 time_c = 8.21

Interactions

Regression slope of a predictor depends on another predictor

ˆ salary = 54238 + 105 × pubc + 964 × timec + 15(pubc)(timec) ⇒ ˆ salary = 54238 + 105 × pubc + 964(0.21) + 15(pubc)(0.21) = 54440 + 120 × pubc ⇒ ˆ salary = 54238 + 105 × pubc + 964(8.21) + 15(pubc)(8.21) = 62152 + 228 × pubc

16 / 18

slide-17
SLIDE 17

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

slide-18
SLIDE 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