load(file="/Users/meganwilliams/Desktop/Dissertation/StroopMixed.rdata")
load(file="/Users/meganwilliams/Desktop/Dissertation/AllvarsMen.rdata")
load(file="/Users/meganwilliams/Desktop/Dissertation/AllvarsWomen.rdata")
library(effects)
library(interactions)
library(rcompanion)
library(car)
options(scipen = 999)
TMTAWlog1 <- glm(PsychAggress ~ TrailsA + WRATtotal, data=AllvarsWomen,family = "binomial")
summary(TMTAWlog1)
##
## Call:
## glm(formula = PsychAggress ~ TrailsA + WRATtotal, family = "binomial",
## data = AllvarsWomen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.2523 0.4229 0.4540 0.4963 0.8980
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.112104 1.037822 1.072 0.284
## TrailsA -0.005448 0.004361 -1.249 0.212
## WRATtotal 0.027774 0.023584 1.178 0.239
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 227.67 on 330 degrees of freedom
## Residual deviance: 224.72 on 328 degrees of freedom
## AIC: 230.72
##
## Number of Fisher Scoring iterations: 5
confint(TMTAWlog1)
## 2.5 % 97.5 %
## (Intercept) -0.86311148 3.241870505
## TrailsA -0.01379764 0.004836086
## WRATtotal -0.01983973 0.073343509
exp(cbind(OR = coef(TMTAWlog1), confint(TMTAWlog1)))
## OR 2.5 % 97.5 %
## (Intercept) 3.0407503 0.4218475 25.581527
## TrailsA 0.9945672 0.9862971 1.004848
## WRATtotal 1.0281638 0.9803558 1.076100
plot(predictorEffect("TrailsA",TMTAWlog1))
########Compare to null model
#Difference in Deviance
with(TMTAWlog1,null.deviance - deviance)
## [1] 2.957548
#Degrees of freedom for the difference between two models
with(TMTAWlog1,df.null - df.residual)
## [1] 2
#p-value
with(TMTAWlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.227917
#Pseudo R-Squared
nagelkerke(TMTAWlog1)
## $Models
##
## Model: "glm, PsychAggress ~ TrailsA + WRATtotal, binomial, AllvarsWomen"
## Null: "glm, PsychAggress ~ 1, binomial, AllvarsWomen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.01299030
## Cox and Snell (ML) 0.00889539
## Nagelkerke (Cragg and Uhler) 0.01788600
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -2 -1.4788 2.9575 0.22792
##
## $Number.of.observations
##
## Model: 331
## Null: 331
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
options(scipen = 999)
TMTAWlog3 <- glm(PsychAggress ~ (TrailsA + PovStat)^2 + Age + WRATtotal, data = AllvarsWomen, family = "binomial")
summary(TMTAWlog3)
##
## Call:
## glm(formula = PsychAggress ~ (TrailsA + PovStat)^2 + Age + WRATtotal,
## family = "binomial", data = AllvarsWomen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.2944 0.4092 0.4515 0.4954 0.9077
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.770260 1.396971 1.267 0.205
## TrailsA -0.004729 0.004585 -1.031 0.302
## PovStatBelow -0.278664 0.921144 -0.303 0.762
## Age -0.016324 0.020473 -0.797 0.425
## WRATtotal 0.028915 0.023705 1.220 0.223
## TrailsA:PovStatBelow 0.011636 0.026207 0.444 0.657
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 227.67 on 330 degrees of freedom
## Residual deviance: 223.76 on 325 degrees of freedom
## AIC: 235.76
##
## Number of Fisher Scoring iterations: 5
confint(TMTAWlog3)
## 2.5 % 97.5 %
## (Intercept) -0.91244445 4.600162000
## TrailsA -0.01357863 0.006046941
## PovStatBelow -2.23542354 1.409426319
## Age -0.05664314 0.024013310
## WRATtotal -0.01896245 0.074670840
## TrailsA:PovStatBelow -0.03096826 0.073679544
exp(cbind(OR = coef(TMTAWlog3), confint(TMTAWlog3)))
## OR 2.5 % 97.5 %
## (Intercept) 5.8723817 0.4015415 99.500433
## TrailsA 0.9952825 0.9865131 1.006065
## PovStatBelow 0.7567940 0.1069468 4.093606
## Age 0.9838085 0.9449312 1.024304
## WRATtotal 1.0293369 0.9812162 1.077529
## TrailsA:PovStatBelow 1.0117039 0.9695063 1.076462
Anova(TMTAWlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
##
## Response: PsychAggress
## Df Chisq Pr(>Chisq)
## TrailsA 1 0.9579 0.3277
## PovStat 1 0.0535 0.8170
## Age 1 0.6358 0.4252
## WRATtotal 1 1.4878 0.2226
## TrailsA:PovStat 1 0.1971 0.6570
########Compare to null model
#Difference in Deviance
with(TMTAWlog3,null.deviance - deviance)
## [1] 3.908561
#Degrees of freedom for the difference between two models
with(TMTAWlog3,df.null - df.residual)
## [1] 5
#p-value
with(TMTAWlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.5626548
#Pseudo R-Squared
nagelkerke(TMTAWlog3)
## $Models
##
## Model: "glm, PsychAggress ~ (TrailsA + PovStat)^2 + Age + WRATtotal, binomial, AllvarsWomen"
## Null: "glm, PsychAggress ~ 1, binomial, AllvarsWomen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.0171674
## Cox and Snell (ML) 0.0117389
## Nagelkerke (Cragg and Uhler) 0.0236035
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -5 -1.9543 3.9086 0.56265
##
## $Number.of.observations
##
## Model: 331
## Null: 331
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
plot(predictorEffect("TrailsA",TMTAWlog3))
options(scipen = 999)
TMTAWlog1 <- glm(PhysAssault ~ TrailsA + WRATtotal, data=AllvarsWomen,family = "binomial")
summary(TMTAWlog1)
##
## Call:
## glm(formula = PhysAssault ~ TrailsA + WRATtotal, family = "binomial",
## data = AllvarsWomen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6855 -0.5758 -0.5264 -0.4632 2.4193
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.967483 1.229056 -2.414 0.0158 *
## TrailsA -0.007566 0.010297 -0.735 0.4625
## WRATtotal 0.030878 0.025158 1.227 0.2197
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 263.18 on 330 degrees of freedom
## Residual deviance: 260.27 on 328 degrees of freedom
## AIC: 266.27
##
## Number of Fisher Scoring iterations: 5
exp(cbind(OR = coef(TMTAWlog1), confint(TMTAWlog1)))
## OR 2.5 % 97.5 %
## (Intercept) 0.05143259 0.004356779 0.5689323
## TrailsA 0.99246287 0.966472952 1.0059130
## WRATtotal 1.03135999 0.983136981 1.0854992
Anova(TMTAWlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
##
## Response: PhysAssault
## Df Chisq Pr(>Chisq)
## TrailsA 1 0.5398 0.4625
## WRATtotal 1 1.5065 0.2197
########Compare to null model
#Difference in Deviance
with(TMTAWlog1,null.deviance - deviance)
## [1] 2.902885
#Degrees of freedom for the difference between two models
with(TMTAWlog1,df.null - df.residual)
## [1] 2
#p-value
with(TMTAWlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.2342322
#Pseudo R-Squared
nagelkerke(TMTAWlog1)
## $Models
##
## Model: "glm, PhysAssault ~ TrailsA + WRATtotal, binomial, AllvarsWomen"
## Null: "glm, PhysAssault ~ 1, binomial, AllvarsWomen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.0110302
## Cox and Snell (ML) 0.0087317
## Nagelkerke (Cragg and Uhler) 0.0159204
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -2 -1.4514 2.9029 0.23423
##
## $Number.of.observations
##
## Model: 331
## Null: 331
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
plot(predictorEffect("TrailsA",TMTAWlog1))
options(scipen = 999)
TMTAWlog3 <- glm(PhysAssault ~ (TrailsA + PovStat)^2 + Age + WRATtotal, data = AllvarsWomen, family = "binomial")
summary(TMTAWlog3)
##
## Call:
## glm(formula = PhysAssault ~ (TrailsA + PovStat)^2 + Age + WRATtotal,
## family = "binomial", data = AllvarsWomen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.0348 -0.5698 -0.4745 -0.3792 2.5024
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.4066971 1.4788421 -1.627 0.1036
## TrailsA 0.0008511 0.0069432 0.123 0.9024
## PovStatBelow 1.6908258 0.8966716 1.886 0.0593 .
## Age -0.0294400 0.0195042 -1.509 0.1312
## WRATtotal 0.0378536 0.0257276 1.471 0.1412
## TrailsA:PovStatBelow -0.0407166 0.0293487 -1.387 0.1653
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 263.18 on 330 degrees of freedom
## Residual deviance: 251.78 on 325 degrees of freedom
## AIC: 263.78
##
## Number of Fisher Scoring iterations: 5
confint(TMTAWlog3)
## Waiting for profiling to be done...
## 2.5 % 97.5 %
## (Intercept) -5.39869591 0.421841883
## TrailsA -0.02063067 0.011397809
## PovStatBelow 0.04421362 3.555736721
## Age -0.06866923 0.008116750
## WRATtotal -0.01067123 0.090499079
## TrailsA:PovStatBelow -0.10554416 0.009535001
exp(cbind(OR = coef(TMTAWlog3), confint(TMTAWlog3)))
## Waiting for profiling to be done...
## OR 2.5 % 97.5 %
## (Intercept) 0.09011243 0.004522475 1.524767
## TrailsA 1.00085147 0.979580688 1.011463
## PovStatBelow 5.42395783 1.045205610 35.013606
## Age 0.97098913 0.933635449 1.008150
## WRATtotal 1.03857920 0.989385504 1.094720
## TrailsA:PovStatBelow 0.96010119 0.899834737 1.009581
Anova(TMTAWlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
##
## Response: PhysAssault
## Df Chisq Pr(>Chisq)
## TrailsA 1 0.0218 0.8826
## PovStat 1 2.5055 0.1134
## Age 1 2.2784 0.1312
## WRATtotal 1 2.1648 0.1412
## TrailsA:PovStat 1 1.9247 0.1653
########Compare to null model
#Difference in Deviance
with(TMTAWlog3,null.deviance - deviance)
## [1] 11.39501
#Degrees of freedom for the difference between two models
with(TMTAWlog3,df.null - df.residual)
## [1] 5
#p-value
with(TMTAWlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.04408684
#Pseudo R-Squared
nagelkerke(TMTAWlog3)
## $Models
##
## Model: "glm, PhysAssault ~ (TrailsA + PovStat)^2 + Age + WRATtotal, binomial, AllvarsWomen"
## Null: "glm, PhysAssault ~ 1, binomial, AllvarsWomen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.0432981
## Cox and Snell (ML) 0.0338402
## Nagelkerke (Cragg and Uhler) 0.0617003
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -5 -5.6975 11.395 0.044087
##
## $Number.of.observations
##
## Model: 331
## Null: 331
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
plot(predictorEffect("TrailsA",TMTAWlog3))
load(file="/Users/meganwilliams/Desktop/Dissertation/StroopMixed.rdata")
load(file="/Users/meganwilliams/Desktop/Dissertation/AllvarsMen.rdata")
load(file="/Users/meganwilliams/Desktop/Dissertation/AllvarsWomen.rdata")
library(effects)
library(interactions)
library(rcompanion)
library(car)
TMTAMlog1 <- glm(PsychAggress ~ TrailsA + WRATtotal, data=AllvarsMen,family = "binomial")
summary(TMTAMlog1)
##
## Call:
## glm(formula = PsychAggress ~ TrailsA + WRATtotal, family = "binomial",
## data = AllvarsMen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.0186 0.5367 0.5627 0.5960 1.2066
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.364313 0.842450 1.619 0.1053
## TrailsA -0.006531 0.003622 -1.803 0.0714 .
## WRATtotal 0.012538 0.018487 0.678 0.4977
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 273.92 on 309 degrees of freedom
## Residual deviance: 270.09 on 307 degrees of freedom
## AIC: 276.09
##
## Number of Fisher Scoring iterations: 4
confint(TMTAMlog1)
## 2.5 % 97.5 %
## (Intercept) -0.23740596 3.0868098954
## TrailsA -0.01410886 0.0009720848
## WRATtotal -0.02473921 0.0481481886
exp(cbind(OR = coef(TMTAMlog1), confint(TMTAMlog1)))
## OR 2.5 % 97.5 %
## (Intercept) 3.9130325 0.7886711 21.907081
## TrailsA 0.9934906 0.9859902 1.000973
## WRATtotal 1.0126165 0.9755643 1.049326
plot(predictorEffect("TrailsA",TMTAMlog1))
########Compare to null model
#Difference in Deviance
with(TMTAMlog1,null.deviance - deviance)
## [1] 3.829029
#Degrees of freedom for the difference between two models
with(TMTAMlog1,df.null - df.residual)
## [1] 2
#p-value
with(TMTAMlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.1474134
#Pseudo R-Squared
nagelkerke(TMTAMlog1)
## $Models
##
## Model: "glm, PsychAggress ~ TrailsA + WRATtotal, binomial, AllvarsMen"
## Null: "glm, PsychAggress ~ 1, binomial, AllvarsMen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.0139787
## Cox and Snell (ML) 0.0122757
## Nagelkerke (Cragg and Uhler) 0.0209230
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -2 -1.9145 3.829 0.14741
##
## $Number.of.observations
##
## Model: 310
## Null: 310
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
options(scipen = 999)
TMTAMlog3 <- glm(PsychAggress ~ (TrailsA + PovStat)^2 + Age + WRATtotal, data = AllvarsMen,family = "binomial")
summary(TMTAMlog3)
##
## Call:
## glm(formula = PsychAggress ~ (TrailsA + PovStat)^2 + Age + WRATtotal,
## family = "binomial", data = AllvarsMen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.2993 0.4427 0.5493 0.6257 0.9648
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.223509 1.286000 1.729 0.0838 .
## TrailsA -0.004456 0.004266 -1.045 0.2962
## PovStatBelow 0.849126 0.565185 1.502 0.1330
## Age -0.025305 0.017720 -1.428 0.1533
## WRATtotal 0.016200 0.018926 0.856 0.3920
## TrailsA:PovStatBelow -0.009152 0.009465 -0.967 0.3336
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 273.92 on 309 degrees of freedom
## Residual deviance: 265.13 on 304 degrees of freedom
## AIC: 277.13
##
## Number of Fisher Scoring iterations: 4
confint(TMTAMlog3)
## 2.5 % 97.5 %
## (Intercept) -0.26735807 4.792599561
## TrailsA -0.01291187 0.005180761
## PovStatBelow -0.19630553 2.161096990
## Age -0.06063448 0.009120367
## WRATtotal -0.02178959 0.052831531
## TrailsA:PovStatBelow -0.03589580 0.008390065
exp(cbind(OR = coef(TMTAMlog3), confint(TMTAMlog3)))
## OR 2.5 % 97.5 %
## (Intercept) 9.2396979 0.7653990 120.614506
## TrailsA 0.9955544 0.9871711 1.005194
## PovStatBelow 2.3376039 0.8217611 8.680655
## Age 0.9750122 0.9411672 1.009162
## WRATtotal 1.0163316 0.9784461 1.054252
## TrailsA:PovStatBelow 0.9908899 0.9647408 1.008425
Anova(TMTAMlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
##
## Response: PsychAggress
## Df Chisq Pr(>Chisq)
## TrailsA 1 2.7339 0.09824 .
## PovStat 1 1.3571 0.24405
## Age 1 2.0395 0.15326
## WRATtotal 1 0.7326 0.39203
## TrailsA:PovStat 1 0.9349 0.33359
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
########Compare to null model
#Difference in Deviance
with(TMTAMlog3,null.deviance - deviance)
## [1] 8.784853
#Degrees of freedom for the difference between two models
with(TMTAMlog3,df.null - df.residual)
## [1] 5
#p-value
with(TMTAMlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.1179595
#Pseudo R-Squared
nagelkerke(TMTAMlog3)
## $Models
##
## Model: "glm, PsychAggress ~ (TrailsA + PovStat)^2 + Age + WRATtotal, binomial, AllvarsMen"
## Null: "glm, PsychAggress ~ 1, binomial, AllvarsMen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.0320711
## Cox and Snell (ML) 0.0279405
## Nagelkerke (Cragg and Uhler) 0.0476223
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -5 -4.3924 8.7849 0.11796
##
## $Number.of.observations
##
## Model: 310
## Null: 310
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
plot(predictorEffect("TrailsA",TMTAMlog3))
options(scipen = 999)
TMTAMlog1 <- glm(PhysAssault ~ TrailsA + WRATtotal, data=AllvarsMen,family = "binomial")
summary(TMTAMlog1)
##
## Call:
## glm(formula = PhysAssault ~ TrailsA + WRATtotal, family = "binomial",
## data = AllvarsMen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.5761 -0.5128 -0.4891 -0.4609 2.1902
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.15536 1.25580 -0.920 0.358
## TrailsA -0.01138 0.01301 -0.875 0.381
## WRATtotal -0.01178 0.02355 -0.500 0.617
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 218.58 on 309 degrees of freedom
## Residual deviance: 217.20 on 307 degrees of freedom
## AIC: 223.2
##
## Number of Fisher Scoring iterations: 6
exp(cbind(OR = coef(TMTAMlog1), confint(TMTAMlog1)))
## OR 2.5 % 97.5 %
## (Intercept) 0.3149429 0.02905759 4.057861
## TrailsA 0.9886800 0.95829576 1.004720
## WRATtotal 0.9882937 0.94396256 1.036015
Anova(TMTAMlog1, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
##
## Response: PhysAssault
## Df Chisq Pr(>Chisq)
## TrailsA 1 0.7662 0.3814
## WRATtotal 1 0.2500 0.6170
########Compare to null model
#Difference in Deviance
with(TMTAMlog1,null.deviance - deviance)
## [1] 1.378496
#Degrees of freedom for the difference between two models
with(TMTAMlog1,df.null - df.residual)
## [1] 2
#p-value
with(TMTAMlog1,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.5019534
#Pseudo R-Squared
nagelkerke(TMTAMlog1)
## $Models
##
## Model: "glm, PhysAssault ~ TrailsA + WRATtotal, binomial, AllvarsMen"
## Null: "glm, PhysAssault ~ 1, binomial, AllvarsMen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.00630670
## Cox and Snell (ML) 0.00443689
## Nagelkerke (Cragg and Uhler) 0.00876971
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -2 -0.68925 1.3785 0.50195
##
## $Number.of.observations
##
## Model: 310
## Null: 310
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
plot(predictorEffect("TrailsA",TMTAMlog1))
options(scipen = 999)
TMTAMlog3 <- glm(PhysAssault ~ (TrailsA + PovStat)^2 + Age + WRATtotal, data = AllvarsMen,family = "binomial")
summary(TMTAMlog3)
##
## Call:
## glm(formula = PhysAssault ~ (TrailsA + PovStat)^2 + Age + WRATtotal,
## family = "binomial", data = AllvarsMen)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.7676 -0.5319 -0.4560 -0.3828 2.3400
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.157937 1.616419 -0.098 0.922
## TrailsA -0.010862 0.016229 -0.669 0.503
## PovStatBelow 0.341012 0.818882 0.416 0.677
## Age -0.030737 0.020724 -1.483 0.138
## WRATtotal -0.006410 0.024024 -0.267 0.790
## TrailsA:PovStatBelow 0.004318 0.021489 0.201 0.841
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 218.58 on 309 degrees of freedom
## Residual deviance: 212.63 on 304 degrees of freedom
## AIC: 224.63
##
## Number of Fisher Scoring iterations: 6
confint(TMTAMlog3)
## Waiting for profiling to be done...
## 2.5 % 97.5 %
## (Intercept) -3.30864473 3.072138815
## TrailsA -0.05329183 0.006927701
## PovStatBelow -1.31130901 2.160675753
## Age -0.07206158 0.009648445
## WRATtotal -0.05296189 0.042093249
## TrailsA:PovStatBelow -0.04602336 0.051127406
exp(cbind(OR = coef(TMTAMlog3), confint(TMTAMlog3)))
## Waiting for profiling to be done...
## OR 2.5 % 97.5 %
## (Intercept) 0.8539034 0.0365657 21.588026
## TrailsA 0.9891967 0.9481033 1.006952
## PovStatBelow 1.4063695 0.2694671 8.676999
## Age 0.9697304 0.9304736 1.009695
## WRATtotal 0.9936109 0.9484162 1.042992
## TrailsA:PovStatBelow 1.0043274 0.9550197 1.052457
Anova(TMTAMlog3, type="II", test="Wald")
## Analysis of Deviance Table (Type II tests)
##
## Response: PhysAssault
## Df Chisq Pr(>Chisq)
## TrailsA 1 0.5828 0.4452
## PovStat 1 1.5508 0.2130
## Age 1 2.1998 0.1380
## WRATtotal 1 0.0712 0.7896
## TrailsA:PovStat 1 0.0404 0.8407
########Compare to null model
#Difference in Deviance
with(TMTAMlog3,null.deviance - deviance)
## [1] 5.948348
#Degrees of freedom for the difference between two models
with(TMTAMlog3,df.null - df.residual)
## [1] 5
#p-value
with(TMTAMlog3,pchisq(null.deviance-deviance,df.null-df.residual,lower.tail=FALSE))
## [1] 0.3112774
#Pseudo R-Squared
nagelkerke(TMTAMlog3)
## $Models
##
## Model: "glm, PhysAssault ~ (TrailsA + PovStat)^2 + Age + WRATtotal, binomial, AllvarsMen"
## Null: "glm, PhysAssault ~ 1, binomial, AllvarsMen"
##
## $Pseudo.R.squared.for.model.vs.null
## Pseudo.R.squared
## McFadden 0.0272141
## Cox and Snell (ML) 0.0190053
## Nagelkerke (Cragg and Uhler) 0.0375648
##
## $Likelihood.ratio.test
## Df.diff LogLik.diff Chisq p.value
## -5 -2.9742 5.9483 0.31128
##
## $Number.of.observations
##
## Model: 310
## Null: 310
##
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
##
## $Warnings
## [1] "None"
plot(predictorEffect("TrailsA",TMTAMlog3))