Stroop Color-Word Test - Psychological Aggression
Model 1
SCWTlog1 <- glm(PsychAggress ~ StroopMixed, data=StroopMixed,family = "binomial")
summary(SCWTlog1)
##
## Call:
## glm(formula = PsychAggress ~ StroopMixed, family = "binomial",
## data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.3248 0.4332 0.5120 0.5923 0.8944
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.55268 0.38541 1.434 0.15157
## StroopMixed 0.03925 0.01221 3.213 0.00131 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 452.04 on 547 degrees of freedom
## Residual deviance: 441.36 on 546 degrees of freedom
## AIC: 445.36
##
## Number of Fisher Scoring iterations: 4
confint(SCWTlog1)
## 2.5 % 97.5 %
## (Intercept) -0.19647466 1.31824277
## StroopMixed 0.01558201 0.06356161
exp(cbind(OR = coef(SCWTlog1), confint(SCWTlog1)))
## OR 2.5 % 97.5 %
## (Intercept) 1.737909 0.8216221 3.736849
## StroopMixed 1.040030 1.0157040 1.065625
plot(predictorEffect("StroopMixed",SCWTlog1))

########Compare to null model
#Difference in Deviance
with(SCWTlog1,null.deviance - deviance)
## [1] 10.68401
#Degrees of freedom for the difference between two models
with(SCWTlog1,df.null - df.residual)
## [1] 1
#p-value
with(SCWTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.001080657
Model 2
SCWTlog2 <- glm(PsychAggress ~ StroopMixed + Age + Sex + PovStat + WRATtotal, data = StroopMixed, family = "binomial")
summary(SCWTlog2)
##
## Call:
## glm(formula = PsychAggress ~ StroopMixed + Age + Sex + PovStat +
## WRATtotal, family = "binomial", data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.3956 0.4030 0.5069 0.5948 0.9438
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.99698 1.12674 0.885 0.3762
## StroopMixed 0.02973 0.01419 2.095 0.0361 *
## Age -0.01789 0.01502 -1.191 0.2338
## SexMen -0.32165 0.24818 -1.296 0.1950
## PovStatBelow 0.28470 0.28846 0.987 0.3237
## WRATtotal 0.01800 0.01818 0.990 0.3222
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 452.04 on 547 degrees of freedom
## Residual deviance: 435.89 on 542 degrees of freedom
## AIC: 447.89
##
## Number of Fisher Scoring iterations: 5
confint(SCWTlog2)
## 2.5 % 97.5 %
## (Intercept) -1.202319724 3.22403985
## StroopMixed 0.002045792 0.05778365
## Age -0.047571215 0.01146232
## SexMen -0.811751656 0.16397948
## PovStatBelow -0.267438077 0.86796109
## WRATtotal -0.018211855 0.05328156
exp(cbind(OR = coef(SCWTlog2), confint(SCWTlog2)))
## OR 2.5 % 97.5 %
## (Intercept) 2.7100891 0.3004963 25.129435
## StroopMixed 1.0301771 1.0020479 1.059486
## Age 0.9822704 0.9535426 1.011528
## SexMen 0.7249506 0.4440795 1.178190
## PovStatBelow 1.3293567 0.7653377 2.382049
## WRATtotal 1.0181610 0.9819530 1.054727
plot(allEffects(SCWTlog2))

########Compare to null model
#Difference in Deviance
with(SCWTlog2,null.deviance - deviance)
## [1] 16.1543
#Degrees of freedom for the difference between two models
with(SCWTlog2,df.null - df.residual)
## [1] 5
#p-value
with(SCWTlog2,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.006417072
Model 3
SCWTlog3 <- glm(PsychAggress ~ (StroopMixed + Sex + PovStat)^3 + Age + WRATtotal, data = StroopMixed, family = "binomial")
summary(SCWTlog3)
##
## Call:
## glm(formula = PsychAggress ~ (StroopMixed + Sex + PovStat)^3 +
## Age + WRATtotal, family = "binomial", data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.3828 0.3929 0.5067 0.6024 0.9833
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.51878 1.25468 0.413 0.6793
## StroopMixed 0.04568 0.02265 2.016 0.0438 *
## SexMen 0.36679 0.92214 0.398 0.6908
## PovStatBelow 0.47415 1.32994 0.357 0.7215
## Age -0.01746 0.01506 -1.159 0.2463
## WRATtotal 0.01894 0.01836 1.032 0.3022
## StroopMixed:SexMen -0.02635 0.02888 -0.912 0.3615
## StroopMixed:PovStatBelow -0.01309 0.04323 -0.303 0.7621
## SexMen:PovStatBelow -0.12800 1.76637 -0.072 0.9422
## StroopMixed:SexMen:PovStatBelow 0.01670 0.05833 0.286 0.7747
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 452.04 on 547 degrees of freedom
## Residual deviance: 434.45 on 538 degrees of freedom
## AIC: 454.45
##
## Number of Fisher Scoring iterations: 5
confint(SCWTlog3)
## 2.5 % 97.5 %
## (Intercept) -1.933308023 2.99882242
## StroopMixed 0.002187172 0.09153845
## SexMen -1.446357087 2.18326044
## PovStatBelow -2.110003807 3.15042319
## Age -0.047217545 0.01196513
## WRATtotal -0.017581384 0.05460431
## StroopMixed:SexMen -0.083643507 0.02999360
## StroopMixed:PovStatBelow -0.096984597 0.07394836
## SexMen:PovStatBelow -3.603769499 3.36101186
## StroopMixed:SexMen:PovStatBelow -0.098817961 0.13091968
exp(cbind(OR = coef(SCWTlog3), confint(SCWTlog3)))
## OR 2.5 % 97.5 %
## (Intercept) 1.6799779 0.14466884 20.061899
## StroopMixed 1.0467372 1.00218957 1.095859
## SexMen 1.4430962 0.23542637 8.875196
## PovStatBelow 1.6066418 0.12123750 23.345942
## Age 0.9826880 0.95387986 1.012037
## WRATtotal 1.0191218 0.98257227 1.056123
## StroopMixed:SexMen 0.9739945 0.91975909 1.030448
## StroopMixed:PovStatBelow 0.9869981 0.90756999 1.076751
## SexMen:PovStatBelow 0.8798572 0.02722092 28.818336
## StroopMixed:SexMen:PovStatBelow 1.0168376 0.90590760 1.139876
plot(predictorEffect("StroopMixed",SCWTlog3))

########Compare to null model
#Difference in Deviance
with(SCWTlog3,null.deviance - deviance)
## [1] 17.58857
#Degrees of freedom for the difference between two models
with(SCWTlog3,df.null - df.residual)
## [1] 9
#p-value
with(SCWTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.04025829
Compare Models 1,2, & 3
anova(SCWTlog1,SCWTlog2,test = "LR")
## Analysis of Deviance Table
##
## Model 1: PsychAggress ~ StroopMixed
## Model 2: PsychAggress ~ StroopMixed + Age + Sex + PovStat + WRATtotal
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 546 441.36
## 2 542 435.89 4 5.4703 0.2424
anova(SCWTlog2,SCWTlog3,test = "LR")
## Analysis of Deviance Table
##
## Model 1: PsychAggress ~ StroopMixed + Age + Sex + PovStat + WRATtotal
## Model 2: PsychAggress ~ (StroopMixed + Sex + PovStat)^3 + Age + WRATtotal
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 542 435.89
## 2 538 434.45 4 1.4343 0.8382
anova(SCWTlog1,SCWTlog3,test = "LR")
## Analysis of Deviance Table
##
## Model 1: PsychAggress ~ StroopMixed
## Model 2: PsychAggress ~ (StroopMixed + Sex + PovStat)^3 + Age + WRATtotal
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 546 441.36
## 2 538 434.45 8 6.9046 0.547
Suggested Model by Predictors
anova(SCWTlog3, test="Chisq")
## Analysis of Deviance Table
##
## Model: binomial, link: logit
##
## Response: PsychAggress
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 547 452.04
## StroopMixed 1 10.6840 546 441.36 0.001081 **
## Sex 1 1.8894 545 439.47 0.169269
## PovStat 1 1.3364 544 438.13 0.247664
## Age 1 1.2788 543 436.85 0.258129
## WRATtotal 1 0.9657 542 435.89 0.325757
## StroopMixed:Sex 1 0.9346 541 434.95 0.333666
## StroopMixed:PovStat 1 0.0253 540 434.93 0.873703
## Sex:PovStat 1 0.3926 539 434.53 0.530935
## StroopMixed:Sex:PovStat 1 0.0818 538 434.45 0.774897
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
SCWTlog4 <- glm(PsychAggress ~ StroopMixed, data = StroopMixed, family = "binomial")
summary(SCWTlog4)
##
## Call:
## glm(formula = PsychAggress ~ StroopMixed, family = "binomial",
## data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.3248 0.4332 0.5120 0.5923 0.8944
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.55268 0.38541 1.434 0.15157
## StroopMixed 0.03925 0.01221 3.213 0.00131 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 452.04 on 547 degrees of freedom
## Residual deviance: 441.36 on 546 degrees of freedom
## AIC: 445.36
##
## Number of Fisher Scoring iterations: 4
plot(allEffects(SCWTlog4))

Stroop Color-Word Test - Physical Assault
Model 1
SCWTlog1 <- glm(PhysAssault ~ StroopMixed, data=StroopMixed,family = "binomial")
summary(SCWTlog1)
##
## Call:
## glm(formula = PhysAssault ~ StroopMixed, family = "binomial",
## data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.5817 -0.5063 -0.4888 -0.4695 2.1974
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.39524 0.45602 -5.252 1.5e-07 ***
## StroopMixed 0.01067 0.01296 0.823 0.41
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 391.02 on 547 degrees of freedom
## Residual deviance: 390.34 on 546 degrees of freedom
## AIC: 394.34
##
## Number of Fisher Scoring iterations: 4
confint(SCWTlog1)
## 2.5 % 97.5 %
## (Intercept) -3.31626204 -1.52583659
## StroopMixed -0.01475071 0.03614618
exp(cbind(OR = coef(SCWTlog1), confint(SCWTlog1)))
## OR 2.5 % 97.5 %
## (Intercept) 0.09115035 0.03628822 0.2174391
## StroopMixed 1.01072943 0.98535755 1.0368074
########Compare to null model
#Difference in Deviance
with(SCWTlog1,null.deviance - deviance)
## [1] 0.678027
#Degrees of freedom for the difference between two models
with(SCWTlog1,df.null - df.residual)
## [1] 1
#p-value
with(SCWTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.4102669
Model 2
SCWTlog2 <- glm(PhysAssault ~ StroopMixed + Age + Sex + PovStat + WRATtotal, data = StroopMixed, family = "binomial")
summary(SCWTlog2)
##
## Call:
## glm(formula = PhysAssault ~ StroopMixed + Age + Sex + PovStat +
## WRATtotal, family = "binomial", data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.8575 -0.5252 -0.4387 -0.3595 2.4818
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.923475 1.308109 -1.470 0.1414
## StroopMixed -0.002239 0.015751 -0.142 0.8870
## Age -0.030718 0.016570 -1.854 0.0638 .
## SexMen -0.340829 0.279464 -1.220 0.2226
## PovStatBelow 0.670720 0.289539 2.317 0.0205 *
## WRATtotal 0.028233 0.022555 1.252 0.2107
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 391.02 on 547 degrees of freedom
## Residual deviance: 376.77 on 542 degrees of freedom
## AIC: 388.77
##
## Number of Fisher Scoring iterations: 5
confint(SCWTlog2)
## 2.5 % 97.5 %
## (Intercept) -4.52828769 0.613429348
## StroopMixed -0.03313450 0.028730582
## Age -0.06373628 0.001399406
## SexMen -0.89963957 0.200617507
## PovStatBelow 0.09865659 1.237696041
## WRATtotal -0.01471822 0.073934791
exp(cbind(OR = coef(SCWTlog2), confint(SCWTlog2)))
## OR 2.5 % 97.5 %
## (Intercept) 0.1460984 0.01079915 1.846754
## StroopMixed 0.9977633 0.96740843 1.029147
## Age 0.9697488 0.93825241 1.001400
## SexMen 0.7111802 0.40671622 1.222157
## PovStatBelow 1.9556456 1.10368721 3.447661
## WRATtotal 1.0286353 0.98538956 1.076737
########Compare to null model
#Difference in Deviance
with(SCWTlog2,null.deviance - deviance)
## [1] 14.24441
#Degrees of freedom for the difference between two models
with(SCWTlog2,df.null - df.residual)
## [1] 5
#p-value
with(SCWTlog2,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.01412921
Model 3
SCWTlog3 <- glm(PhysAssault ~ (StroopMixed + Sex + PovStat)^3 + Age + WRATtotal, data = StroopMixed, family = "binomial")
summary(SCWTlog3)
##
## Call:
## glm(formula = PhysAssault ~ (StroopMixed + Sex + PovStat)^3 +
## Age + WRATtotal, family = "binomial", data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.8174 -0.5564 -0.4236 -0.3232 2.5111
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.78652 1.43745 -1.939 0.0526 .
## StroopMixed 0.02099 0.02257 0.930 0.3524
## SexMen 1.84015 1.24297 1.480 0.1388
## PovStatBelow 1.24604 1.35126 0.922 0.3565
## Age -0.02924 0.01667 -1.754 0.0794 .
## WRATtotal 0.02940 0.02237 1.314 0.1888
## StroopMixed:SexMen -0.07248 0.03617 -2.004 0.0451 *
## StroopMixed:PovStatBelow -0.02215 0.03823 -0.579 0.5623
## SexMen:PovStatBelow -2.03683 1.95253 -1.043 0.2969
## StroopMixed:SexMen:PovStatBelow 0.07915 0.05825 1.359 0.1742
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 391.02 on 547 degrees of freedom
## Residual deviance: 371.47 on 538 degrees of freedom
## AIC: 391.47
##
## Number of Fisher Scoring iterations: 5
confint(SCWTlog3)
## 2.5 % 97.5 %
## (Intercept) -5.66663487 -0.016991478
## StroopMixed -0.02299517 0.065885642
## SexMen -0.63428162 4.271705151
## PovStatBelow -1.46094828 3.874539036
## Age -0.06242361 0.003099514
## WRATtotal -0.01319397 0.074756970
## StroopMixed:SexMen -0.14463657 -0.002266140
## StroopMixed:PovStatBelow -0.09735843 0.053418320
## SexMen:PovStatBelow -5.89405066 1.798465502
## StroopMixed:SexMen:PovStatBelow -0.03451700 0.194549935
exp(cbind(OR = coef(SCWTlog3), confint(SCWTlog3)))
## OR 2.5 % 97.5 %
## (Intercept) 0.06163505 0.003459487 0.9831521
## StroopMixed 1.02121051 0.977267205 1.0681046
## SexMen 6.29748378 0.530316321 71.6436948
## PovStatBelow 3.47654803 0.232016154 48.1604929
## Age 0.97118439 0.939484830 1.0031043
## WRATtotal 1.02983659 0.986892686 1.0776222
## StroopMixed:SexMen 0.93008782 0.865336727 0.9977364
## StroopMixed:PovStatBelow 0.97809470 0.907230769 1.0548708
## SexMen:PovStatBelow 0.13044162 0.002755791 6.0403714
## StroopMixed:SexMen:PovStatBelow 1.08236894 0.966071912 1.2147641
interact_plot(model = SCWTlog3, pred = StroopMixed, modx = Sex)

sim_slopes(SCWTlog3, pred = StroopMixed, modx = Sex, centered = "all",jnplot = TRUE)
## Warning: Johnson-Neyman intervals are not available for factor moderators.
## SIMPLE SLOPES ANALYSIS
##
## Slope of StroopMixed when Sex = Men:
##
## Est. S.E. z val. p
## ------- ------ -------- ------
## -0.03 0.02 -1.42 0.16
##
## Slope of StroopMixed when Sex = Women:
##
## Est. S.E. z val. p
## ------ ------ -------- ------
## 0.01 0.02 0.74 0.46
########Compare to null model
#Difference in Deviance
with(SCWTlog3,null.deviance - deviance)
## [1] 19.55291
#Degrees of freedom for the difference between two models
with(SCWTlog3,df.null - df.residual)
## [1] 9
#p-value
with(SCWTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.02088115
Compare Models 1,2, & 3
anova(SCWTlog1,SCWTlog2,test = "LR")
## Analysis of Deviance Table
##
## Model 1: PhysAssault ~ StroopMixed
## Model 2: PhysAssault ~ StroopMixed + Age + Sex + PovStat + WRATtotal
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 546 390.34
## 2 542 376.77 4 13.566 0.008816 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(SCWTlog2,SCWTlog3,test = "LR")
## Analysis of Deviance Table
##
## Model 1: PhysAssault ~ StroopMixed + Age + Sex + PovStat + WRATtotal
## Model 2: PhysAssault ~ (StroopMixed + Sex + PovStat)^3 + Age + WRATtotal
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 542 376.77
## 2 538 371.47 4 5.3085 0.2571
anova(SCWTlog1,SCWTlog3,test = "LR")
## Analysis of Deviance Table
##
## Model 1: PhysAssault ~ StroopMixed
## Model 2: PhysAssault ~ (StroopMixed + Sex + PovStat)^3 + Age + WRATtotal
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 546 390.34
## 2 538 371.47 8 18.875 0.01554 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Suggested Model by Predictors
anova(SCWTlog3, test="Chisq")
## Analysis of Deviance Table
##
## Model: binomial, link: logit
##
## Response: PhysAssault
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 547 391.02
## StroopMixed 1 0.6780 546 390.34 0.410267
## Sex 1 1.9635 545 388.38 0.161145
## PovStat 1 6.8160 544 381.56 0.009034 **
## Age 1 3.1583 543 378.40 0.075543 .
## WRATtotal 1 1.6286 542 376.77 0.201893
## StroopMixed:Sex 1 2.6238 541 374.15 0.105273
## StroopMixed:PovStat 1 0.0702 540 374.08 0.791079
## Sex:PovStat 1 0.7544 539 373.33 0.385085
## StroopMixed:Sex:PovStat 1 1.8601 538 371.47 0.172609
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
SCWTlog4 <- glm(PhysAssault ~ PovStat + Age, data = StroopMixed, family = "binomial")
summary(SCWTlog4)
##
## Call:
## glm(formula = PhysAssault ~ PovStat + Age, family = "binomial",
## data = StroopMixed)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.7410 -0.5281 -0.4482 -0.3757 2.3858
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.75584 0.72639 -1.041 0.2981
## PovStatBelow 0.59571 0.27780 2.144 0.0320 *
## Age -0.03296 0.01544 -2.134 0.0328 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 391.02 on 547 degrees of freedom
## Residual deviance: 379.98 on 545 degrees of freedom
## AIC: 385.98
##
## Number of Fisher Scoring iterations: 5