IPV and Cognitive Test Regression Models (After matching by sex, race, years of education, and age at baseline)

Trails A Regression Model 1

## Loading required package: Matrix
## KernSmooth 2.23 loaded
## Copyright M. P. Wand 1997-2009
## 
## Attaching package: 'lmerTest'
## 
## The following object is masked from 'package:lme4':
## 
##     lmer
## 
## The following object is masked from 'package:stats':
## 
##     step
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsAtestSec ~ (Age + IPVstatus + Sex + Race)^4 + (Age | HNDid) +      (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##   1381.2   1440.8   -669.6   1339.2 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 0.00e+00     
##           Age         1.77e+00  NaN
##  subclass (Intercept) 2.55e-06     
##  Residual             4.63e+01     
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                     (Intercept)                              Age  
##                          30.090                            0.254  
##                      IPVstatus1                           SexMen  
##                           0.212                           -9.708  
##                       RaceAfrAm                   Age:IPVstatus1  
##                          11.479                            0.118  
##                      Age:SexMen                    Age:RaceAfrAm  
##                          -0.288                            0.353  
##               IPVstatus1:SexMen             IPVstatus1:RaceAfrAm  
##                          22.979                            3.001  
##                SexMen:RaceAfrAm            Age:IPVstatus1:SexMen  
##                          -0.260                            0.978  
##        Age:IPVstatus1:RaceAfrAm             Age:SexMen:RaceAfrAm  
##                           0.785                           -1.832  
##     IPVstatus1:SexMen:RaceAfrAm  Age:IPVstatus1:SexMen:RaceAfrAm  
##                          -9.684                            1.218
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: no non-missing arguments to max; returning -Inf
## Warning: no non-missing arguments to max; returning -Inf
## 
## Random effects:
##                         Chi.sq Chi.DF elim.num p.value
## (1 | subclass)            0.00      1        1  1.0000
## (Age | HNDid)             0.02      1        2  0.8760
##       (1 | HNDid)         0.00      1        3  1.0000
##       (Age + 0 | HNDid)   6.56      1     kept  0.0105
## 
## Fixed effects:
##                           Sum Sq   Mean Sq NumDF  DenDF F.value elim.num
## Age:IPVstatus:Sex:Race   45.4128   45.4128     1  95.48  0.0190        1
## Age:Sex:Race            292.1723  292.1723     1  96.51  0.0934        2
## Age:IPVstatus:Race       94.5952   94.5952     1  89.48  0.0476        3
## Age:Race                  0.0126    0.0126     1  86.63  0.0277        4
## IPVstatus:Sex:Race      331.1841  331.1841     1 103.10  0.1492        5
## Sex:Race                171.3033  171.3033     1 103.37  0.0658        6
## IPVstatus:Race          548.6032  548.6032     1 105.77  0.2041        7
## Age:IPVstatus:Sex       648.8727  648.8727     1  99.02  0.3456        8
## IPVstatus:Sex            32.3929   32.3929     1 109.78  0.0145        9
## Age:Sex                 887.6075  887.6075     1  98.71  0.4218       10
## Sex                     976.6424  976.6424     1 111.33  0.1209       11
## Age:IPVstatus          1450.1250 1450.1250     1 101.13  0.8106       12
## IPVstatus               188.0815  188.0815     1 116.18  0.0094       13
## Age                     558.7452  558.7452     1  94.69  0.1981       14
## Race                   2177.2088 2177.2088     1 112.45  1.3215       15
##                        Pr(>F)
## Age:IPVstatus:Sex:Race 0.8908
## Age:Sex:Race           0.7606
## Age:IPVstatus:Race     0.8277
## Age:Race               0.8681
## IPVstatus:Sex:Race     0.7001
## Sex:Race               0.7980
## IPVstatus:Race         0.6524
## Age:IPVstatus:Sex      0.5580
## IPVstatus:Sex          0.9044
## Age:Sex                0.5175
## Sex                    0.7287
## Age:IPVstatus          0.3701
## IPVstatus              0.9229
## Age                    0.6572
## Race                   0.2528
## 
## Least squares means:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
##  Differences of LSMEANS:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
## Final model:
## lme4::lmer(formula = TrailsAtestSec ~ (Age + 0 | HNDid), data = IPVandCognitionDataSet2, 
##     REML = reml, contrasts = l)

Will not allow me to run Trails A final Model 1

Trails A Regression Model 2 (with CES)

load("~/Desktop/Megan/Research/IPV and Cognition Paper/IPV R Output/IPVandCognitionDataSet2.rda")

library(lme4)
library(lmerTest)

(mm2 = lmer(TrailsAtestSec ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age | 
    HNDid) + (1 | subclass), data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsAtestSec ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age |      HNDid) + (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##   1407.6   1512.6   -666.8   1333.6 
## Random effects:
##  Groups   Name        Std.Dev. Corr 
##  HNDid    (Intercept) 8.72e-01      
##           Age         1.21e+00 -1.00
##  subclass (Intercept) 4.31e-04      
##  Residual             4.65e+01      
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                           (Intercept)  
##                               30.3798  
##                                   Age  
##                                0.0755  
##                            IPVstatus1  
##                               14.6202  
##                                SexMen  
##                               -9.8277  
##                             RaceAfrAm  
##                                8.3326  
##                                 CES11  
##                                4.6202  
##                        Age:IPVstatus1  
##                                1.9245  
##                            Age:SexMen  
##                               -0.0698  
##                         Age:RaceAfrAm  
##                                0.4424  
##                             Age:CES11  
##                                0.9245  
##                     IPVstatus1:SexMen  
##                               10.1025  
##                  IPVstatus1:RaceAfrAm  
##                               -4.4392  
##                      IPVstatus1:CES11  
##                              -20.9920  
##                      SexMen:RaceAfrAm  
##                                7.7783  
##                          SexMen:CES11  
##                               -6.9723  
##                       RaceAfrAm:CES11  
##                                1.8188  
##                 Age:IPVstatus1:SexMen  
##                               -0.9835  
##              Age:IPVstatus1:RaceAfrAm  
##                               -0.6883  
##                  Age:IPVstatus1:CES11  
##                               -2.7583  
##                  Age:SexMen:RaceAfrAm  
##                               -0.1476  
##                      Age:SexMen:CES11  
##                               -1.7302  
##                   Age:RaceAfrAm:CES11  
##                               -0.9260  
##           IPVstatus1:SexMen:RaceAfrAm  
##                              -18.9465  
##               IPVstatus1:SexMen:CES11  
##                               17.0692  
##            IPVstatus1:RaceAfrAm:CES11  
##                                8.5263  
##                SexMen:RaceAfrAm:CES11  
##                              -19.6817  
##       Age:IPVstatus1:SexMen:RaceAfrAm  
##                               -0.5533  
##           Age:IPVstatus1:SexMen:CES11  
##                                3.6173  
##        Age:IPVstatus1:RaceAfrAm:CES11  
##                                2.7190  
##            Age:SexMen:RaceAfrAm:CES11  
##                               -3.8414  
##     IPVstatus1:SexMen:RaceAfrAm:CES11  
##                               27.2041  
## Age:IPVstatus1:SexMen:RaceAfrAm:CES11  
##                                4.6643

(st = step(mm2))
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: no non-missing arguments to max; returning -Inf
## Warning: no non-missing arguments to max; returning -Inf
## 
## Random effects:
##                         Chi.sq Chi.DF elim.num p.value
## (Age | HNDid)             0.00      1        1  1.0000
## (1 | subclass)            0.00      1        2  1.0000
##       (1 | HNDid)         0.00      1        3  1.0000
##       (Age + 0 | HNDid)   3.12      1     kept  0.0773
## 
## Fixed effects:
##                              Sum Sq Mean Sq NumDF  DenDF F.value elim.num
## Age:IPVstatus:Sex:Race:CES1   24.10   24.10     1  86.66  0.0087        1
## Age:IPVstatus:Sex:Race       212.06  212.06     1  88.71  0.0016        2
## IPVstatus:Sex:Race:CES1       20.35   20.35     1  93.92  0.0059        3
## Age:Sex:Race:CES1             20.34   20.34     1  92.01  0.0077        4
## Sex:Race:CES1                172.07  172.07     1  95.71  0.0044        5
## Age:Sex:Race                 312.61  312.61     1  98.82  0.0059        6
## IPVstatus:Sex:Race            30.33   30.33     1  70.92  0.0485        7
## Sex:Race                     554.41  554.41     1  67.11  0.0224        8
## Age:IPVstatus:Race:CES1      136.72  136.72     1  79.48  0.0649        9
## Age:Race:CES1                 65.13   65.13     1  72.92  0.0001       10
## Age:IPVstatus:Race           153.27  153.27     1  92.20  0.0390       11
## Age:Race                      67.95   67.95     1  85.28  0.0172       12
## IPVstatus:Race:CES1          532.02  532.02     1  82.14  0.0517       13
## Race:CES1                    350.24  350.24     1  85.74  0.0160       14
## IPVstatus:Race               308.94  308.94     1  89.63  0.0552       15
## Race                        2303.12 2303.12     1  89.08  0.4058       16
## Age:IPVstatus:Sex:CES1       613.76  613.76     1  96.05  1.3460       17
## IPVstatus:Sex:CES1          1005.64 1005.64     1  93.18  0.1389       18
## Age:IPVstatus:Sex            435.86  435.86     1  92.72  0.7846       19
## IPVstatus:Sex                 42.56   42.56     1  96.54  0.0200       20
## Age:IPVstatus:CES1           455.29  455.29     1  95.36  0.4354       21
## Age:Sex:CES1                1656.23 1656.23     1  87.91  0.4996       22
## Age:CES1                    1296.42 1296.42     1  80.38  0.3067       23
## Sex:CES1                     621.64  621.64     1 108.60  0.4082       24
## Age:Sex                     1145.18 1145.18     1  95.31  0.6167       25
## Sex                         1072.52 1072.52     1 108.28  0.1665       26
## IPVstatus:CES1              2191.59 2191.59     1 111.36  0.8732       27
## Age:IPVstatus               1357.76 1357.76     1 101.59  0.7653       28
## Age                          472.15  472.15     1  94.87  0.1456       29
## IPVstatus                    250.78  250.78     1 113.96  0.3159       30
## CES1                        1696.13 1696.13     1 116.79  0.8347       31
##                             Pr(>F)
## Age:IPVstatus:Sex:Race:CES1 0.9259
## Age:IPVstatus:Sex:Race      0.9684
## IPVstatus:Sex:Race:CES1     0.9391
## Age:Sex:Race:CES1           0.9303
## Sex:Race:CES1               0.9474
## Age:Sex:Race                0.9388
## IPVstatus:Sex:Race          0.8264
## Sex:Race                    0.8815
## Age:IPVstatus:Race:CES1     0.7996
## Age:Race:CES1               0.9933
## Age:IPVstatus:Race          0.8439
## Age:Race                    0.8959
## IPVstatus:Race:CES1         0.8207
## Race:CES1                   0.8996
## IPVstatus:Race              0.8148
## Race                        0.5257
## Age:IPVstatus:Sex:CES1      0.2489
## IPVstatus:Sex:CES1          0.7102
## Age:IPVstatus:Sex           0.3780
## IPVstatus:Sex               0.8879
## Age:IPVstatus:CES1          0.5109
## Age:Sex:CES1                0.4816
## Age:CES1                    0.5813
## Sex:CES1                    0.5242
## Age:Sex                     0.4342
## Sex                         0.6840
## IPVstatus:CES1              0.3521
## Age:IPVstatus               0.3837
## Age                         0.7037
## IPVstatus                   0.5752
## CES1                        0.3628
## 
## Least squares means:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
##  Differences of LSMEANS:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
## Final model:
## lme4::lmer(formula = TrailsAtestSec ~ (Age + 0 | HNDid), data = IPVandCognitionDataSet2, 
##     REML = reml, contrasts = l)

Will not allow me to run Trails A suggested final Model 2

Trails B Regression Models

Trails B Regression Model 1

load("~/Desktop/Megan/Research/IPV and Cognition Paper/IPV R Output/IPVandCognitionDataSet2.rda")

library(lme4)
library(lmerTest)

(mm1 = lmer(TrailsBtestSec ~ (Age + IPVstatus + Sex + Race)^4 + (Age | HNDid) + 
    (1 | subclass), data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsBtestSec ~ (Age + IPVstatus + Sex + Race)^4 + (Age | HNDid) +      (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##   1591.1   1650.6   -774.5   1549.1 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 173.8        
##           Age          12.1    0.71
##  subclass (Intercept)  33.1        
##  Residual              48.9        
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                     (Intercept)                              Age  
##                           81.45                             1.76  
##                      IPVstatus1                           SexMen  
##                           -2.07                           -51.03  
##                       RaceAfrAm                   Age:IPVstatus1  
##                          177.08                            -0.15  
##                      Age:SexMen                    Age:RaceAfrAm  
##                           -3.36                             2.54  
##               IPVstatus1:SexMen             IPVstatus1:RaceAfrAm  
##                          269.20                          -172.07  
##                SexMen:RaceAfrAm            Age:IPVstatus1:SexMen  
##                          -73.06                            14.32  
##        Age:IPVstatus1:RaceAfrAm             Age:SexMen:RaceAfrAm  
##                           -2.62                             1.41  
##     IPVstatus1:SexMen:RaceAfrAm  Age:IPVstatus1:SexMen:RaceAfrAm  
##                           79.24                            -8.19

(st = step(mm1))
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## 
## Random effects:
##                Chi.sq Chi.DF elim.num p.value
## (1 | subclass)   0.07      1        1  0.7963
## (Age | HNDid)    6.21      1     kept  0.0127
## 
## Fixed effects:
##                           Sum Sq   Mean Sq NumDF DenDF F.value elim.num
## Age:IPVstatus:Sex:Race 1.030e+02 1.030e+02     1 58.20  0.0470        1
## Age:Sex:Race           3.370e-02 3.370e-02     1 57.93  0.0004        2
## Age:IPVstatus:Race     4.108e+02 4.108e+02     1 61.14  0.1774        3
## Age:Race               1.578e+02 1.578e+02     1 60.49  0.0755        4
## Age:IPVstatus:Sex      1.317e+03 1.317e+03     1 64.08  0.5903        5
## Age:Sex                7.921e+01 7.921e+01     1 64.75  0.0276        6
## Age:IPVstatus          7.289e+01 7.289e+01     1 67.14  0.1176        7
## IPVstatus:Sex:Race     1.321e+03 1.321e+03     1 47.99  0.6635        8
## Sex:Race               4.709e+02 4.709e+02     1 49.66  0.2014        9
## IPVstatus:Race         2.630e+03 2.630e+03     1 50.79  1.1116       10
## Age                    5.336e+03 5.336e+03     1 66.89  2.1616       11
## Race                   5.713e+03 5.713e+03     1 51.61  3.4140       12
## IPVstatus              2.898e+01 2.898e+01     1 54.99  0.0735     kept
## Sex                    1.638e+02 1.638e+02     1 54.99  1.4959     kept
## IPVstatus:Sex          1.711e+04 1.711e+04     1 54.99  7.8470     kept
##                        Pr(>F)
## Age:IPVstatus:Sex:Race 0.8291
## Age:Sex:Race           0.9838
## Age:IPVstatus:Race     0.6751
## Age:Race               0.7844
## Age:IPVstatus:Sex      0.4451
## Age:Sex                0.8687
## Age:IPVstatus          0.7328
## IPVstatus:Sex:Race     0.4193
## Sex:Race               0.6555
## IPVstatus:Race         0.2967
## Age                    0.1462
## Race                   0.0704
## IPVstatus              0.7873
## Sex                    0.2265
## IPVstatus:Sex          0.0070
## 
## Least squares means:
##                        IPVstatus  Sex Estimate Standard Error   DF t-value
## IPVstatus  0                 1.0   NA    138.3           24.0 53.8    5.76
## IPVstatus  1                 2.0   NA    149.7           34.6 55.5    4.33
## Sex  Women                    NA  2.0    118.2           28.2 53.1    4.19
## Sex  Men                      NA  1.0    169.7           31.2 56.5    5.43
## IPVstatus:Sex  0 Women       1.0  2.0    171.5           35.1 58.4    4.88
## IPVstatus:Sex  1 Women       2.0  2.0     65.0           44.1 50.1    1.47
## IPVstatus:Sex  0 Men         1.0  1.0    105.0           32.8 48.5    3.21
## IPVstatus:Sex  1 Men         2.0  1.0    234.4           53.2 59.6    4.40
##                        Lower CI Upper CI p-value
## IPVstatus  0               90.1      186  <2e-16
## IPVstatus  1               80.4      219  0.0001
## Sex  Women                 61.7      175  0.0001
## Sex  Men                  107.1      232  <2e-16
## IPVstatus:Sex  0 Women    101.1      242  <2e-16
## IPVstatus:Sex  1 Women    -23.6      154  0.1468
## IPVstatus:Sex  0 Men       39.2      171  0.0024
## IPVstatus:Sex  1 Men      127.9      341  <2e-16
## 
##  Differences of LSMEANS:
##                                 Estimate Standard Error     DF t-value
## IPVstatus 0-1                      -11.4           42.1   55.0   -0.27
## Sex Women-Men                      -51.5           42.1   55.0   -1.22
## IPVstatus:Sex  0 Women- 1 Women    106.5           56.4   53.1    1.89
## IPVstatus:Sex  0 Women- 0 Men       66.4           48.0   53.8    1.38
## IPVstatus:Sex  0 Women- 1 Men      -62.9           63.8   59.2   -0.99
## IPVstatus:Sex  1 Women- 0 Men      -40.1           54.9   49.8   -0.73
## IPVstatus:Sex  1 Women- 1 Men     -169.4           69.1   55.5   -2.45
## IPVstatus:Sex  0 Men- 1 Men       -129.3           62.5   56.5   -2.07
##                                 Lower CI Upper CI p-value
## IPVstatus 0-1                      -95.8    72.94    0.79
## Sex Women-Men                     -135.8    32.87    0.23
## IPVstatus:Sex  0 Women- 1 Women     -6.6   219.59    0.06
## IPVstatus:Sex  0 Women- 0 Men      -29.9   162.76    0.17
## IPVstatus:Sex  0 Women- 1 Men     -190.5    64.75    0.33
## IPVstatus:Sex  1 Women- 0 Men     -150.4    70.27    0.47
## IPVstatus:Sex  1 Women- 1 Men     -307.9   -30.88    0.02
## IPVstatus:Sex  0 Men- 1 Men       -254.5    -4.13    0.04
## 
## Final model:
## lme4::lmer(formula = TrailsBtestSec ~ IPVstatus + Sex + (Age | 
##     HNDid) + IPVstatus:Sex, data = IPVandCognitionDataSet2, REML = reml, 
##     contrasts = l)

Re-run Trails B suggested final Model 1

(mm1 = lmer(TrailsBtestSec ~ IPVstatus + Sex + (Age | HNDid) + (1 | subclass) + 
    IPVstatus:Sex, data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsBtestSec ~ IPVstatus + Sex + (Age | HNDid) + (1 | subclass) +      IPVstatus:Sex 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##   1576.1   1601.6   -779.1   1558.1 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 1.93e+02     
##           Age         1.27e+01 0.72
##  subclass (Intercept) 7.80e-04     
##  Residual             4.86e+01     
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##       (Intercept)         IPVstatus1             SexMen  
##             172.1             -107.2              -66.8  
## IPVstatus1:SexMen  
##             237.0

summary(mm1)
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsBtestSec ~ IPVstatus + Sex + (Age | HNDid) + (1 | subclass) +      IPVstatus:Sex 
##    Data: IPVandCognitionDataSet2 
## 
##      AIC      BIC   logLik deviance 
##   1576.1   1601.6   -779.1   1558.1 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  HNDid    (Intercept) 3.72e+04 1.93e+02     
##           Age         1.63e+02 1.27e+01 0.72
##  subclass (Intercept) 6.09e-07 7.80e-04     
##  Residual             2.36e+03 4.86e+01     
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## 
## Fixed effects:
##                   Estimate Std. Error     df t value Pr(>|t|)
## (Intercept)          172.1       34.0   62.6    5.07  3.8e-06
## IPVstatus1          -107.2       54.4   57.0   -1.97    0.054
## SexMen               -66.8       46.4   57.8   -1.44    0.155
## IPVstatus1:SexMen    237.0       81.3   59.1    2.92    0.005
## 
## Correlation of Fixed Effects:
##             (Intr) IPVst1 SexMen
## IPVstatus1  -0.624              
## SexMen      -0.733  0.457       
## IPVstts1:SM  0.418 -0.669 -0.570

plot(st)

plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3


plot(mm1)

plot of chunk unnamed-chunk-3

Trails B Regression Model 2 (with CES)

load("~/Desktop/Megan/Research/IPV and Cognition Paper/IPV R Output/IPVandCognitionDataSet2.rda")

library(lme4)
library(lmerTest)

(mm2 = lmer(TrailsBtestSec ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age | 
    HNDid) + (1 | subclass), data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsBtestSec ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age |      HNDid) + (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##   1603.1   1708.1   -764.6   1529.1 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 1.63e+02     
##           Age         9.42e+00 0.79
##  subclass (Intercept) 2.39e-04     
##  Residual             5.34e+01     
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                           (Intercept)  
##                                 96.46  
##                                   Age  
##                                  2.64  
##                            IPVstatus1  
##                                  9.54  
##                                SexMen  
##                                -67.80  
##                             RaceAfrAm  
##                                103.30  
##                                 CES11  
##                               -155.66  
##                        Age:IPVstatus1  
##                                  1.70  
##                            Age:SexMen  
##                                 -4.54  
##                         Age:RaceAfrAm  
##                                  3.77  
##                             Age:CES11  
##                                 -9.44  
##                     IPVstatus1:SexMen  
##                                369.06  
##                  IPVstatus1:RaceAfrAm  
##                               -135.66  
##                      IPVstatus1:CES11  
##                                118.66  
##                      SexMen:RaceAfrAm  
##                                -46.08  
##                          SexMen:CES11  
##                                179.60  
##                       RaceAfrAm:CES11  
##                                276.79  
##                 Age:IPVstatus1:SexMen  
##                                 16.15  
##              Age:IPVstatus1:RaceAfrAm  
##                                 -7.46  
##                  Age:IPVstatus1:CES11  
##                                  5.64  
##                  Age:SexMen:RaceAfrAm  
##                                 -6.38  
##                      Age:SexMen:CES11  
##                                  8.94  
##                   Age:RaceAfrAm:CES11  
##                                 -1.47  
##           IPVstatus1:SexMen:RaceAfrAm  
##                                184.18  
##               IPVstatus1:SexMen:CES11  
##                               -420.85  
##            IPVstatus1:RaceAfrAm:CES11  
##                               -225.01  
##                SexMen:RaceAfrAm:CES11  
##                               -186.60  
##       Age:IPVstatus1:SexMen:RaceAfrAm  
##                                 -5.87  
##           Age:IPVstatus1:SexMen:CES11  
##                                -14.09  
##        Age:IPVstatus1:RaceAfrAm:CES11  
##                                  8.19  
##            Age:SexMen:RaceAfrAm:CES11  
##                                 16.21  
##     IPVstatus1:SexMen:RaceAfrAm:CES11  
##                                208.52  
## Age:IPVstatus1:SexMen:RaceAfrAm:CES11  
##                                 -2.06

(st = step(mm2))
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## 
## Random effects:
##                Chi.sq Chi.DF elim.num p.value
## (1 | subclass)   0.00      1        1  1.0000
## (Age | HNDid)    4.08      1     kept  0.0433
## 
## Fixed effects:
##                                Sum Sq   Mean Sq NumDF DenDF F.value
## Age:IPVstatus:Sex:Race:CES1     4.545     4.545     1 56.07  0.0017
## Age:IPVstatus:Sex:Race        103.758   103.758     1 57.35  0.0296
## Age:IPVstatus:Race:CES1       110.399   110.399     1 58.56  0.0656
## Age:Sex:Race:CES1             600.965   600.965     1 59.47  0.1722
## Age:Sex:Race                    3.270     3.270     1 59.64  0.0314
## IPVstatus:Sex:Race:CES1       677.659   677.659     1 48.03  0.2344
## Age:IPVstatus:Race            192.506   192.506     1 61.12  0.2287
## Age:Race:CES1                 315.788   315.788     1 63.69  0.1258
## Age:Race                       87.421    87.421     1 60.83  0.1282
## Age:IPVstatus:Sex:CES1       1236.407  1236.407     1 60.71  0.7885
## Age:IPVstatus:CES1             10.282    10.282     1 61.38  0.0284
## Age:IPVstatus:Sex            2578.655  2578.655     1 63.03  0.5153
## Age:IPVstatus                  33.413    33.413     1 65.62  0.4677
## IPVstatus:Sex:CES1            505.380   505.380     1 39.54  0.4955
## IPVstatus:Race:CES1          1985.103  1985.103     1 40.96  0.7588
## Sex:Race:CES1                3680.134  3680.134     1 45.49  0.6822
## Race:CES1                      77.165    77.165     1 46.82  0.1807
## IPVstatus:Sex:Race           4374.819  4374.819     1 46.11  1.3926
## Sex:Race                       16.975    16.975     1 47.31  0.0525
## IPVstatus:Race               2444.368  2444.368     1 49.36  0.3051
## Age:Sex:CES1                 6623.435  6623.435     1 65.05  2.8053
## Age:Sex                         6.226     6.226     1 65.13  0.0762
## Age:CES1                     1820.510  1820.510     1 67.11  0.3588
## Age                          5683.786  5683.786     1 67.29  2.3382
## IPVstatus:CES1               5577.498  5577.498     1 53.35  3.3572
## IPVstatus                      42.337    42.337     1 52.31  0.4321
## Sex                           364.240   364.240     1 53.15  0.7216
## Race                         8016.936  8016.936     1 50.67  4.8084
## CES1                          175.128   175.128     1 51.08  0.0492
## IPVstatus:Sex               21890.428 21890.428     1 52.52 12.3166
## Sex:CES1                    18159.979 18159.979     1 51.88  6.2451
##                             elim.num Pr(>F)
## Age:IPVstatus:Sex:Race:CES1        1 0.9675
## Age:IPVstatus:Sex:Race             2 0.8640
## Age:IPVstatus:Race:CES1            3 0.7988
## Age:Sex:Race:CES1                  4 0.6796
## Age:Sex:Race                       5 0.8600
## IPVstatus:Sex:Race:CES1            6 0.6305
## Age:IPVstatus:Race                 7 0.6342
## Age:Race:CES1                      8 0.7240
## Age:Race                           9 0.7215
## Age:IPVstatus:Sex:CES1            10 0.3781
## Age:IPVstatus:CES1                11 0.8667
## Age:IPVstatus:Sex                 12 0.4755
## Age:IPVstatus                     13 0.4965
## IPVstatus:Sex:CES1                14 0.4856
## IPVstatus:Race:CES1               15 0.3888
## Sex:Race:CES1                     16 0.4131
## Race:CES1                         17 0.6727
## IPVstatus:Sex:Race                18 0.2440
## Sex:Race                          19 0.8197
## IPVstatus:Race                    20 0.5832
## Age:Sex:CES1                      21 0.0988
## Age:Sex                           22 0.7834
## Age:CES1                          23 0.5512
## Age                               24 0.1309
## IPVstatus:CES1                    25 0.0725
## IPVstatus                       kept 0.5139
## Sex                             kept 0.3994
## Race                            kept 0.0329
## CES1                            kept 0.8254
## IPVstatus:Sex                   kept 0.0009
## Sex:CES1                        kept 0.0157
## 
## Least squares means:
##                        IPVstatus  Sex Race CES1 Estimate Standard Error
## IPVstatus  0                 1.0   NA   NA   NA    114.9           26.5
## IPVstatus  1                 2.0   NA   NA   NA    142.4           33.4
## Sex  Women                    NA  2.0   NA   NA    111.5           27.5
## Sex  Men                      NA  1.0   NA   NA    145.8           31.6
## Race  White                   NA   NA  2.0   NA     81.4           35.9
## Race  AfrAm                   NA   NA  1.0   NA    175.9           24.0
## CES1  0                       NA   NA   NA  1.0    124.4           28.2
## CES1  1                       NA   NA   NA  2.0    132.9           29.9
## IPVstatus:Sex  0 Women       1.0  2.0   NA   NA    170.2           35.8
## IPVstatus:Sex  1 Women       2.0  2.0   NA   NA     52.9           41.9
## IPVstatus:Sex  0 Men         1.0  1.0   NA   NA     59.6           35.5
## IPVstatus:Sex  1 Men         2.0  1.0   NA   NA    232.0           51.7
## Sex:CES1  Women 0             NA  2.0   NA  1.0     58.5           36.3
## Sex:CES1  Men 0               NA  1.0   NA  1.0    190.2           41.7
## Sex:CES1  Women 1             NA  2.0   NA  2.0    164.5           41.1
## Sex:CES1  Men 1               NA  1.0   NA  2.0    101.4           42.2
##                          DF t-value Lower CI Upper CI p-value
## IPVstatus  0           50.4    4.34    61.67      168  0.0001
## IPVstatus  1           52.5    4.27    75.46      209  0.0001
## Sex  Women             51.1    4.05    56.27      167  0.0002
## Sex  Men               52.9    4.62    82.52      209  <2e-16
## Race  White            49.4    2.27     9.29      154  0.0277
## Race  AfrAm            53.9    7.32   127.73      224  <2e-16
## CES1  0                48.5    4.42    67.77      181  0.0001
## CES1  1                52.7    4.45    72.98      193  <2e-16
## IPVstatus:Sex  0 Women 55.2    4.75    98.44      242  <2e-16
## IPVstatus:Sex  1 Women 47.6    1.26   -31.41      137  0.2133
## IPVstatus:Sex  0 Men   48.1    1.68   -11.84      131  0.1000
## IPVstatus:Sex  1 Men   56.2    4.49   128.52      336  <2e-16
## Sex:CES1  Women 0      49.1    1.61   -14.53      132  0.1139
## Sex:CES1  Men 0        47.0    4.56   106.29      274  <2e-16
## Sex:CES1  Women 1      54.3    4.01    82.22      247  0.0002
## Sex:CES1  Men 1        53.1    2.40    16.83      186  0.0197
## 
##  Differences of LSMEANS:
##                                 Estimate Standard Error     DF t-value
## IPVstatus 0-1                      -27.6          41.94   52.3   -0.66
## Sex Women-Men                      -34.3          40.39   53.1   -0.85
## Race White-AfrAm                   -94.5          43.10   50.7   -2.19
## CES1 0-1                            -8.6          38.72   51.1   -0.22
## IPVstatus:Sex  0 Women- 1 Women    117.3          55.17   50.2    2.13
## IPVstatus:Sex  0 Women- 0 Men      110.6          47.73   52.8    2.32
## IPVstatus:Sex  0 Women- 1 Men      -61.9          62.10   56.5   -1.00
## IPVstatus:Sex  1 Women- 0 Men       -6.7          54.08   48.2   -0.12
## IPVstatus:Sex  1 Women- 1 Men     -179.2          66.28   52.9   -2.70
## IPVstatus:Sex  0 Men- 1 Men       -172.4          62.31   53.9   -2.77
## Sex:CES1  Women 0- Men 0          -131.7          54.33   48.3   -2.42
## Sex:CES1  Women 0- Women 1        -106.0          54.62   53.0   -1.94
## Sex:CES1  Women 0- Men 1           -42.9          53.80   51.3   -0.80
## Sex:CES1  Men 0- Women 1            25.7          58.02   52.6    0.44
## Sex:CES1  Men 0- Men 1              88.9          55.27   49.3    1.61
## Sex:CES1  Women 1- Men 1            63.1          57.89   54.6    1.09
##                                 Lower CI Upper CI p-value
## IPVstatus 0-1                    -111.73    56.59   0.514
## Sex Women-Men                    -115.31    46.69   0.399
## Race White-AfrAm                 -181.05    -7.97   0.033
## CES1 0-1                          -86.31    69.14   0.825
## IPVstatus:Sex  0 Women- 1 Women     6.49   228.11   0.038
## IPVstatus:Sex  0 Women- 0 Men      14.82   206.30   0.025
## IPVstatus:Sex  0 Women- 1 Men    -186.27    62.51   0.323
## IPVstatus:Sex  1 Women- 0 Men    -115.45   101.98   0.901
## IPVstatus:Sex  1 Women- 1 Men    -312.12   -46.24   0.009
## IPVstatus:Sex  0 Men- 1 Men      -297.37   -47.51   0.008
## Sex:CES1  Women 0- Men 0         -240.97   -22.52   0.019
## Sex:CES1  Women 0- Women 1       -215.58     3.54   0.058
## Sex:CES1  Women 0- Men 1         -150.89    65.10   0.429
## Sex:CES1  Men 0- Women 1          -90.67   142.12   0.659
## Sex:CES1  Men 0- Men 1            -22.20   199.91   0.114
## Sex:CES1  Women 1- Men 1          -52.90   179.15   0.280
## 
## Final model:
## lme4::lmer(formula = TrailsBtestSec ~ IPVstatus + Sex + Race + 
##     CES1 + (Age | HNDid) + IPVstatus:Sex + Sex:CES1, data = IPVandCognitionDataSet2, 
##     REML = reml, contrasts = l)

Re-run the suggested Trails B final Model 2

(mm2 = lmer(TrailsBtestSec ~ IPVstatus + Sex + Race + CES1 + (Age | HNDid) + 
    (1 | subclass) + IPVstatus:Sex + Sex:CES1, data = IPVandCognitionDataSet2, 
    REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsBtestSec ~ IPVstatus + Sex + Race + CES1 + (Age | HNDid) +      (1 | subclass) + IPVstatus:Sex + Sex:CES1 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##     1572     1606     -774     1548 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 189.4        
##           Age          12.5    0.78
##  subclass (Intercept)   0.0        
##  Residual              49.2        
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##       (Intercept)         IPVstatus1             SexMen  
##              69.7             -118.0              -14.9  
##         RaceAfrAm              CES11  IPVstatus1:SexMen  
##              95.9              106.7              290.7  
##      SexMen:CES11  
##            -192.4

summary(mm2)
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: TrailsBtestSec ~ IPVstatus + Sex + Race + CES1 + (Age | HNDid) +      (1 | subclass) + IPVstatus:Sex + Sex:CES1 
##    Data: IPVandCognitionDataSet2 
## 
##      AIC      BIC   logLik deviance 
##     1572     1606     -774     1548 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  HNDid    (Intercept) 35881    189.4        
##           Age           155     12.5    0.78
##  subclass (Intercept)     0      0.0        
##  Residual              2416     49.2        
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## 
## Fixed effects:
##                   Estimate Std. Error     df t value Pr(>|t|)
## (Intercept)           69.7       45.9   59.8    1.52   0.1340
## IPVstatus1          -118.0       51.7   57.0   -2.28   0.0263
## SexMen               -14.9       49.3   55.7   -0.30   0.7634
## RaceAfrAm             95.9       40.4   57.6    2.37   0.0211
## CES11                106.7       51.3   60.0    2.08   0.0418
## IPVstatus1:SexMen    290.7       77.5   59.8    3.75   0.0004
## SexMen:CES11        -192.4       73.2   59.1   -2.63   0.0109
## 
## Correlation of Fixed Effects:
##             (Intr) IPVst1 SexMen RcAfrA CES11  IPV1:S
## IPVstatus1  -0.395                                   
## SexMen      -0.512  0.305                            
## RaceAfrAm   -0.640  0.095 -0.059                     
## CES11       -0.390 -0.224  0.322  0.063              
## IPVstts1:SM  0.182 -0.655 -0.351  0.064  0.158       
## SexMn:CES11  0.327  0.149 -0.488 -0.129 -0.706 -0.258

plot(st)

plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5 plot of chunk unnamed-chunk-5


plot(mm2)

plot of chunk unnamed-chunk-5

Fluency (Word) Regression Models

Fluency (Word) Regression Model 1

load("~/Desktop/Megan/Research/IPV and Cognition Paper/IPV R Output/IPVandCognitionDataSet2.rda")

library(lme4)
library(lmerTest)

(mm1 = lmer(formula = FluencyWord ~ (Age + IPVstatus + Sex + Race)^4 + (Age | 
    HNDid) + (1 | subclass), data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: FluencyWord ~ (Age + IPVstatus + Sex + Race)^4 + (Age | HNDid) +      (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##    774.3    833.9   -366.1    732.3 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 4.7066       
##           Age         0.0264   1.00
##  subclass (Intercept) 1.8153       
##  Residual             2.6705       
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                     (Intercept)                              Age  
##                         21.5445                          -0.3411  
##                      IPVstatus1                           SexMen  
##                          0.0857                           9.4832  
##                       RaceAfrAm                   Age:IPVstatus1  
##                         -5.8343                           0.4135  
##                      Age:SexMen                    Age:RaceAfrAm  
##                          0.7086                           0.0515  
##               IPVstatus1:SexMen             IPVstatus1:RaceAfrAm  
##                         -4.5990                           2.7355  
##                SexMen:RaceAfrAm            Age:IPVstatus1:SexMen  
##                         -5.3848                          -0.8766  
##        Age:IPVstatus1:RaceAfrAm             Age:SexMen:RaceAfrAm  
##                         -0.0880                          -0.4566  
##     IPVstatus1:SexMen:RaceAfrAm  Age:IPVstatus1:SexMen:RaceAfrAm  
##                          0.3580                           0.3453

(st = step(mm1))
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Random term (Age | HNDid) was eliminated because of having correlation +-1 or NaN
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Random term (Age + 0 | HNDid) was eliminated because of standard deviation being equal to 0
## 
## Random effects:
##                Chi.sq Chi.DF elim.num p.value
## (1 | subclass)   0.64      1        1  0.4228
## (1 | HNDid)     56.52      1     kept  <1e-07
## 
## Fixed effects:
##                         Sum Sq Mean Sq NumDF  DenDF F.value elim.num
## Age:IPVstatus:Sex:Race  1.5984  1.5984     1 107.68  0.2061        1
## Age:IPVstatus:Race      0.0530  0.0530     1 108.57  0.0204        2
## IPVstatus:Sex:Race      1.5183  1.5183     1  53.15  0.1994        3
## IPVstatus:Race          4.9799  4.9799     1  53.98  0.6803        4
## Age:Sex:Race            7.8751  7.8751     1 113.79  0.8746        5
## Age:Race                0.7672  0.7672     1 114.96  0.1805        6
## Sex:Race                4.4220  4.4220     1  54.69  0.5217        7
## Age:IPVstatus:Sex      19.9061 19.9061     1 116.18  2.9196        8
## IPVstatus:Sex           0.7636  0.7636     1  57.94  0.0906        9
## Age:IPVstatus           2.8672  2.8672     1 117.12  0.2346       10
## IPVstatus               1.1052  1.1052     1  58.87  0.0799       11
## Age:Sex                 6.7766  6.7766     1 120.47  1.0154       12
## Sex                    11.6342 11.6342     1  59.92  3.1989       13
## Age                    39.3136 39.3136     1 122.92  4.2764     kept
## Race                   96.8765 96.8765     1  59.73 11.2532     kept
##                        Pr(>F)
## Age:IPVstatus:Sex:Race 0.6508
## Age:IPVstatus:Race     0.8866
## IPVstatus:Sex:Race     0.6571
## IPVstatus:Race         0.4131
## Age:Sex:Race           0.3517
## Age:Race               0.6717
## Sex:Race               0.4732
## Age:IPVstatus:Sex      0.0902
## IPVstatus:Sex          0.7644
## Age:IPVstatus          0.6290
## IPVstatus              0.7784
## Age:Sex                0.3156
## Sex                    0.0787
## Age                    0.0407
## Race                   0.0014
## 
## Least squares means:
##             Race Estimate Standard Error   DF t-value Lower CI Upper CI
## Race  White  2.0   24.271          1.381 59.7  17.570     21.5     27.0
## Race  AfrAm  1.0   18.846          0.839 59.6  22.460     17.2     20.5
##             p-value
## Race  White  <2e-16
## Race  AfrAm  <2e-16
## 
##  Differences of LSMEANS:
##                  Estimate Standard Error   DF t-value Lower CI Upper CI
## Race White-AfrAm      5.4           1.62 59.7    3.35     2.19     8.66
##                  p-value
## Race White-AfrAm   0.001
## 
## Final model:
## lme4::lmer(formula = FluencyWord ~ Age + Race + (1 | HNDid), 
##     data = IPVandCognitionDataSet2, REML = reml, contrasts = l)

Re-run Fluency Word suggested final Model 1

(mm1 = lmer(FluencyWord ~ Age + Race + (Age | HNDid) + (1 | subclass), data = IPVandCognitionDataSet2, 
    REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: FluencyWord ~ Age + Race + (Age | HNDid) + (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##    759.4    782.1   -371.7    743.4 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 5.2687       
##           Age         0.0352   1.00
##  subclass (Intercept) 1.7340       
##  Residual             2.6939       
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
## (Intercept)          Age    RaceAfrAm  
##      23.163       -0.149       -5.356

summary(mm1)
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: FluencyWord ~ Age + Race + (Age | HNDid) + (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
## 
##      AIC      BIC   logLik deviance 
##    759.4    782.1   -371.7    743.4 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  HNDid    (Intercept) 27.75967 5.2687       
##           Age          0.00124 0.0352   1.00
##  subclass (Intercept)  3.00676 1.7340       
##  Residual              7.25685 2.6939       
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)
## (Intercept)  23.1630     1.5499 50.7000   14.95   <2e-16
## Age          -0.1492     0.0773 81.5000   -1.93   0.0571
## RaceAfrAm    -5.3561     1.5776 60.6000   -3.40   0.0012
## 
## Correlation of Fixed Effects:
##           (Intr) Age   
## Age        0.456       
## RaceAfrAm -0.771 -0.078

plot(st)

plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7


plot(mm1)

plot of chunk unnamed-chunk-7

Fluency (Word) Regression Model 2 (with CES)

load("~/Desktop/Megan/Research/IPV and Cognition Paper/IPV R Output/IPVandCognitionDataSet2.rda")

library(lme4)
library(lmerTest)

(mm2 = lmer(FluencyWord ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age | HNDid) + 
    (1 | subclass), data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: FluencyWord ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age |      HNDid) + (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##    773.2    878.1   -349.6    699.2 
## Random effects:
##  Groups   Name        Std.Dev. Corr 
##  HNDid    (Intercept) 4.18e+00      
##           Age         7.87e-03 -1.00
##  subclass (Intercept) 2.66e-06      
##  Residual             2.34e+00      
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                           (Intercept)  
##                               21.1073  
##                                   Age  
##                               -0.4225  
##                            IPVstatus1  
##                               -5.1073  
##                                SexMen  
##                                4.2704  
##                             RaceAfrAm  
##                               -5.3151  
##                                 CES11  
##                               13.4927  
##                        Age:IPVstatus1  
##                                0.5892  
##                            Age:SexMen  
##                                0.3104  
##                         Age:RaceAfrAm  
##                                0.1590  
##                             Age:CES11  
##                                0.8225  
##                     IPVstatus1:SexMen  
##                               -0.7472  
##                  IPVstatus1:RaceAfrAm  
##                               10.6360  
##                      IPVstatus1:CES11  
##                               -7.0650  
##                      SexMen:RaceAfrAm  
##                                3.2490  
##                          SexMen:CES11  
##                               -4.0704  
##                       RaceAfrAm:CES11  
##                              -13.3566  
##                 Age:IPVstatus1:SexMen  
##                               -0.5604  
##              Age:IPVstatus1:RaceAfrAm  
##                               -0.0167  
##                  Age:IPVstatus1:CES11  
##                               -0.9994  
##                  Age:SexMen:RaceAfrAm  
##                                0.2025  
##                      Age:SexMen:CES11  
##                                1.0896  
##                   Age:RaceAfrAm:CES11  
##                               -0.8428  
##           IPVstatus1:SexMen:RaceAfrAm  
##                               -3.0932  
##               IPVstatus1:SexMen:CES11  
##                               36.1195  
##            IPVstatus1:RaceAfrAm:CES11  
##                                3.2895  
##                SexMen:RaceAfrAm:CES11  
##                               -5.9985  
##       Age:IPVstatus1:SexMen:RaceAfrAm  
##                               -0.2615  
##           Age:IPVstatus1:SexMen:CES11  
##                                1.1705  
##        Age:IPVstatus1:RaceAfrAm:CES11  
##                                0.4626  
##            Age:SexMen:RaceAfrAm:CES11  
##                               -1.8691  
##     IPVstatus1:SexMen:RaceAfrAm:CES11  
##                              -29.4970  
## Age:IPVstatus1:SexMen:RaceAfrAm:CES11  
##                               -0.0153

(st = step(mm2))
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Random term (Age | HNDid) was eliminated because of having correlation +-1 or NaN
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Random term (Age + 0 | HNDid) was eliminated because of standard deviation being equal to 0 
## 
## Random term (1 | subclass) was eliminated because of standard deviation being equal to 0
## 
## Random effects:
##             Chi.sq Chi.DF elim.num p.value
## (1 | HNDid)  53.93      1     kept < 1e-07
## 
## Fixed effects:
##                              Sum Sq Mean Sq NumDF DenDF F.value elim.num
## Age:IPVstatus:Sex:Race:CES1  0.0024  0.0024     1 59.48  0.0004        1
## Age:IPVstatus:Sex:Race       0.2956  0.2956     1 61.24  0.0609        2
## Age:IPVstatus:Race:CES1      4.2967  4.2967     1 66.78  0.2627        3
## Age:IPVstatus:Race           0.0817  0.0817     1 67.41  0.0258        4
## Age:IPVstatus:Sex:CES1      28.1737 28.1737     1 85.77  2.0244        5
## Age:IPVstatus:Sex           13.3544 13.3544     1 89.33  0.0000        6
## Age:IPVstatus:CES1           0.0991  0.0991     1 89.05  0.2444        7
## Age:IPVstatus                2.7655  2.7655     1 90.75  1.9341        8
## IPVstatus:Sex:Race:CES1     16.9661 16.9661     1 52.24  3.1744        9
## IPVstatus:Sex:CES1           3.9072  3.9072     1 50.61  0.2075       10
## IPVstatus:Sex:Race          15.1421 15.1421     1 52.31  1.8721       11
## IPVstatus:Sex                0.8020  0.8020     1 51.70  2.2151       12
## IPVstatus:Race:CES1         18.8467 18.8467     1 55.71  2.6942       13
## IPVstatus:CES1               6.5805  6.5805     1 52.93  0.9125       14
## IPVstatus:Race               5.3101  5.3101     1 55.24  1.5882       15
## IPVstatus                    0.9999  0.9999     1 54.97  0.1409       16
## Age                         35.2381 35.2381     1 94.10  0.0661     kept
## Sex                         10.8191 10.8191     1 90.47  9.1604     kept
## Race                        89.0907 89.0907     1 90.47 14.6683     kept
## CES1                         0.2259  0.2259     1 90.47  3.0414     kept
## Age:Sex                      6.7866  6.7866     1 94.10  4.8247     kept
## Age:Race                     0.9934  0.9934     1 94.10  2.6959     kept
## Age:CES1                     3.2265  3.2265     1 94.10  1.5529     kept
## Sex:Race                     9.5822  9.5822     1 90.47  2.7649     kept
## Sex:CES1                     1.1223  1.1223     1 90.47  1.4572     kept
## Race:CES1                   26.7105 26.7105     1 90.47 11.3809     kept
## Age:Sex:Race                 5.1503  5.1503     1 94.10  2.3126     kept
## Age:Sex:CES1                 5.6543  5.6543     1 94.10  0.9979     kept
## Age:Race:CES1               40.3108 40.3108     1 94.10  8.5681     kept
## Sex:Race:CES1                3.9103  3.9103     1 90.47  7.2790     kept
## Age:Sex:Race:CES1           21.9428 21.9428     1 94.10  3.9511     kept
##                             Pr(>F)
## Age:IPVstatus:Sex:Race:CES1 0.9849
## Age:IPVstatus:Sex:Race      0.8058
## Age:IPVstatus:Race:CES1     0.6100
## Age:IPVstatus:Race          0.8728
## Age:IPVstatus:Sex:CES1      0.1584
## Age:IPVstatus:Sex           0.9958
## Age:IPVstatus:CES1          0.6222
## Age:IPVstatus               0.1677
## IPVstatus:Sex:Race:CES1     0.0806
## IPVstatus:Sex:CES1          0.6507
## IPVstatus:Sex:Race          0.1771
## IPVstatus:Sex               0.1427
## IPVstatus:Race:CES1         0.1063
## IPVstatus:CES1              0.3438
## IPVstatus:Race              0.2129
## IPVstatus                   0.7088
## Age                         0.7976
## Sex                         0.0032
## Race                        0.0002
## CES1                        0.0846
## Age:Sex                     0.0305
## Age:Race                    0.1039
## Age:CES1                    0.2158
## Sex:Race                    0.0998
## Sex:CES1                    0.2305
## Race:CES1                   0.0011
## Age:Sex:Race                0.1317
## Age:Sex:CES1                0.3204
## Age:Race:CES1               0.0043
## Sex:Race:CES1               0.0083
## Age:Sex:Race:CES1           0.0497
## 
## Least squares means:
##                               Sex Race CES1 Estimate Standard Error   DF
## Sex  Women                    2.0   NA   NA   20.547          1.109 56.2
## Sex  Men                      1.0   NA   NA   24.183          1.388 54.2
## Race  White                    NA  2.0   NA   25.510          1.536 54.4
## Race  AfrAm                    NA  1.0   NA   19.220          0.892 56.6
## CES1  0                        NA   NA  1.0   21.303          1.095 53.1
## CES1  1                        NA   NA  2.0   23.427          1.398 56.2
## Sex:Race  Women White         2.0  2.0   NA   22.926          1.776 55.3
## Sex:Race  Men White           1.0  2.0   NA   28.094          2.507 54.0
## Sex:Race  Women AfrAm         2.0  1.0   NA   18.168          1.326 58.0
## Sex:Race  Men AfrAm           1.0  1.0   NA   20.272          1.192 55.1
## Sex:CES1  Women 0             2.0   NA  1.0   20.119          1.409 51.6
## Sex:CES1  Men 0               1.0   NA  1.0   22.487          1.678 54.1
## Sex:CES1  Women 1             2.0   NA  2.0   20.975          1.712 59.6
## Sex:CES1  Men 1               1.0   NA  2.0   25.879          2.211 54.2
## Race:CES1  White 0             NA  2.0  1.0   22.777          1.852 52.2
## Race:CES1  AfrAm 0             NA  1.0  1.0   19.829          1.170 55.2
## Race:CES1  White 1             NA  2.0  2.0   28.243          2.451 55.7
## Race:CES1  AfrAm 1             NA  1.0  2.0   18.611          1.346 57.8
## Sex:Race:CES1  Women White 0  2.0  2.0  1.0   22.425          2.330 51.6
## Sex:Race:CES1  Men White 0    1.0  2.0  1.0   23.128          2.880 52.6
## Sex:Race:CES1  Women AfrAm 0  2.0  1.0  1.0   17.812          1.583 51.6
## Sex:Race:CES1  Men AfrAm 0    1.0  1.0  1.0   21.846          1.724 58.5
## Sex:Race:CES1  Women White 1  2.0  2.0  2.0   23.427          2.682 58.2
## Sex:Race:CES1  Men White 1    1.0  2.0  2.0   33.060          4.104 54.7
## Sex:Race:CES1  Women AfrAm 1  2.0  1.0  2.0   18.523          2.129 61.8
## Sex:Race:CES1  Men AfrAm 1    1.0  1.0  2.0   18.699          1.647 51.6
##                              t-value Lower CI Upper CI p-value
## Sex  Women                     18.54     18.3     22.8  <2e-16
## Sex  Men                       17.42     21.4     27.0  <2e-16
## Race  White                    16.61     22.4     28.6  <2e-16
## Race  AfrAm                    21.55     17.4     21.0  <2e-16
## CES1  0                        19.45     19.1     23.5  <2e-16
## CES1  1                        16.75     20.6     26.2  <2e-16
## Sex:Race  Women White          12.91     19.4     26.5  <2e-16
## Sex:Race  Men White            11.21     23.1     33.1  <2e-16
## Sex:Race  Women AfrAm          13.70     15.5     20.8  <2e-16
## Sex:Race  Men AfrAm            17.00     17.9     22.7  <2e-16
## Sex:CES1  Women 0              14.28     17.3     22.9  <2e-16
## Sex:CES1  Men 0                13.40     19.1     25.9  <2e-16
## Sex:CES1  Women 1              12.25     17.5     24.4  <2e-16
## Sex:CES1  Men 1                11.70     21.4     30.3  <2e-16
## Race:CES1  White 0             12.30     19.1     26.5  <2e-16
## Race:CES1  AfrAm 0             16.94     17.5     22.2  <2e-16
## Race:CES1  White 1             11.52     23.3     33.2  <2e-16
## Race:CES1  AfrAm 1             13.83     15.9     21.3  <2e-16
## Sex:Race:CES1  Women White 0    9.62     17.7     27.1  <2e-16
## Sex:Race:CES1  Men White 0      8.03     17.4     28.9  <2e-16
## Sex:Race:CES1  Women AfrAm 0   11.26     14.6     21.0  <2e-16
## Sex:Race:CES1  Men AfrAm 0     12.67     18.4     25.3  <2e-16
## Sex:Race:CES1  Women White 1    8.74     18.1     28.8  <2e-16
## Sex:Race:CES1  Men White 1      8.06     24.8     41.3  <2e-16
## Sex:Race:CES1  Women AfrAm 1    8.70     14.3     22.8  <2e-16
## Sex:Race:CES1  Men AfrAm 1     11.35     15.4     22.0  <2e-16
## 
##  Differences of LSMEANS:
##                                    Estimate Standard Error   DF t-value
## Sex Women-Men                          -3.6          1.776 55.0   -2.05
## Race White-AfrAm                        6.3          1.776 55.0    3.54
## CES1 0-1                               -2.1          1.776 55.0   -1.20
## Sex:Race  Women White- Men White       -5.2          3.072 54.4   -1.68
## Sex:Race  Women White- Women AfrAm      4.8          2.217 56.2    2.15
## Sex:Race  Women White- Men AfrAm        2.7          2.139 55.2    1.24
## Sex:Race  Men White- Women AfrAm        9.9          2.836 54.8    3.50
## Sex:Race  Men White- Men AfrAm          7.8          2.776 54.2    2.82
## Sex:Race  Women AfrAm- Men AfrAm       -2.1          1.784 56.6   -1.18
## Sex:CES1  Women 0- Men 0               -2.4          2.191 53.1   -1.08
## Sex:CES1  Women 0- Women 1             -0.9          2.217 56.2   -0.39
## Sex:CES1  Women 0- Men 1               -5.8          2.622 53.5   -2.20
## Sex:CES1  Men 0- Women 1                1.5          2.397 56.8    0.63
## Sex:CES1  Men 0- Men 1                 -3.4          2.776 54.2   -1.22
## Sex:CES1  Women 1- Men 1               -4.9          2.796 56.2   -1.75
## Race:CES1  White 0- AfrAm 0             2.9          2.191 53.1    1.35
## Race:CES1  White 0- White 1            -5.5          3.072 54.4   -1.78
## Race:CES1  White 0- AfrAm 1             4.2          2.290 54.1    1.82
## Race:CES1  AfrAm 0- White 1            -8.4          2.716 55.6   -3.10
## Race:CES1  AfrAm 0- AfrAm 1             1.2          1.784 56.6    0.68
## Race:CES1  White 1- AfrAm 1             9.6          2.796 56.2    3.44
##                                    Lower CI Upper CI p-value
## Sex Women-Men                        -7.196  -0.0764   0.045
## Race White-AfrAm                      2.730   9.8497   8e-04
## CES1 0-1                             -5.684   1.4356   0.237
## Sex:Race  Women White- Men White    -11.326   0.9908   0.098
## Sex:Race  Women White- Women AfrAm    0.317   9.1992   0.036
## Sex:Race  Women White- Men AfrAm     -1.634   6.9411   0.220
## Sex:Race  Men White- Women AfrAm      4.242  15.6100   9e-04
## Sex:Race  Men White- Men AfrAm        2.257  13.3863   0.007
## Sex:Race  Women AfrAm- Men AfrAm     -5.677   1.4676   0.243
## Sex:CES1  Women 0- Men 0             -6.763   2.0262   0.285
## Sex:CES1  Women 0- Women 1           -5.297   3.5846   0.701
## Sex:CES1  Women 0- Men 1            -11.018  -0.5032   0.032
## Sex:CES1  Men 0- Women 1             -3.289   6.3132   0.531
## Sex:CES1  Men 0- Men 1               -8.957   2.1728   0.227
## Sex:CES1  Women 1- Men 1            -10.506   0.6975   0.085
## Race:CES1  White 0- AfrAm 0          -1.447   7.3422   0.184
## Race:CES1  White 0- White 1         -11.625   0.6921   0.081
## Race:CES1  White 0- AfrAm 1          -0.425   8.7562   0.074
## Race:CES1  AfrAm 0- White 1         -13.856  -2.9720   0.003
## Race:CES1  AfrAm 0- AfrAm 1          -2.354   4.7903   0.497
## Race:CES1  White 1- AfrAm 1           4.031  15.2337   0.001
## 
## Final model:
## lme4::lmer(formula = FluencyWord ~ Age + Sex + Race + CES1 + 
##     (1 | HNDid) + Age:Sex + Age:Race + Age:CES1 + Sex:Race + 
##     Sex:CES1 + Race:CES1 + Age:Sex:Race + Age:Sex:CES1 + Age:Race:CES1 + 
##     Sex:Race:CES1 + Age:Sex:Race:CES1, data = IPVandCognitionDataSet2, 
##     REML = reml, contrasts = l)

Re-run FluencyWord suggested final Model 2

(mm2 = lmer(FluencyWord ~ Age + Sex + Race + CES1 + (Age | HNDid) + (1 | subclass) + 
    Age:Sex + Age:Race + Age:CES1 + Sex:Race + Sex:CES1 + Race:CES1 + Age:Sex:Race + 
    Age:Sex:CES1 + Age:Race:CES1 + Sex:Race:CES1 + Age:Sex:Race:CES1, data = IPVandCognitionDataSet2, 
    REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: FluencyWord ~ Age + Sex + Race + CES1 + (Age | HNDid) + (1 |      subclass) + Age:Sex + Age:Race + Age:CES1 + Sex:Race + Sex:CES1 +      Race:CES1 + Age:Sex:Race + Age:Sex:CES1 + Age:Race:CES1 +      Sex:Race:CES1 + Age:Sex:Race:CES1 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##    762.5    822.1   -360.3    720.5 
## Random effects:
##  Groups   Name        Std.Dev. Corr 
##  HNDid    (Intercept) 4.4640        
##           Age         0.0325   -1.00
##  subclass (Intercept) 1.0434        
##  Residual             2.4648        
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                (Intercept)                         Age  
##                     20.202                      -0.297  
##                     SexMen                   RaceAfrAm  
##                      1.674                      -3.494  
##                      CES11                  Age:SexMen  
##                      2.746                       0.113  
##              Age:RaceAfrAm                   Age:CES11  
##                      0.147                       0.223  
##           SexMen:RaceAfrAm                SexMen:CES11  
##                      4.841                      16.956  
##            RaceAfrAm:CES11        Age:SexMen:RaceAfrAm  
##                     -3.235                       0.229  
##           Age:SexMen:CES11         Age:RaceAfrAm:CES11  
##                      1.164                      -0.384  
##     SexMen:RaceAfrAm:CES11  Age:SexMen:RaceAfrAm:CES11  
##                    -23.320                      -1.527

summary(mm2)
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: FluencyWord ~ Age + Sex + Race + CES1 + (Age | HNDid) + (1 |      subclass) + Age:Sex + Age:Race + Age:CES1 + Sex:Race + Sex:CES1 +      Race:CES1 + Age:Sex:Race + Age:Sex:CES1 + Age:Race:CES1 +      Sex:Race:CES1 + Age:Sex:Race:CES1 
##    Data: IPVandCognitionDataSet2 
## 
##      AIC      BIC   logLik deviance 
##    762.5    822.1   -360.3    720.5 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  HNDid    (Intercept) 19.92707 4.4640        
##           Age          0.00105 0.0325   -1.00
##  subclass (Intercept)  1.08865 1.0434        
##  Residual              6.07533 2.4648        
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## 
## Fixed effects:
##                            Estimate Std. Error      df t value Pr(>|t|)
## (Intercept)                  20.202      2.422  25.700    8.34  8.7e-09
## Age                          -0.297      0.205 113.100   -1.45   0.1505
## SexMen                        1.674      3.951  25.500    0.42   0.6753
## RaceAfrAm                    -3.494      2.959  28.000   -1.18   0.2476
## CES11                         2.746      4.321  51.900    0.64   0.5279
## Age:SexMen                    0.113      0.306 101.400    0.37   0.7127
## Age:RaceAfrAm                 0.147      0.254 114.000    0.58   0.5641
## Age:CES11                     0.223      0.355 122.900    0.63   0.5313
## SexMen:RaceAfrAm              4.841      4.844  32.200    1.00   0.3250
## SexMen:CES11                 16.956      7.101  46.500    2.39   0.0211
## RaceAfrAm:CES11              -3.235      4.952  43.400   -0.65   0.5170
## Age:SexMen:RaceAfrAm          0.229      0.383 114.400    0.60   0.5509
## Age:SexMen:CES11              1.164      0.692 101.000    1.68   0.0956
## Age:RaceAfrAm:CES11          -0.384      0.420 110.000   -0.91   0.3624
## SexMen:RaceAfrAm:CES11      -23.320      8.029  45.600   -2.90   0.0057
## Age:SexMen:RaceAfrAm:CES11   -1.527      0.766 105.800   -1.99   0.0487
## 
## Correlation of Fixed Effects:
##             (Intr) Age    SexMen RcAfrA CES11  Ag:SxM Ag:RAA A:CES1
## Age          0.514                                                 
## SexMen      -0.613 -0.315                                          
## RaceAfrAm   -0.809 -0.415  0.498                                   
## CES11       -0.557 -0.291  0.341  0.456                            
## Age:SexMen  -0.344 -0.669  0.544  0.276  0.195                     
## Age:RcAfrAm -0.408 -0.800  0.250  0.531  0.234  0.536              
## Age:CES11   -0.295 -0.578  0.181  0.241  0.682  0.387  0.465       
## SxMn:RcAfrA  0.497  0.252 -0.812 -0.613 -0.276 -0.440 -0.324 -0.146
## SexMn:CES11  0.340  0.174 -0.543 -0.279 -0.609 -0.293 -0.140 -0.413
## RcAfA:CES11  0.490  0.252 -0.300 -0.604 -0.875 -0.168 -0.322 -0.594
## Ag:SxMn:RAA  0.272  0.531 -0.432 -0.353 -0.154 -0.797 -0.663 -0.308
## Ag:SM:CES11  0.150  0.300 -0.234 -0.122 -0.349 -0.441 -0.241 -0.515
## A:RAA:CES11  0.251  0.492 -0.154 -0.328 -0.579 -0.329 -0.613 -0.848
## SM:RAA:CES1 -0.302 -0.150  0.483  0.376  0.538  0.258  0.196  0.362
## A:SM:RAA:CE -0.136 -0.271  0.212  0.179  0.315  0.399  0.338  0.466
##             SxM:RAA SM:CES RAA:CE Ag:SM:RAA A:SM:C A:RAA: SM:RAA:
## Age                                                              
## SexMen                                                           
## RaceAfrAm                                                        
## CES11                                                            
## Age:SexMen                                                       
## Age:RcAfrAm                                                      
## Age:CES11                                                        
## SxMn:RcAfrA                                                      
## SexMn:CES11  0.441                                               
## RcAfA:CES11  0.367   0.534                                       
## Ag:SxMn:RAA  0.588   0.233  0.213                                
## Ag:SM:CES11  0.190   0.637  0.303  0.352                         
## A:RAA:CES11  0.199   0.350  0.590  0.406     0.437               
## SM:RAA:CES1 -0.596  -0.884 -0.617 -0.348    -0.561 -0.362        
## A:SM:RAA:CE -0.292  -0.574 -0.321 -0.501    -0.904 -0.550  0.613

plot(st)

plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9 plot of chunk unnamed-chunk-9


plot(mm2)

plot of chunk unnamed-chunk-9

Clock Total Regression Models

Clock Total Regression Model 1

load("~/Desktop/Megan/Research/IPV and Cognition Paper/IPV R Output/IPVandCognitionDataSet2.rda")

library(lme4)
library(lmerTest)

(mm1 = lmer(ClockTotal ~ (Age + IPVstatus + Sex + Race)^4 + (Age | HNDid) + 
    (1 | subclass), data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: ClockTotal ~ (Age + IPVstatus + Sex + Race)^4 + (Age | HNDid) +      (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##    405.8    465.3   -181.9    363.8 
## Random effects:
##  Groups   Name        Std.Dev. Corr
##  HNDid    (Intercept) 0.400        
##           Age         0.057    0.59
##  subclass (Intercept) 0.218        
##  Residual             0.880        
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                     (Intercept)                              Age  
##                         9.35798                          0.02102  
##                      IPVstatus1                           SexMen  
##                        -0.48057                         -0.82971  
##                       RaceAfrAm                   Age:IPVstatus1  
##                        -0.88554                         -0.05239  
##                      Age:SexMen                    Age:RaceAfrAm  
##                        -0.06757                         -0.02295  
##               IPVstatus1:SexMen             IPVstatus1:RaceAfrAm  
##                         1.73382                          0.61140  
##                SexMen:RaceAfrAm            Age:IPVstatus1:SexMen  
##                         1.56166                          0.15811  
##        Age:IPVstatus1:RaceAfrAm             Age:SexMen:RaceAfrAm  
##                        -0.00684                          0.08456  
##     IPVstatus1:SexMen:RaceAfrAm  Age:IPVstatus1:SexMen:RaceAfrAm  
##                        -2.46362                         -0.11757

(st = step(mm1))
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: no non-missing arguments to max; returning -Inf
## Warning: no non-missing arguments to max; returning -Inf
## 
## Random effects:
##                         Chi.sq Chi.DF elim.num p.value
## (1 | subclass)            0.00      1        1  1.0000
## (Age | HNDid)             0.11      1        2  0.7384
##       (1 | HNDid)         0.78      1        3  0.3786
##       (Age + 0 | HNDid)   9.19      1     kept  0.0024
## 
## Fixed effects:
##                        Sum Sq Mean Sq NumDF  DenDF F.value elim.num Pr(>F)
## Age:IPVstatus:Sex:Race 0.2722  0.2722     1  79.58  0.2916        1 0.5907
## Age:Sex:Race           0.0000  0.0000     1  80.63  0.0366        2 0.8488
## Age:IPVstatus:Race     0.2994  0.2994     1  71.90  0.2320        3 0.6315
## Age:Race               0.9411  0.9411     1  69.37  0.2028        4 0.6539
## Age:IPVstatus:Sex      0.7395  0.7395     1  83.15  1.3169        5 0.2544
## Age:Sex                0.0012  0.0012     1  81.27  0.0431        6 0.8360
## Age:IPVstatus          0.0315  0.0315     1  79.34  0.0630        7 0.8024
## Age                    0.0025  0.0025     1  74.66  0.2146        8 0.6445
## IPVstatus:Sex:Race     2.7757  2.7757     1 104.69  3.3260        9 0.0710
## IPVstatus:Race         0.0000  0.0000     1 104.63  0.0005       10 0.9821
## Sex:Race               0.4528  0.4528     1 104.87  0.4871       11 0.4867
## IPVstatus:Sex          1.1399  1.1399     1 113.24  1.2338       12 0.2690
## IPVstatus              0.3123  0.3123     1 114.48  0.0963       13 0.7569
## Sex                    0.8179  0.8179     1 111.70  1.3379       14 0.2499
## Race                   3.4895  3.4895     1 106.16  3.4704       15 0.0652
## 
## Least squares means:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
##  Differences of LSMEANS:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
## Final model:
## lme4::lmer(formula = ClockTotal ~ (Age + 0 | HNDid), data = IPVandCognitionDataSet2, 
##     REML = reml, contrasts = l)

Will not allow me to run Clock Total suggested final Model 1

Clock Total Regression Model 2 (with CES)

load("~/Desktop/Megan/Research/IPV and Cognition Paper/IPV R Output/IPVandCognitionDataSet2.rda")

library(lme4)
library(lmerTest)

(mm2 = lmer(ClockTotal ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age | HNDid) + 
    (1 | subclass), data = IPVandCognitionDataSet2, REML = F))
## Warning: number of observations <= rank(Z); variance-covariance matrix
## will be unidentifiable
## Linear mixed model fit by maximum likelihood ['merModLmerTest']
## Formula: ClockTotal ~ (Age + IPVstatus + Sex + Race + CES1)^5 + (Age |      HNDid) + (1 | subclass) 
##    Data: IPVandCognitionDataSet2 
##      AIC      BIC   logLik deviance 
##    415.4    520.4   -170.7    341.4 
## Random effects:
##  Groups   Name        Std.Dev. Corr 
##  HNDid    (Intercept) 3.59e-01      
##           Age         2.13e-02 -1.00
##  subclass (Intercept) 3.56e-06      
##  Residual             8.06e-01      
## Number of obs: 126, groups: HNDid, 63; subclass, 21
## Fixed Effects:
##                           (Intercept)  
##                               9.41642  
##                                   Age  
##                               0.03486  
##                            IPVstatus1  
##                              -5.41642  
##                                SexMen  
##                               0.60028  
##                             RaceAfrAm  
##                              -1.21740  
##                                 CES11  
##                               0.58358  
##                        Age:IPVstatus1  
##                              -0.53486  
##                            Age:SexMen  
##                               0.00763  
##                         Age:RaceAfrAm  
##                              -0.04693  
##                             Age:CES11  
##                              -0.03486  
##                     IPVstatus1:SexMen  
##                               5.02035  
##                  IPVstatus1:RaceAfrAm  
##                               5.35593  
##                      IPVstatus1:CES11  
##                               4.93851  
##                      SexMen:RaceAfrAm  
##                               0.39368  
##                          SexMen:CES11  
##                              -1.20028  
##                       RaceAfrAm:CES11  
##                               0.17369  
##                 Age:IPVstatus1:SexMen  
##                               0.55548  
##              Age:IPVstatus1:RaceAfrAm  
##                               0.42436  
##                  Age:IPVstatus1:CES11  
##                               0.55313  
##                  Age:SexMen:RaceAfrAm  
##                               0.04527  
##                      Age:SexMen:CES11  
##                               0.39237  
##                   Age:RaceAfrAm:CES11  
##                               0.08477  
##           IPVstatus1:SexMen:RaceAfrAm  
##                              -5.15284  
##               IPVstatus1:SexMen:CES11  
##                              -1.60910  
##            IPVstatus1:RaceAfrAm:CES11  
##                              -4.95051  
##                SexMen:RaceAfrAm:CES11  
##                               0.12016  
##       Age:IPVstatus1:SexMen:RaceAfrAm  
##                              -0.48581  
##           Age:IPVstatus1:SexMen:CES11  
##                              -0.64042  
##        Age:IPVstatus1:RaceAfrAm:CES11  
##                              -0.46341  
##            Age:SexMen:RaceAfrAm:CES11  
##                              -0.53494  
##     IPVstatus1:SexMen:RaceAfrAm:CES11  
##                               1.61897  
## Age:IPVstatus1:SexMen:RaceAfrAm:CES11  
##                               0.65588

(st = step(mm2))
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: 
##  model has been refitted with REML=TRUE 
## 
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: number of observations <= rank(Z); variance-covariance matrix will be unidentifiable
## Warning: no non-missing arguments to max; returning -Inf
## Warning: no non-missing arguments to max; returning -Inf
## 
## Random effects:
##                         Chi.sq Chi.DF elim.num p.value
## (1 | subclass)            0.00      1        1  1.0000
## (Age | HNDid)             0.18      1        2  0.6719
##       (1 | HNDid)         0.72      1        3  0.3956
##       (Age + 0 | HNDid)   9.78      1     kept  0.0018
## 
## Fixed effects:
##                             Sum Sq Mean Sq NumDF  DenDF F.value elim.num
## Age:IPVstatus:Sex:Race:CES1 0.5866  0.5866     1  78.27  0.6957        1
## Age:IPVstatus:Sex:Race      1.5806  1.5806     1  82.17  0.3955        2
## Age:IPVstatus:Race:CES1     0.5322  0.5322     1  88.89  0.6771        3
## Age:Sex:Race:CES1           0.5575  0.5575     1  88.95  0.8544        4
## Age:Sex:Race                0.0990  0.0990     1  97.62  0.5314        5
## Age:Race:CES1               0.5093  0.5093     1  95.28  1.3878        6
## IPVstatus:Sex:Race:CES1     0.8670  0.8670     1  37.72  0.8784        7
## Age:IPVstatus:Race          0.0182  0.0182     1  74.09  0.5649        8
## Age:IPVstatus:Sex:CES1      0.0055  0.0055     1  67.78  0.6975        9
## IPVstatus:Sex:CES1          0.0721  0.0721     1  36.72  0.3726       10
## Age:Race                    1.4281  1.4281     1  61.10  1.1355       11
## Sex:Race:CES1               2.6549  2.6549     1  53.96  1.3240       12
## Age:IPVstatus:CES1          0.9043  0.9043     1  72.35  2.0257       13
## Age:Sex:CES1                2.1034  2.1034     1  62.58  1.4008       14
## Age:CES1                    0.2287  0.2287     1  57.00  0.0565       15
## Age:IPVstatus:Sex           0.6362  0.6362     1  71.18  1.2393       16
## Age:IPVstatus               0.0170  0.0170     1  81.04  0.0005       17
## Age:Sex                     0.0129  0.0129     1  71.98  0.3729       18
## Age                         0.0076  0.0076     1  70.30  0.3555       19
## Sex:CES1                    1.5555  1.5555     1  80.77  1.4728       20
## IPVstatus:Sex:Race          2.1308  2.1308     1  74.75  2.4266       21
## Sex:Race                    0.8845  0.8845     1  70.60  0.1410       22
## IPVstatus:Sex               0.8511  0.8511     1  99.49  0.4861       23
## Sex                         0.8085  0.8085     1  97.50  3.1651       24
## IPVstatus:Race:CES1         3.0983  3.0983     1  99.68  3.5256       25
## IPVstatus:Race              0.0044  0.0044     1  98.45  0.0401       26
## Race:CES1                   0.2397  0.2397     1 104.19  0.1656       27
## IPVstatus:CES1              0.2126  0.2126     1 102.39  1.1486       28
## IPVstatus                   0.2545  0.2545     1 107.77  0.0040       29
## CES1                        0.2208  0.2208     1 110.72  0.6150       30
## Race                        3.6428  3.6428     1 106.16  3.4704       31
##                             Pr(>F)
## Age:IPVstatus:Sex:Race:CES1 0.4068
## Age:IPVstatus:Sex:Race      0.5312
## Age:IPVstatus:Race:CES1     0.4128
## Age:Sex:Race:CES1           0.3578
## Age:Sex:Race                0.4678
## Age:Race:CES1               0.2417
## IPVstatus:Sex:Race:CES1     0.3546
## Age:IPVstatus:Race          0.4547
## Age:IPVstatus:Sex:CES1      0.4066
## IPVstatus:Sex:CES1          0.5453
## Age:Race                    0.2908
## Sex:Race:CES1               0.2549
## Age:IPVstatus:CES1          0.1590
## Age:Sex:CES1                0.2411
## Age:CES1                    0.8130
## Age:IPVstatus:Sex           0.2694
## Age:IPVstatus               0.9826
## Age:Sex                     0.5434
## Age                         0.5529
## Sex:CES1                    0.2284
## IPVstatus:Sex:Race          0.1235
## Sex:Race                    0.7084
## IPVstatus:Sex               0.4873
## Sex                         0.0783
## IPVstatus:Race:CES1         0.0634
## IPVstatus:Race              0.8418
## Race:CES1                   0.6849
## IPVstatus:CES1              0.2864
## IPVstatus                   0.9498
## CES1                        0.4346
## Race                        0.0652
## 
## Least squares means:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
##  Differences of LSMEANS:
##      Estimate Standard Error DF t-value Lower CI Upper CI p-value
## 
## Final model:
## lme4::lmer(formula = ClockTotal ~ (Age + 0 | HNDid), data = IPVandCognitionDataSet2, 
##     REML = reml, contrasts = l)

Will not allow me to run Clock Total suggested final Model 2