Dissertation Analyses

load(file="/Users/meganwilliams/Desktop/Dissertation/StroopMixed.rdata")
load(file="/Users/meganwilliams/Desktop/Dissertation/Allvars.rdata")
library(effects)
library(interactions)
library(car)
library(rcompanion)

California Verbal Learning Test (Total Correct Trial A) - Psychological Aggression

Model 1

CVLTlog1 <- glm(PsychAggress ~ CVLtca + WRATtotal, data=Allvars,family = "binomial")
summary(CVLTlog1)
## 
## Call:
## glm(formula = PsychAggress ~ CVLtca + WRATtotal, family = "binomial", 
##     data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2246   0.4582   0.5152   0.5595   0.7484  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)  0.79553    0.63686   1.249   0.2116  
## CVLtca       0.02714    0.01515   1.792   0.0732 .
## WRATtotal    0.01285    0.01537   0.836   0.4031  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 505.40  on 640  degrees of freedom
## Residual deviance: 500.04  on 638  degrees of freedom
## AIC: 506.04
## 
## Number of Fisher Scoring iterations: 4
confint(CVLTlog1)
##                    2.5 %     97.5 %
## (Intercept) -0.421676866 2.08358015
## CVLtca      -0.002635186 0.05685499
## WRATtotal   -0.017830910 0.04259585
exp(cbind(OR = coef(CVLTlog1), confint(CVLTlog1)))
##                   OR     2.5 %   97.5 %
## (Intercept) 2.215620 0.6559460 8.033177
## CVLtca      1.027513 0.9973683 1.058502
## WRATtotal   1.012933 0.9823271 1.043516
#Wald chi-square Test
Anova(CVLTlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PsychAggress
##           Df  Chisq Pr(>Chisq)  
## CVLtca     1 3.2102    0.07318 .
## WRATtotal  1 0.6990    0.40313  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Plots
plot(allEffects(CVLTlog1))

########Compare to null model 
#Difference in Deviance
with(CVLTlog1,null.deviance - deviance)
## [1] 5.363783
#Degrees of freedom for the difference between two models
with(CVLTlog1,df.null - df.residual)
## [1] 2
#p-value
with(CVLTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.0684336
#Pseudo R-Squared
nagelkerke(CVLTlog1)
## $Models
##                                                                   
## Model: "glm, PsychAggress ~ CVLtca + WRATtotal, binomial, Allvars"
## Null:  "glm, PsychAggress ~ 1, binomial, Allvars"                 
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                           0.01061290
## Cox and Snell (ML)                 0.00833292
## Nagelkerke (Cragg and Uhler)       0.01527700
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq  p.value
##       -2     -2.6819 5.3638 0.068434
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Model 3

CVLTlog3 <- glm(PsychAggress ~ (CVLtca + Sex + PovStat)^3 + Age + WRATtotal, data = Allvars, family = "binomial")
summary(CVLTlog3)
## 
## Call:
## glm(formula = PsychAggress ~ (CVLtca + Sex + PovStat)^3 + Age + 
##     WRATtotal, family = "binomial", data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.3337   0.4129   0.4814   0.5690   0.9980  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)
## (Intercept)                 1.507921   1.041509   1.448    0.148
## CVLtca                      0.032917   0.027323   1.205    0.228
## SexMen                     -0.490835   0.717735  -0.684    0.494
## PovStatBelow                1.064531   1.054751   1.009    0.313
## Age                        -0.018731   0.013525  -1.385    0.166
## WRATtotal                   0.017976   0.015501   1.160    0.246
## CVLtca:SexMen               0.002083   0.035676   0.058    0.953
## CVLtca:PovStatBelow        -0.047366   0.048002  -0.987    0.324
## SexMen:PovStatBelow         0.365349   1.389997   0.263    0.793
## CVLtca:SexMen:PovStatBelow -0.009220   0.068861  -0.134    0.893
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 505.40  on 640  degrees of freedom
## Residual deviance: 490.18  on 631  degrees of freedom
## AIC: 510.18
## 
## Number of Fisher Scoring iterations: 5
confint(CVLTlog3)
##                                  2.5 %      97.5 %
## (Intercept)                -0.49988121 3.595142572
## CVLtca                     -0.02103625 0.086641647
## SexMen                     -1.93022742 0.897900681
## PovStatBelow               -0.91709632 3.263924014
## Age                        -0.04543934 0.007698432
## WRATtotal                  -0.01291089 0.048037702
## CVLtca:SexMen              -0.06781452 0.072447800
## CVLtca:PovStatBelow        -0.14316689 0.046005026
## SexMen:PovStatBelow        -2.39711923 3.102579238
## CVLtca:SexMen:PovStatBelow -0.14502772 0.125832049
exp(cbind(OR = coef(CVLTlog3), confint(CVLTlog3)))
##                                   OR      2.5 %    97.5 %
## (Intercept)                4.5173308 0.60660271 36.420892
## CVLtca                     1.0334647 0.97918347  1.090506
## SexMen                     0.6121152 0.14511519  2.454445
## PovStatBelow               2.8994777 0.39967789 26.151957
## Age                        0.9814433 0.95557757  1.007728
## WRATtotal                  1.0181383 0.98717210  1.049210
## CVLtca:SexMen              1.0020853 0.93443378  1.075137
## CVLtca:PovStatBelow        0.9537384 0.86660943  1.047080
## SexMen:PovStatBelow        1.4410172 0.09097967 22.255279
## CVLtca:SexMen:PovStatBelow 0.9908219 0.86499831  1.134092
#Wald chi-square Test
Anova(CVLTlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PsychAggress
##                    Df  Chisq Pr(>Chisq)  
## CVLtca              1 1.5459    0.21374  
## Sex                 1 2.7357    0.09813 .
## PovStat             1 1.2112    0.27109  
## Age                 1 1.9180    0.16607  
## WRATtotal           1 1.3448    0.24619  
## CVLtca:Sex          1 0.0002    0.98973  
## CVLtca:PovStat      1 2.2706    0.13185  
## Sex:PovStat         1 0.1247    0.72398  
## CVLtca:Sex:PovStat  1 0.0179    0.89348  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
########Compare to null model 
#Difference in Deviance
with(CVLTlog3,null.deviance - deviance)
## [1] 15.22463
#Degrees of freedom for the difference between two models
with(CVLTlog3,df.null - df.residual)
## [1] 9
#p-value
with(CVLTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.08494771
#Pseudo R-Squared
nagelkerke(CVLTlog3)
## $Models
##                                                                                             
## Model: "glm, PsychAggress ~ (CVLtca + Sex + PovStat)^3 + Age + WRATtotal, binomial, Allvars"
## Null:  "glm, PsychAggress ~ 1, binomial, Allvars"                                           
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0301238
## Cox and Snell (ML)                  0.0234715
## Nagelkerke (Cragg and Uhler)        0.0430311
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq  p.value
##       -9     -7.6123 15.225 0.084948
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Compare Models 1 & 3

anova(CVLTlog1,CVLTlog3,test = "LR")
## Analysis of Deviance Table
## 
## Model 1: PsychAggress ~ CVLtca + WRATtotal
## Model 2: PsychAggress ~ (CVLtca + Sex + PovStat)^3 + Age + WRATtotal
##   Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1       638     500.04                     
## 2       631     490.18  7   9.8608   0.1966

California Verbal Learning Test (Total Correct Trial A) - Physical Assault

Model 1

CVLTlog1 <- glm(PhysAssault ~ CVLtca + WRATtotal, data=Allvars,family = "binomial")
summary(CVLTlog1)
## 
## Call:
## glm(formula = PhysAssault ~ CVLtca + WRATtotal, family = "binomial", 
##     data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.6025  -0.5336  -0.5109  -0.4793   2.1725  
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.593942   0.732865  -3.539 0.000401 ***
## CVLtca       0.012518   0.015859   0.789 0.429923    
## WRATtotal    0.009005   0.017158   0.525 0.599698    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 482.53  on 640  degrees of freedom
## Residual deviance: 481.22  on 638  degrees of freedom
## AIC: 487.22
## 
## Number of Fisher Scoring iterations: 4
confint(CVLTlog1)
##                   2.5 %      97.5 %
## (Intercept) -4.09481803 -1.21492624
## CVLtca      -0.01830031  0.04395313
## WRATtotal   -0.02387068  0.04354938
exp(cbind(OR = coef(CVLTlog1), confint(CVLTlog1)))
##                     OR      2.5 %    97.5 %
## (Intercept) 0.07472492 0.01665878 0.2967319
## CVLtca      1.01259635 0.98186612 1.0449334
## WRATtotal   1.00904603 0.97641197 1.0445116
#Wald chi-square Test
Anova(CVLTlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PhysAssault
##           Df  Chisq Pr(>Chisq)
## CVLtca     1 0.6230     0.4299
## WRATtotal  1 0.2755     0.5997
#Plots
plot(allEffects(CVLTlog1))

########Compare to null model 
#Difference in Deviance
with(CVLTlog1,null.deviance - deviance)
## [1] 1.3093
#Degrees of freedom for the difference between two models
with(CVLTlog1,df.null - df.residual)
## [1] 2
#p-value
with(CVLTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.5196239
#Pseudo R-Squared
nagelkerke(CVLTlog1)
## $Models
##                                                                  
## Model: "glm, PhysAssault ~ CVLtca + WRATtotal, binomial, Allvars"
## Null:  "glm, PhysAssault ~ 1, binomial, Allvars"                 
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                           0.00271339
## Cox and Snell (ML)                 0.00204050
## Nagelkerke (Cragg and Uhler)       0.00385769
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq p.value
##       -2    -0.65465 1.3093 0.51962
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Model 3

CVLTlog3 <- glm(PhysAssault ~ (CVLtca + Sex + PovStat)^3 + Age + WRATtotal, data = Allvars, family = "binomial")
summary(CVLTlog3)
## 
## Call:
## glm(formula = PhysAssault ~ (CVLtca + Sex + PovStat)^3 + Age + 
##     WRATtotal, family = "binomial", data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8807  -0.5521  -0.4699  -0.3868   2.3692  
## 
## Coefficients:
##                            Estimate Std. Error z value Pr(>|z|)  
## (Intercept)                -1.56944    1.17685  -1.334   0.1823  
## CVLtca                      0.01507    0.02827   0.533   0.5939  
## SexMen                      0.31859    0.90423   0.352   0.7246  
## PovStatBelow                1.19628    0.93802   1.275   0.2022  
## Age                        -0.03285    0.01415  -2.321   0.0203 *
## WRATtotal                   0.01566    0.01802   0.869   0.3847  
## CVLtca:SexMen              -0.02338    0.04019  -0.582   0.5608  
## CVLtca:PovStatBelow        -0.03456    0.04091  -0.845   0.3982  
## SexMen:PovStatBelow        -1.59191    1.38680  -1.148   0.2510  
## CVLtca:SexMen:PovStatBelow  0.08675    0.06569   1.321   0.1867  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 482.53  on 640  degrees of freedom
## Residual deviance: 467.48  on 631  degrees of freedom
## AIC: 487.48
## 
## Number of Fisher Scoring iterations: 5
confint(CVLTlog3)
##                                  2.5 %       97.5 %
## (Intercept)                -3.94186703  0.682851594
## CVLtca                     -0.03911156  0.072130045
## SexMen                     -1.45623021  2.114702092
## PovStatBelow               -0.64898891  3.058400756
## Age                        -0.06103090 -0.005420145
## WRATtotal                  -0.01877807  0.052007524
## CVLtca:SexMen              -0.10277124  0.055227806
## CVLtca:PovStatBelow        -0.11546733  0.045572506
## SexMen:PovStatBelow        -4.37034666  1.095833308
## CVLtca:SexMen:PovStatBelow -0.04073430  0.217556779
exp(cbind(OR = coef(CVLTlog3), confint(CVLTlog3)))
##                                   OR      2.5 %     97.5 %
## (Intercept)                0.2081609 0.01941194  1.9795145
## CVLtca                     1.0151877 0.96164343  1.0747951
## SexMen                     1.3751903 0.23311341  8.2871166
## PovStatBelow               3.3077874 0.52257388 21.2934765
## Age                        0.9676869 0.94079417  0.9945945
## WRATtotal                  1.0157839 0.98139714  1.0533837
## CVLtca:SexMen              0.9768927 0.90233337  1.0567813
## CVLtca:PovStatBelow        0.9660316 0.89094968  1.0466269
## SexMen:PovStatBelow        0.2035359 0.01264686  2.9916746
## CVLtca:SexMen:PovStatBelow 1.0906242 0.96008419  1.2430360
#Wald chi-square Test
Anova(CVLTlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PhysAssault
##                    Df  Chisq Pr(>Chisq)  
## CVLtca              1 0.0398    0.84197  
## Sex                 1 0.3009    0.58329  
## PovStat             1 3.9476    0.04694 *
## Age                 1 5.3860    0.02030 *
## WRATtotal           1 0.7556    0.38471  
## CVLtca:Sex          1 0.0824    0.77412  
## CVLtca:PovStat      1 0.0010    0.97491  
## Sex:PovStat         1 0.0462    0.82981  
## CVLtca:Sex:PovStat  1 1.7437    0.18666  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
########Compare to null model 
#Difference in Deviance
with(CVLTlog3,null.deviance - deviance)
## [1] 15.04792
#Degrees of freedom for the difference between two models
with(CVLTlog3,df.null - df.residual)
## [1] 9
#p-value
with(CVLTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.08962819
#Pseudo R-Squared
nagelkerke(CVLTlog1)
## $Models
##                                                                  
## Model: "glm, PhysAssault ~ CVLtca + WRATtotal, binomial, Allvars"
## Null:  "glm, PhysAssault ~ 1, binomial, Allvars"                 
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                           0.00271339
## Cox and Snell (ML)                 0.00204050
## Nagelkerke (Cragg and Uhler)       0.00385769
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq p.value
##       -2    -0.65465 1.3093 0.51962
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Compare Models 1 & 3

anova(CVLTlog1,CVLTlog3,test = "LR")
## Analysis of Deviance Table
## 
## Model 1: PhysAssault ~ CVLtca + WRATtotal
## Model 2: PhysAssault ~ (CVLtca + Sex + PovStat)^3 + Age + WRATtotal
##   Resid. Df Resid. Dev Df Deviance Pr(>Chi)  
## 1       638     481.22                       
## 2       631     467.48  7   13.739  0.05603 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

California Verbal Learning Test (Long Delayed Free Recall) - Psychological Aggression

Model 1

CVLTlog1 <- glm(PsychAggress ~ CVLfrl + WRATtotal, data=Allvars,family = "binomial")
summary(CVLTlog1)
## 
## Call:
## glm(formula = PsychAggress ~ CVLfrl + WRATtotal, family = "binomial", 
##     data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.4487   0.4048   0.4990   0.5795   0.7633  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept) 0.872285   0.636356   1.371  0.17045   
## CVLfrl      0.114613   0.037672   3.042  0.00235 **
## WRATtotal   0.009216   0.015087   0.611  0.54131   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 505.40  on 640  degrees of freedom
## Residual deviance: 493.64  on 638  degrees of freedom
## AIC: 499.64
## 
## Number of Fisher Scoring iterations: 5
confint(CVLTlog1)
##                   2.5 %     97.5 %
## (Intercept) -0.34280180 2.16049574
## CVLfrl       0.04168684 0.18965208
## WRATtotal   -0.02093494 0.03838319
exp(cbind(OR = coef(CVLTlog1), confint(CVLTlog1)))
##                   OR     2.5 %   97.5 %
## (Intercept) 2.392371 0.7097789 8.675437
## CVLfrl      1.121439 1.0425679 1.208829
## WRATtotal   1.009258 0.9792827 1.039129
#Wald chi-square Test
Anova(CVLTlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PsychAggress
##           Df  Chisq Pr(>Chisq)   
## CVLfrl     1 9.2560   0.002347 **
## WRATtotal  1 0.3731   0.541310   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Plots
plot(allEffects(CVLTlog1))

########Compare to null model 
#Difference in Deviance
with(CVLTlog1,null.deviance - deviance)
## [1] 11.76059
#Degrees of freedom for the difference between two models
with(CVLTlog1,df.null - df.residual)
## [1] 2
#p-value
with(CVLTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.002793964
#Pseudo R-Squared
nagelkerke(CVLTlog1)
## $Models
##                                                                   
## Model: "glm, PsychAggress ~ CVLfrl + WRATtotal, binomial, Allvars"
## Null:  "glm, PsychAggress ~ 1, binomial, Allvars"                 
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0232698
## Cox and Snell (ML)                  0.0181800
## Nagelkerke (Cragg and Uhler)        0.0333299
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq  p.value
##       -2     -5.8803 11.761 0.002794
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Model 3

CVLTlog3 <- glm(PsychAggress ~ (CVLfrl + Sex + PovStat)^3 + Age + WRATtotal, data = Allvars, family = "binomial")
summary(CVLTlog3)
## 
## Call:
## glm(formula = PsychAggress ~ (CVLfrl + Sex + PovStat)^3 + Age + 
##     WRATtotal, family = "binomial", data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.4092   0.3891   0.4796   0.5819   0.9066  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)
## (Intercept)                 1.594364   0.995644   1.601    0.109
## CVLfrl                      0.081954   0.064865   1.263    0.206
## SexMen                     -0.539601   0.519371  -1.039    0.299
## PovStatBelow                0.034576   0.728639   0.047    0.962
## Age                        -0.013555   0.013553  -1.000    0.317
## WRATtotal                   0.014485   0.015217   0.952    0.341
## CVLfrl:SexMen               0.020872   0.087237   0.239    0.811
## CVLfrl:PovStatBelow         0.019247   0.118391   0.163    0.871
## SexMen:PovStatBelow         0.403466   0.951778   0.424    0.672
## CVLfrl:SexMen:PovStatBelow  0.007243   0.175255   0.041    0.967
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 505.4  on 640  degrees of freedom
## Residual deviance: 487.7  on 631  degrees of freedom
## AIC: 507.7
## 
## Number of Fisher Scoring iterations: 5
confint(CVLTlog3)
##                                  2.5 %     97.5 %
## (Intercept)                -0.33012860 3.58191681
## CVLfrl                     -0.04333937 0.21245834
## SexMen                     -1.58108983 0.46411696
## PovStatBelow               -1.35788726 1.53077967
## Age                        -0.04029900 0.01294495
## WRATtotal                  -0.01586669 0.04396449
## CVLfrl:SexMen              -0.15057415 0.19264865
## CVLfrl:PovStatBelow        -0.21063952 0.25722477
## SexMen:PovStatBelow        -1.48466750 2.27285707
## CVLfrl:SexMen:PovStatBelow -0.33464295 0.35634530
exp(cbind(OR = coef(CVLTlog3), confint(CVLTlog3)))
##                                   OR     2.5 %    97.5 %
## (Intercept)                4.9251943 0.7188313 35.942369
## CVLfrl                     1.0854060 0.9575864  1.236715
## SexMen                     0.5829807 0.2057507  1.590609
## PovStatBelow               1.0351811 0.2572036  4.621779
## Age                        0.9865361 0.9605022  1.013029
## WRATtotal                  1.0145904 0.9842585  1.044945
## CVLfrl:SexMen              1.0210918 0.8602139  1.212457
## CVLfrl:PovStatBelow        1.0194336 0.8100660  1.293336
## SexMen:PovStatBelow        1.4970042 0.2265777  9.707095
## CVLfrl:SexMen:PovStatBelow 1.0072689 0.7155935  1.428101
#Wald chi-square Test
Anova(CVLTlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PsychAggress
##                    Df  Chisq Pr(>Chisq)  
## CVLfrl              1 6.0502     0.0139 *
## Sex                 1 1.7947     0.1804  
## PovStat             1 1.5312     0.2159  
## Age                 1 1.0004     0.3172  
## WRATtotal           1 0.9061     0.3411  
## CVLfrl:Sex          1 0.0897     0.7645  
## CVLfrl:PovStat      1 0.0666     0.7964  
## Sex:PovStat         1 0.6148     0.4330  
## CVLfrl:Sex:PovStat  1 0.0017     0.9670  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
########Compare to null model 
#Difference in Deviance
with(CVLTlog3,null.deviance - deviance)
## [1] 17.70202
#Degrees of freedom for the difference between two models
with(CVLTlog3,df.null - df.residual)
## [1] 9
#p-value
with(CVLTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.03879225
#Pseudo R-Squared
nagelkerke(CVLTlog3)
## $Models
##                                                                                             
## Model: "glm, PsychAggress ~ (CVLfrl + Sex + PovStat)^3 + Age + WRATtotal, binomial, Allvars"
## Null:  "glm, PsychAggress ~ 1, binomial, Allvars"                                           
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0350257
## Cox and Snell (ML)                  0.0272384
## Nagelkerke (Cragg and Uhler)        0.0499371
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq  p.value
##       -9      -8.851 17.702 0.038792
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Compare Models 1 & 3

anova(CVLTlog1,CVLTlog3,test = "LR")
## Analysis of Deviance Table
## 
## Model 1: PsychAggress ~ CVLfrl + WRATtotal
## Model 2: PsychAggress ~ (CVLfrl + Sex + PovStat)^3 + Age + WRATtotal
##   Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1       638     493.64                     
## 2       631     487.70  7   5.9414   0.5466

California Verbal Learning Test (Long Delayed Free Recall) - Physical Assault

Model 1

CVLTlog1 <- glm(PhysAssault ~ CVLfrl + WRATtotal, data=Allvars,family = "binomial")
summary(CVLTlog1)
## 
## Call:
## glm(formula = PhysAssault ~ CVLfrl + WRATtotal, family = "binomial", 
##     data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.6087  -0.5337  -0.5068  -0.4807   2.1707  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.53235    0.72754  -3.481   0.0005 ***
## CVLfrl       0.03102    0.03648   0.850   0.3952    
## WRATtotal    0.00920    0.01700   0.541   0.5883    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 482.53  on 640  degrees of freedom
## Residual deviance: 481.13  on 638  degrees of freedom
## AIC: 487.13
## 
## Number of Fisher Scoring iterations: 4
confint(CVLTlog1)
##                   2.5 %      97.5 %
## (Intercept) -4.02329131 -1.16424365
## CVLfrl      -0.04046725  0.10283424
## WRATtotal   -0.02336295  0.04342529
exp(cbind(OR = coef(CVLTlog1), confint(CVLTlog1)))
##                     OR      2.5 %    97.5 %
## (Intercept) 0.07947179 0.01789397 0.3121587
## CVLfrl      1.03150469 0.96034061 1.1083077
## WRATtotal   1.00924276 0.97690785 1.0443820
#Wald chi-square Test
Anova(CVLTlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PhysAssault
##           Df Chisq Pr(>Chisq)
## CVLfrl     1 0.723     0.3952
## WRATtotal  1 0.293     0.5883
########Compare to null model 
#Difference in Deviance
with(CVLTlog1,null.deviance - deviance)
## [1] 1.405392
#Degrees of freedom for the difference between two models
with(CVLTlog1,df.null - df.residual)
## [1] 2
#p-value
with(CVLTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.4952483
#Pseudo R-Squared
nagelkerke(CVLTlog1)
## $Models
##                                                                  
## Model: "glm, PhysAssault ~ CVLfrl + WRATtotal, binomial, Allvars"
## Null:  "glm, PhysAssault ~ 1, binomial, Allvars"                 
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                           0.00291253
## Cox and Snell (ML)                 0.00219010
## Nagelkerke (Cragg and Uhler)       0.00414050
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq p.value
##       -2     -0.7027 1.4054 0.49525
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Model 3

CVLTlog3 <- glm(PhysAssault ~ (CVLfrl + Sex + PovStat)^3 + Age + WRATtotal, data = Allvars, family = "binomial")
summary(CVLTlog3)
## 
## Call:
## glm(formula = PhysAssault ~ (CVLfrl + Sex + PovStat)^3 + Age + 
##     WRATtotal, family = "binomial", data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.9608  -0.5456  -0.4611  -0.3756   2.3880  
## 
## Coefficients:
##                            Estimate Std. Error z value Pr(>|z|)  
## (Intercept)                -1.54116    1.11091  -1.387   0.1654  
## CVLfrl                      0.05847    0.06311   0.926   0.3542  
## SexMen                      0.16453    0.66352   0.248   0.8042  
## PovStatBelow                1.74987    0.69446   2.520   0.0117 *
## Age                        -0.03334    0.01429  -2.333   0.0196 *
## WRATtotal                   0.01402    0.01794   0.782   0.4345  
## CVLfrl:SexMen              -0.04768    0.09093  -0.524   0.6000  
## CVLfrl:PovStatBelow        -0.21185    0.10025  -2.113   0.0346 *
## SexMen:PovStatBelow        -1.68383    1.02211  -1.647   0.0995 .
## CVLfrl:SexMen:PovStatBelow  0.30140    0.15435   1.953   0.0509 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 482.53  on 640  degrees of freedom
## Residual deviance: 463.48  on 631  degrees of freedom
## AIC: 483.48
## 
## Number of Fisher Scoring iterations: 5
confint(CVLTlog3)
##                                   2.5 %       97.5 %
## (Intercept)                -3.768138754  0.596098027
## CVLfrl                     -0.063914094  0.184956139
## SexMen                     -1.134460897  1.487606633
## PovStatBelow                0.394379812  3.136825838
## Age                        -0.061778689 -0.005627172
## WRATtotal                  -0.020308030  0.050188403
## CVLfrl:SexMen              -0.228410112  0.129351707
## CVLfrl:PovStatBelow        -0.412916523 -0.018096870
## SexMen:PovStatBelow        -3.734693589  0.293286423
## CVLfrl:SexMen:PovStatBelow  0.001638781  0.608694441
exp(cbind(OR = coef(CVLTlog3), confint(CVLTlog3)))
##                                   OR      2.5 %     97.5 %
## (Intercept)                0.2141328 0.02309501  1.8150228
## CVLfrl                     1.0602112 0.93808558  1.2031657
## SexMen                     1.1788423 0.32159545  4.4264886
## PovStatBelow               5.7538469 1.48346388 23.0306477
## Age                        0.9672068 0.94009092  0.9943886
## WRATtotal                  1.0141210 0.97989679  1.0514692
## CVLfrl:SexMen              0.9534429 0.79579783  1.1380903
## CVLfrl:PovStatBelow        0.8090857 0.66171752  0.9820659
## SexMen:PovStatBelow        0.1856610 0.02388049  1.3408268
## CVLfrl:SexMen:PovStatBelow 1.3517439 1.00164012  1.8380302
#Wald chi-square Test
Anova(CVLTlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PhysAssault
##                    Df  Chisq Pr(>Chisq)  
## CVLfrl              1 0.0146    0.90370  
## Sex                 1 0.3583    0.54947  
## PovStat             1 4.0028    0.04542 *
## Age                 1 5.4437    0.01964 *
## WRATtotal           1 0.6109    0.43447  
## CVLfrl:Sex          1 0.6043    0.43693  
## CVLfrl:PovStat      1 1.2288    0.26764  
## Sex:PovStat         1 0.0075    0.93115  
## CVLfrl:Sex:PovStat  1 3.8128    0.05086 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Plots
interact_plot(model = CVLTlog3, pred = CVLfrl, modx = PovStat)

sim_slopes(CVLTlog3, pred = CVLfrl, modx = PovStat, centered = "all",jnplot = TRUE)
## Warning: Johnson-Neyman intervals are not available for factor moderators.
## SIMPLE SLOPES ANALYSIS 
## 
## Slope of CVLfrl when PovStat = Below: 
## 
##    Est.   S.E.   z val.      p
## ------- ------ -------- ------
##   -0.03   0.06    -0.48   0.63
## 
## Slope of CVLfrl when PovStat = Above: 
## 
##   Est.   S.E.   z val.      p
## ------ ------ -------- ------
##   0.04   0.05     0.74   0.46
########Compare to null model 
#Difference in Deviance
with(CVLTlog3,null.deviance - deviance)
## [1] 19.05303
#Degrees of freedom for the difference between two models
with(CVLTlog3,df.null - df.residual)
## [1] 9
#p-value
with(CVLTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.02474572
#Pseudo R-Squared
nagelkerke(CVLTlog3)
## $Models
##                                                                                            
## Model: "glm, PhysAssault ~ (CVLfrl + Sex + PovStat)^3 + Age + WRATtotal, binomial, Allvars"
## Null:  "glm, PhysAssault ~ 1, binomial, Allvars"                                           
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0394855
## Cox and Snell (ML)                  0.0292865
## Nagelkerke (Cragg and Uhler)        0.0553677
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq  p.value
##       -9     -9.5265 19.053 0.024746
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Compare Models 1 & 3

anova(CVLTlog1,CVLTlog3,test = "LR")
## Analysis of Deviance Table
## 
## Model 1: PhysAssault ~ CVLfrl + WRATtotal
## Model 2: PhysAssault ~ (CVLfrl + Sex + PovStat)^3 + Age + WRATtotal
##   Resid. Df Resid. Dev Df Deviance Pr(>Chi)  
## 1       638     481.13                       
## 2       631     463.48  7   17.648  0.01367 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

California Verbal Learning Test (Short Delayed Free Recall) - Psychological Aggression

Model 1

CVLTlog1 <- glm(PsychAggress ~ CVLfrs + WRATtotal, data=Allvars,family = "binomial")
summary(CVLTlog1)
## 
## Call:
## glm(formula = PsychAggress ~ CVLfrs + WRATtotal, family = "binomial", 
##     data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.3416   0.4408   0.5101   0.5760   0.7676  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)  0.90534    0.63284   1.431   0.1525  
## CVLfrs       0.08323    0.03743   2.223   0.0262 *
## WRATtotal    0.01185    0.01515   0.782   0.4343  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 505.40  on 640  degrees of freedom
## Residual deviance: 498.21  on 638  degrees of freedom
## AIC: 504.21
## 
## Number of Fisher Scoring iterations: 4
confint(CVLTlog1)
##                   2.5 %     97.5 %
## (Intercept) -0.30325412 2.18649124
## CVLfrs       0.01039890 0.15743330
## WRATtotal   -0.01839075 0.04119211
exp(cbind(OR = coef(CVLTlog1), confint(CVLTlog1)))
##                   OR     2.5 %   97.5 %
## (Intercept) 2.472761 0.7384114 8.903916
## CVLfrs      1.086792 1.0104532 1.170503
## WRATtotal   1.011919 0.9817773 1.042052
#Wald chi-square Test
Anova(CVLTlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PsychAggress
##           Df  Chisq Pr(>Chisq)  
## CVLfrs     1 4.9439    0.02618 *
## WRATtotal  1 0.6113    0.43432  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Plots
plot(allEffects(CVLTlog1))

########Compare to null model 
#Difference in Deviance
with(CVLTlog1,null.deviance - deviance)
## [1] 7.193642
#Degrees of freedom for the difference between two models
with(CVLTlog1,df.null - df.residual)
## [1] 2
#p-value
with(CVLTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.02741072
#Pseudo R-Squared
nagelkerke(CVLTlog1)
## $Models
##                                                                   
## Model: "glm, PsychAggress ~ CVLfrs + WRATtotal, binomial, Allvars"
## Null:  "glm, PsychAggress ~ 1, binomial, Allvars"                 
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0142335
## Cox and Snell (ML)                  0.0111598
## Nagelkerke (Cragg and Uhler)        0.0204596
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq  p.value
##       -2     -3.5968 7.1936 0.027411
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Model 3

CVLTlog3 <- glm(PsychAggress ~ (CVLfrs + Sex + PovStat)^3 + Age + WRATtotal, data = Allvars, family = "binomial")
summary(CVLTlog3)
## 
## Call:
## glm(formula = PsychAggress ~ (CVLfrs + Sex + PovStat)^3 + Age + 
##     WRATtotal, family = "binomial", data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.4191   0.4137   0.4819   0.5750   0.8827  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)                 1.746423   0.985751   1.772   0.0764 .
## CVLfrs                      0.061861   0.064502   0.959   0.3375  
## SexMen                     -0.521850   0.526470  -0.991   0.3216  
## PovStatBelow                0.451159   0.777362   0.580   0.5617  
## Age                        -0.016645   0.013563  -1.227   0.2197  
## WRATtotal                   0.017110   0.015252   1.122   0.2619  
## CVLfrs:SexMen               0.009237   0.085199   0.108   0.9137  
## CVLfrs:PovStatBelow        -0.058364   0.117321  -0.497   0.6189  
## SexMen:PovStatBelow        -0.178900   1.012604  -0.177   0.8598  
## CVLfrs:SexMen:PovStatBelow  0.114186   0.174686   0.654   0.5133  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 505.40  on 640  degrees of freedom
## Residual deviance: 490.65  on 631  degrees of freedom
## AIC: 510.65
## 
## Number of Fisher Scoring iterations: 5
confint(CVLTlog3)
##                                  2.5 %      97.5 %
## (Intercept)                -0.15644107 3.717405147
## CVLfrs                     -0.06328045 0.191168570
## SexMen                     -1.57745880 0.496345881
## PovStatBelow               -1.01346251 2.072883547
## Age                        -0.04341788 0.009867831
## WRATtotal                  -0.01327224 0.046698314
## CVLfrs:SexMen              -0.15853628 0.176616872
## CVLfrs:PovStatBelow        -0.29008092 0.173430402
## SexMen:PovStatBelow        -2.20399826 1.799787040
## CVLfrs:SexMen:PovStatBelow -0.22596721 0.462209001
exp(cbind(OR = coef(CVLTlog3), confint(CVLTlog3)))
##                                   OR     2.5 %    97.5 %
## (Intercept)                5.7340536 0.8551819 41.157458
## CVLfrs                     1.0638144 0.9386802  1.210664
## SexMen                     0.5934216 0.2064992  1.642708
## PovStatBelow               1.5701307 0.3629600  7.947708
## Age                        0.9834927 0.9575112  1.009917
## WRATtotal                  1.0172574 0.9868154  1.047806
## CVLfrs:SexMen              1.0092796 0.8533920  1.193174
## CVLfrs:PovStatBelow        0.9433069 0.7482030  1.189378
## SexMen:PovStatBelow        0.8361892 0.1103610  6.048359
## CVLfrs:SexMen:PovStatBelow 1.1209605 0.7977443  1.587577
#Wald chi-square Test
Anova(CVLTlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PsychAggress
##                    Df  Chisq Pr(>Chisq)
## CVLfrs              1 2.6509     0.1035
## Sex                 1 2.5011     0.1138
## PovStat             1 1.2946     0.2552
## Age                 1 1.5061     0.2197
## WRATtotal           1 1.2585     0.2619
## CVLfrs:Sex          1 0.2400     0.6242
## CVLfrs:PovStat      1 0.0061     0.9375
## Sex:PovStat         1 0.4491     0.5028
## CVLfrs:Sex:PovStat  1 0.4273     0.5133
########Compare to null model 
#Difference in Deviance
with(CVLTlog3,null.deviance - deviance)
## [1] 14.75029
#Degrees of freedom for the difference between two models
with(CVLTlog3,df.null - df.residual)
## [1] 9
#p-value
with(CVLTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.09802732
#Pseudo R-Squared
nagelkerke(CVLTlog3)
## $Models
##                                                                                             
## Model: "glm, PsychAggress ~ (CVLfrs + Sex + PovStat)^3 + Age + WRATtotal, binomial, Allvars"
## Null:  "glm, PsychAggress ~ 1, binomial, Allvars"                                           
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0291853
## Cox and Snell (ML)                  0.0227486
## Nagelkerke (Cragg and Uhler)        0.0417058
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff Chisq  p.value
##       -9     -7.3751 14.75 0.098027
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Compare Models 1 & 3

anova(CVLTlog1,CVLTlog3,test = "LR")
## Analysis of Deviance Table
## 
## Model 1: PsychAggress ~ CVLfrs + WRATtotal
## Model 2: PsychAggress ~ (CVLfrs + Sex + PovStat)^3 + Age + WRATtotal
##   Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1       638     498.21                     
## 2       631     490.65  7   7.5567   0.3733

California Verbal Learning Test (Short Delayed Free Recall) - Physical Assault

Model 1

CVLTlog1 <- glm(PhysAssault ~ CVLfrs + WRATtotal, data=Allvars,family = "binomial")
summary(CVLTlog1)
## 
## Call:
## glm(formula = PhysAssault ~ CVLfrs + WRATtotal, family = "binomial", 
##     data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5732  -0.5300  -0.5146  -0.4875   2.1798  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.53166    0.72810  -3.477 0.000507 ***
## CVLfrs       0.01456    0.03723   0.391 0.695685    
## WRATtotal    0.01138    0.01700   0.669 0.503398    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 482.53  on 640  degrees of freedom
## Residual deviance: 481.70  on 638  degrees of freedom
## AIC: 487.7
## 
## Number of Fisher Scoring iterations: 4
confint(CVLTlog1)
##                   2.5 %      97.5 %
## (Intercept) -4.02371675 -1.16251937
## CVLfrs      -0.05841422  0.08781414
## WRATtotal   -0.02119180  0.04562049
exp(cbind(OR = coef(CVLTlog1), confint(CVLTlog1)))
##                     OR      2.5 %    97.5 %
## (Intercept) 0.07952681 0.01788636 0.3126974
## CVLfrs      1.01466740 0.94325915 1.0917852
## WRATtotal   1.01144314 0.97903117 1.0466771
#Wald chi-square Test
Anova(CVLTlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PhysAssault
##           Df  Chisq Pr(>Chisq)
## CVLfrs     1 0.1530     0.6957
## WRATtotal  1 0.4478     0.5034
#Plots
plot(predictorEffect("CVLfrs",CVLTlog1))

########Compare to null model 
#Difference in Deviance
with(CVLTlog1,null.deviance - deviance)
## [1] 0.8346165
#Degrees of freedom for the difference between two models
with(CVLTlog1,df.null - df.residual)
## [1] 2
#p-value
with(CVLTlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.6588178
#Pseudo R-Squared
nagelkerke(CVLTlog1)
## $Models
##                                                                  
## Model: "glm, PhysAssault ~ CVLfrs + WRATtotal, binomial, Allvars"
## Null:  "glm, PhysAssault ~ 1, binomial, Allvars"                 
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                           0.00172966
## Cox and Snell (ML)                 0.00130121
## Nagelkerke (Cragg and Uhler)       0.00246000
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff   Chisq p.value
##       -2    -0.41731 0.83462 0.65882
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Model 3

CVLTlog3 <- glm(PhysAssault ~ (CVLfrs + Sex + PovStat)^3 + Age + WRATtotal, data = Allvars, family = "binomial")
summary(CVLTlog3)
## 
## Call:
## glm(formula = PhysAssault ~ (CVLfrs + Sex + PovStat)^3 + Age + 
##     WRATtotal, family = "binomial", data = Allvars)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0298  -0.5418  -0.4576  -0.3739   2.5096  
## 
## Coefficients:
##                            Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                -1.75276    1.12368  -1.560  0.11880   
## CVLfrs                      0.07310    0.06396   1.143  0.25305   
## SexMen                      0.42285    0.67236   0.629  0.52942   
## PovStatBelow                2.04485    0.69990   2.922  0.00348 **
## Age                        -0.03437    0.01427  -2.408  0.01602 * 
## WRATtotal                   0.01754    0.01814   0.967  0.33363   
## CVLfrs:SexMen              -0.09053    0.09203  -0.984  0.32529   
## CVLfrs:PovStatBelow        -0.26603    0.10348  -2.571  0.01014 * 
## SexMen:PovStatBelow        -1.90367    1.03608  -1.837  0.06615 . 
## CVLfrs:SexMen:PovStatBelow  0.33770    0.15904   2.123  0.03372 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 482.53  on 640  degrees of freedom
## Residual deviance: 461.85  on 631  degrees of freedom
## AIC: 481.85
## 
## Number of Fisher Scoring iterations: 5
confint(CVLTlog3)
##                                  2.5 %      97.5 %
## (Intercept)                -4.00877842  0.40460004
## CVLfrs                     -0.05036067  0.20195206
## SexMen                     -0.89138897  1.76734247
## PovStatBelow                0.68639107  3.45020200
## Age                        -0.06278525 -0.00671841
## WRATtotal                  -0.01713924  0.05412889
## CVLfrs:SexMen              -0.27352409  0.08858167
## CVLfrs:PovStatBelow        -0.47447559 -0.06691616
## SexMen:PovStatBelow        -3.98657186  0.09702919
## CVLfrs:SexMen:PovStatBelow  0.02909837  0.65460576
exp(cbind(OR = coef(CVLTlog3), confint(CVLTlog3)))
##                                   OR      2.5 %     97.5 %
## (Intercept)                0.1732950 0.01815556  1.4987030
## CVLfrs                     1.0758389 0.95088640  1.2237893
## SexMen                     1.5262979 0.41008576  5.8552721
## PovStatBelow               7.7279951 1.98653331 31.5067561
## Age                        0.9662183 0.93914513  0.9933041
## WRATtotal                  1.0176916 0.98300680  1.0556207
## CVLfrs:SexMen              0.9134514 0.76069401  1.0926235
## CVLfrs:PovStatBelow        0.7664193 0.62221126  0.9352736
## SexMen:PovStatBelow        0.1490209 0.01856324  1.1018925
## CVLfrs:SexMen:PovStatBelow 1.4017152 1.02952586  1.9243837
#Wald chi-square Test
Anova(CVLTlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
## 
## Response: PhysAssault
##                    Df  Chisq Pr(>Chisq)  
## CVLfrs              1 0.0765    0.78210  
## Sex                 1 0.4477    0.50345  
## PovStat             1 3.8651    0.04930 *
## Age                 1 5.8001    0.01602 *
## WRATtotal           1 0.9348    0.33363  
## CVLfrs:Sex          1 0.0923    0.76128  
## CVLfrs:PovStat      1 2.4495    0.11756  
## Sex:PovStat         1 0.0001    0.99069  
## CVLfrs:Sex:PovStat  1 4.5087    0.03372 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Plots
interact_plot(model = CVLTlog3, pred = CVLfrs, modx = Sex,mod2 = PovStat)

sim_slopes(CVLTlog3, pred = CVLfrs, modx = Sex, mod2 = PovStat, centered = "all",jnplot = TRUE)
## Warning: Johnson-Neyman intervals are not available for factor moderators.
## █████████████████████ While PovStat (2nd moderator) = Above ████████████████████ 
## 
## SIMPLE SLOPES ANALYSIS 
## 
## Slope of CVLfrs when Sex = Women: 
## 
##   Est.   S.E.   z val.      p
## ------ ------ -------- ------
##   0.07   0.06     1.14   0.25
## 
## Slope of CVLfrs when Sex = Men: 
## 
##    Est.   S.E.   z val.      p
## ------- ------ -------- ------
##   -0.02   0.07    -0.25   0.80
## 
## █████████████████████ While PovStat (2nd moderator) = Below ████████████████████ 
## 
## SIMPLE SLOPES ANALYSIS 
## 
## Slope of CVLfrs when Sex = Women: 
## 
##    Est.   S.E.   z val.      p
## ------- ------ -------- ------
##   -0.19   0.08    -2.30   0.02
## 
## Slope of CVLfrs when Sex = Men: 
## 
##   Est.   S.E.   z val.      p
## ------ ------ -------- ------
##   0.05   0.10     0.53   0.59
## 
## NULL
########Compare to null model 
#Difference in Deviance
with(CVLTlog3,null.deviance - deviance)
## [1] 20.67999
#Degrees of freedom for the difference between two models
with(CVLTlog3,df.null - df.residual)
## [1] 9
#p-value
with(CVLTlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.01414967
#Pseudo R-Squared
nagelkerke(CVLTlog3)
## $Models
##                                                                                            
## Model: "glm, PhysAssault ~ (CVLfrs + Sex + PovStat)^3 + Age + WRATtotal, binomial, Allvars"
## Null:  "glm, PhysAssault ~ 1, binomial, Allvars"                                           
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0428572
## Cox and Snell (ML)                  0.0317472
## Nagelkerke (Cragg and Uhler)        0.0600198
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff Chisq p.value
##       -9      -10.34 20.68 0.01415
## 
## $Number.of.observations
##           
## Model: 641
## Null:  641
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"

Compare Models 1 & 3

anova(CVLTlog1,CVLTlog3,test = "LR")
## Analysis of Deviance Table
## 
## Model 1: PhysAssault ~ CVLfrs + WRATtotal
## Model 2: PhysAssault ~ (CVLfrs + Sex + PovStat)^3 + Age + WRATtotal
##   Resid. Df Resid. Dev Df Deviance Pr(>Chi)   
## 1       638     481.70                        
## 2       631     461.85  7   19.845 0.005914 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1