Create function to test for multi-colinearity among predictor variables
Trail Making Test Part A (Model 1)
#load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/TrailsA.Rda")
#run simple model
TMTA = lmer(TrailsAtestSec~age + PhysDisorder + SocEfficacy + PovStat + Sex + Race + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=TrailsA)
#test for multicollinearity
vif.lme(TMTA)
## age PhysDisorder SocEfficacy PovStatBelow
## 45.850797166 1.512598953 1.487044804 1.064179506
## SexMen RaceAfrAm age:PhysDisorder age:SocEfficacy
## 1.005461217 1.037344818 10.044364018 22.543224143
#summary of results
summary(TMTA)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: TrailsAtestSec ~ age + PhysDisorder + SocEfficacy + PovStat +
## Sex + Race + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: TrailsA
##
## REML criterion at convergence: 35975.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.7219175 -0.2198315 -0.0990867 0.0364298 10.7993454
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 546.6644 23.38086
## Residual 1867.3972 43.21339
## Number of obs: 3391, groups: HNDid, 2198
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 3.015098e+01 6.418349e+00 3.170170e+03 4.69762
## age 8.553410e-01 6.575693e-01 3.308898e+03 1.30076
## PhysDisorder -6.097968e-02 8.809638e-02 3.193144e+03 -0.69219
## SocEfficacy 2.404583e-02 1.575744e-01 3.228338e+03 0.15260
## PovStatBelow 5.347446e+00 1.917890e+00 1.269391e+03 2.78819
## SexMen 6.684934e+00 1.835584e+00 1.187653e+03 3.64186
## RaceAfrAm 8.958583e+00 1.872007e+00 1.167584e+03 4.78555
## age:PhysDisorder -1.314163e-02 9.441612e-03 3.271591e+03 -1.39188
## age:SocEfficacy 1.362910e-03 1.662001e-02 3.289070e+03 0.08200
## Pr(>|t|)
## (Intercept) 2.7440e-06
## age 0.19343058
## PhysDisorder 0.48886663
## SocEfficacy 0.87872335
## PovStatBelow 0.00537942
## SexMen 0.00028234
## RaceAfrAm 1.9234e-06
## age:PhysDisorder 0.16405222
## age:SocEfficacy 0.93464841
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB SexMen RcAfrA ag:PhD
## age 0.026
## PhysDisordr -0.788 -0.023
## SocEfficacy -0.900 -0.015 0.557
## PovStatBelw -0.088 -0.024 -0.102 0.058
## SexMen -0.103 -0.042 -0.028 -0.015 0.055
## RaceAfrAm -0.196 0.015 0.094 0.009 -0.167 -0.017
## ag:PhysDsrd -0.032 -0.817 0.051 0.015 0.031 0.028 -0.009
## ag:ScEffccy -0.019 -0.923 0.010 0.006 0.027 0.044 -0.011 0.568
Trail Making Test Part B (Model 1)
#load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/TrailsB.Rda")
#Run regression model
TMTB = lmer(TrailsBtestSec~age + PhysDisorder + SocEfficacy + PovStat + Sex + Race + (1|HNDid) + age*PhysDisorder + age*SocEfficacy,data=TrailsB)
#test for multicollinearity
vif.lme(TMTB)
## age PhysDisorder SocEfficacy PovStatBelow
## 34.102194688 1.431238086 1.411183362 1.053654189
## SexMen RaceAfrAm age:PhysDisorder age:SocEfficacy
## 1.004652366 1.033188947 7.919417487 17.073424634
#Summary of results
summary(TMTB)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: TrailsBtestSec ~ age + PhysDisorder + SocEfficacy + PovStat +
## Sex + Race + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: TrailsB
##
## REML criterion at convergence: 43205.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5536170 -0.3029775 -0.1447527 0.0516146 3.4448231
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 15320.452 123.77581
## Residual 9234.763 96.09768
## Number of obs: 3384, groups: HNDid, 2194
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 116.43044664 18.78380842 3165.47800000 6.19845
## age 6.15675143 1.88516563 2925.79800000 3.26589
## PhysDisorder 0.15662074 0.25679431 3093.60300000 0.60991
## SocEfficacy -0.81250529 0.45607352 3004.16500000 -1.78152
## PovStatBelow 39.09279713 6.63410474 2109.58500000 5.89270
## SexMen 8.66446529 6.39804423 2045.75200000 1.35424
## RaceAfrAm 65.75730335 6.53196492 2037.14800000 10.06700
## age:PhysDisorder -0.02166110 0.02727178 3016.72900000 -0.79427
## age:SocEfficacy -0.08800875 0.04765159 2904.46300000 -1.84692
## Pr(>|t|)
## (Intercept) 6.4397e-10
## age 0.0011038
## PhysDisorder 0.5419680
## SocEfficacy 0.0749281
## PovStatBelow 4.4116e-09
## SexMen 0.1758105
## RaceAfrAm < 2.22e-16
## age:PhysDisorder 0.4271018
## age:SocEfficacy 0.0648602
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB SexMen RcAfrA ag:PhD
## age 0.027
## PhysDisordr -0.763 -0.022
## SocEfficacy -0.880 -0.019 0.528
## PovStatBelw -0.113 -0.018 -0.084 0.056
## SexMen -0.125 -0.035 -0.028 -0.019 0.051
## RaceAfrAm -0.221 0.015 0.078 0.008 -0.163 -0.011
## ag:PhysDsrd -0.037 -0.805 0.058 0.019 0.025 0.022 -0.005
## ag:ScEffccy -0.022 -0.915 0.006 0.013 0.022 0.037 -0.011 0.545
Attention (Model 1)
#load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/Attention.Rda")
#Run regression model
Attn = lmer(Attention~age + PhysDisorder + SocEfficacy + PovStat + Sex + Race + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=Attention)
#test for multicollinearity
vif.lme(Attn)
## age PhysDisorder SocEfficacy PovStatBelow
## 38.567246949 1.469081562 1.450257925 1.059009257
## SexMen RaceAfrAm age:PhysDisorder age:SocEfficacy
## 1.005676954 1.030394105 8.643393463 19.294930942
#Summary of results
summary(Attn)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: Attention ~ age + PhysDisorder + SocEfficacy + PovStat + Sex +
## Race + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: Attention
##
## REML criterion at convergence: 12446.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.87636196 -0.51891700 0.02070282 0.56720014 2.45127050
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 2.269637 1.506532
## Residual 2.008416 1.417186
## Number of obs: 2959, groups: HNDid, 2022
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 7.055092e+00 2.769209e-01 2.904986e+03 25.47692
## age -1.370365e-01 2.794155e-02 2.801934e+03 -4.90440
## PhysDisorder -5.775654e-03 3.786581e-03 2.884538e+03 -1.52530
## SocEfficacy 1.661145e-02 6.741546e-03 2.855370e+03 2.46404
## PovStatBelow -4.482290e-01 9.069527e-02 2.001025e+03 -4.94214
## SexMen -2.712405e-01 8.745370e-02 1.952605e+03 -3.10153
## RaceAfrAm -8.274170e-01 8.882093e-02 1.937610e+03 -9.31556
## age:PhysDisorder 1.289727e-03 3.993822e-04 2.836809e+03 3.22930
## age:SocEfficacy 2.540957e-03 7.074541e-04 2.806433e+03 3.59169
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 9.9065e-07
## PhysDisorder 0.12729508
## SocEfficacy 0.01379653
## PovStatBelow 8.3696e-07
## SexMen 0.00195274
## RaceAfrAm < 2.22e-16
## age:PhysDisorder 0.00125508
## age:SocEfficacy 0.00033418
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB SexMen RcAfrA ag:PhD
## age 0.024
## PhysDisordr -0.774 -0.023
## SocEfficacy -0.891 -0.015 0.544
## PovStatBelw -0.108 -0.012 -0.092 0.060
## SexMen -0.117 -0.042 -0.021 -0.016 0.056
## RaceAfrAm -0.207 0.011 0.075 0.013 -0.155 -0.017
## ag:PhysDsrd -0.033 -0.808 0.049 0.020 0.019 0.025 -0.004
## ag:ScEffccy -0.021 -0.919 0.014 0.007 0.021 0.045 -0.007 0.553
Plot for Age*PhysDisorder for Attention
## [1] 30.51605272
## [1] 12.07679097
## [1] 18.43926175
## [1] 42.59284369
Plot for Age*SocEfficacy for Attention
## [1] 26.95876985
## [1] 6.70207727
## [1] 20.25669258
## [1] 33.66084712
Benton Visual Retention Test (Model 1)
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/BVRtot.Rda")
#Run regression model
BVR = lmer(BVRtot~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=BVRtot)
#test for multicollinearity
vif.lme(BVR)
## age PhysDisorder SocEfficacy PovStatBelow
## 37.258309608 1.453673613 1.432901843 1.056840496
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.034026305 1.005354474 8.449109060 18.608745214
#Summary of results
summary(BVR)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: BVRtot ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: BVRtot
##
## REML criterion at convergence: 20322.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.2573331 -0.4791171 -0.0430963 0.4531240 3.6720257
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 12.53567 3.540575
## Residual 11.31746 3.364144
## Number of obs: 3439, groups: HNDid, 2236
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 7.604207e+00 6.021804e-01 3.374363e+03 12.62779
## age 2.893813e-01 6.106512e-02 3.228035e+03 4.73890
## PhysDisorder -1.220250e-02 8.242994e-03 3.351392e+03 -1.48035
## SocEfficacy -3.043975e-02 1.472867e-02 3.290243e+03 -2.06670
## PovStatBelow 1.089723e+00 2.013424e-01 2.113370e+03 5.41229
## RaceAfrAm 1.065892e+00 1.980564e-01 2.026691e+03 5.38176
## SexMen -8.597545e-01 1.939287e-01 2.042077e+03 -4.43335
## age:PhysDisorder -1.578076e-03 8.770024e-04 3.292764e+03 -1.79940
## age:SocEfficacy -2.336734e-03 1.549197e-03 3.206522e+03 -1.50835
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 2.2417e-06
## PhysDisorder 0.138874
## SocEfficacy 0.038840
## PovStatBelow 6.9278e-08
## RaceAfrAm 8.2298e-08
## SexMen 9.7701e-06
## age:PhysDisorder 0.072047
## age:SocEfficacy 0.131563
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.030
## PhysDisordr -0.769 -0.021
## SocEfficacy -0.887 -0.021 0.536
## PovStatBelw -0.108 -0.023 -0.089 0.060
## RaceAfrAm -0.212 0.016 0.084 0.006 -0.163
## SexMen -0.111 -0.037 -0.036 -0.023 0.053 -0.013
## ag:PhysDsrd -0.035 -0.808 0.055 0.017 0.032 -0.010 0.023
## ag:ScEffccy -0.024 -0.918 0.005 0.015 0.026 -0.011 0.038 0.552
Plot for Social Efficacy for BVRT
## Warning: executing %dopar% sequentially: no parallel backend registered
Digit Span Foward (Model 1)
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/DigitSpanFwd.Rda")
#Run regression model
DSF = lmer(DigitSpanFwd~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=DigitSpanFwd)
#test for multicollinearity
vif.lme(DSF)
## age PhysDisorder SocEfficacy PovStatBelow
## 36.220655344 1.445543484 1.425505507 1.056728998
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.033572549 1.005102342 8.233562781 18.155712736
#Summary of results
summary(DSF)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula:
## DigitSpanFwd ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: DigitSpanFwd
##
## REML criterion at convergence: 15100
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.3048091 -0.4005550 -0.0444434 0.4392415 3.8412372
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 3.362655 1.833754
## Residual 2.589816 1.609291
## Number of obs: 3349, groups: HNDid, 2219
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 7.123556e+00 3.012245e-01 3.258340e+03 23.64866
## age -7.625157e-02 3.028402e-02 3.115430e+03 -2.51788
## PhysDisorder -3.936290e-03 4.111009e-03 3.235071e+03 -0.95750
## SocEfficacy 1.734175e-02 7.355116e-03 3.158981e+03 2.35778
## PovStatBelow -4.226295e-01 1.021103e-01 2.197012e+03 -4.13895
## RaceAfrAm -6.210216e-01 1.005429e-01 2.122261e+03 -6.17668
## SexMen 1.645577e-01 9.834687e-02 2.137036e+03 1.67324
## age:PhysDisorder 9.812924e-04 4.349348e-04 3.183197e+03 2.25618
## age:SocEfficacy 1.146891e-03 7.693008e-04 3.077371e+03 1.49082
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 0.011856
## PhysDisorder 0.338387
## SocEfficacy 0.018445
## PovStatBelow 3.6206e-05
## RaceAfrAm 7.8235e-10
## SexMen 0.094427
## age:PhysDisorder 0.024127
## age:SocEfficacy 0.136111
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.027
## PhysDisordr -0.766 -0.018
## SocEfficacy -0.885 -0.019 0.533
## PovStatBelw -0.108 -0.021 -0.089 0.058
## RaceAfrAm -0.218 0.017 0.084 0.011 -0.162
## SexMen -0.115 -0.038 -0.031 -0.021 0.052 -0.016
## ag:PhysDsrd -0.031 -0.806 0.052 0.012 0.030 -0.012 0.026
## ag:ScEffccy -0.022 -0.918 0.002 0.015 0.024 -0.012 0.039 0.551
Plot for Age*PhysDisorder for Digit Span Forward
## [1] 30.51605272
## [1] 12.07679097
## [1] 18.43926175
## [1] 42.59284369
Plot for SocEfficacy for Digit Span Forward
Digit Span Backward (Model 1)
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/DigitSpanBck.Rda")
#Run regression model
DSB = lmer(DigitSpanBck~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=DigitSpanBck)
#Test for multicolinearity
vif.lme(DSB)
## age PhysDisorder SocEfficacy PovStatBelow
## 35.103062756 1.437461767 1.417769447 1.055466245
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.032892527 1.005014067 8.041760846 17.615646118
#Summary of results
summary(DSB)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula:
## DigitSpanBck ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: DigitSpanBck
##
## REML criterion at convergence: 14562.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.4282214 -0.4377051 -0.0165590 0.4207092 3.4506036
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 3.098138 1.760153
## Residual 2.097210 1.448175
## Number of obs: 3344, groups: HNDid, 2218
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 6.423648e+00 2.779924e-01 3.207916e+03 23.10728
## age -3.910742e-02 2.787200e-02 3.027264e+03 -1.40311
## PhysDisorder -1.106016e-02 3.796765e-03 3.174220e+03 -2.91305
## SocEfficacy 2.400009e-03 6.774696e-03 3.075786e+03 0.35426
## PovStatBelow -4.747959e-01 9.591312e-02 2.181086e+03 -4.95027
## RaceAfrAm -1.026206e+00 9.449419e-02 2.107586e+03 -10.85999
## SexMen -3.231504e-02 9.242585e-02 2.121633e+03 -0.34963
## age:PhysDisorder 3.811007e-04 4.009122e-04 3.108771e+03 0.95058
## age:SocEfficacy 3.493200e-04 7.076784e-04 2.978552e+03 0.49361
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 0.1606872
## PhysDisorder 0.0036042
## SocEfficacy 0.7231678
## PovStatBelow 7.9788e-07
## RaceAfrAm < 2.22e-16
## SexMen 0.7266496
## age:PhysDisorder 0.3418895
## age:SocEfficacy 0.6216151
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.027
## PhysDisordr -0.763 -0.017
## SocEfficacy -0.883 -0.019 0.529
## PovStatBelw -0.110 -0.020 -0.088 0.058
## RaceAfrAm -0.221 0.017 0.082 0.011 -0.161
## SexMen -0.118 -0.038 -0.031 -0.021 0.052 -0.017
## ag:PhysDsrd -0.031 -0.805 0.053 0.012 0.029 -0.012 0.026
## ag:ScEffccy -0.022 -0.917 0.001 0.016 0.024 -0.011 0.038 0.548
Plot for Physical Disorder for Digit Span Backward
California Verbal Learning Test: Total Correct for Trial A (Model 1)
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/CVLtca.Rda")
#Run regression model
CVLA = lmer(CVLtca~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=CVLtca)
#Test for multicolinearity
vif.lme(CVLA)
## age PhysDisorder SocEfficacy PovStatBelow
## 48.512267192 1.523615431 1.491035728 1.070949283
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.040645552 1.008012013 11.011603872 23.336546138
#Summary of results
summary(CVLA)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: CVLtca ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: CVLtca
##
## REML criterion at convergence: 21383.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9273007 -0.7561861 -0.3719024 0.7333248 3.0643924
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 1.857922e-13 4.310362e-07
## Residual 6.629633e+01 8.142256e+00
## Number of obs: 3036, groups: HNDid, 2056
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.472404e+01 1.093028e+00 3.026988e+03 13.47087
## age -1.037774e-01 1.123927e-01 3.026988e+03 -0.92335
## PhysDisorder -3.294249e-02 1.520110e-02 3.026988e+03 -2.16711
## SocEfficacy 3.023643e-02 2.687090e-02 3.026988e+03 1.12525
## PovStatBelow -1.241623e+00 3.130640e-01 3.026988e+03 -3.96604
## RaceAfrAm -2.244463e+00 3.063030e-01 3.026988e+03 -7.32759
## SexMen -1.814929e+00 3.000710e-01 3.026988e+03 -6.04833
## age:PhysDisorder 2.620352e-03 1.622315e-03 3.026988e+03 1.61519
## age:SocEfficacy 2.578223e-03 2.845865e-03 3.026988e+03 0.90595
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 0.355900
## PhysDisorder 0.030304
## SocEfficacy 0.260573
## PovStatBelow 7.4771e-05
## RaceAfrAm 2.9909e-13
## SexMen 1.6429e-09
## age:PhysDisorder 0.106373
## age:SocEfficacy 0.365032
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.018
## PhysDisordr -0.796 -0.016
## SocEfficacy -0.897 -0.004 0.556
## PovStatBelw -0.075 -0.041 -0.119 0.051
## RaceAfrAm -0.186 0.015 0.103 -0.005 -0.165
## SexMen -0.101 -0.054 -0.026 -0.014 0.065 -0.018
## ag:PhysDsrd -0.025 -0.818 0.038 0.015 0.041 -0.015 0.032
## ag:ScEffccy -0.013 -0.919 0.009 -0.010 0.045 -0.004 0.060 0.558
Plot for Physical Disorder for CVLT Total Correct Trial A
California Verbal Learning Test: Total Correct for Trial B (Model 1)
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/CVLtcb.Rda")
#Run regression model
CVLB = lmer(CVLtcb~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=CVLtcb)
#Test for multicolinearity
vif.lme(CVLB)
## age PhysDisorder SocEfficacy PovStatBelow
## 44.419621908 1.504683409 1.475459780 1.066683318
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.039958114 1.007726611 10.172393196 21.561892478
#Summary of results
summary(CVLB)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: CVLtcb ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: CVLtcb
##
## REML criterion at convergence: 12882
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.4956734 -0.6492839 -0.0275477 0.5926036 3.3433604
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 0.9426052 0.9708786
## Residual 3.2673459 1.8075801
## Number of obs: 3011, groups: HNDid, 2045
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 4.562658e+00 2.807946e-01 2.917916e+03 16.24909
## age -8.198617e-02 2.861669e-02 2.986039e+03 -2.86498
## PhysDisorder 6.722686e-03 3.893799e-03 2.953598e+03 1.72651
## SocEfficacy 2.062298e-02 6.881302e-03 2.943012e+03 2.99696
## PovStatBelow -3.882463e-01 8.410809e-02 1.919867e+03 -4.61604
## RaceAfrAm -5.287997e-01 8.259034e-02 1.854360e+03 -6.40268
## SexMen -6.305146e-01 8.083841e-02 1.875114e+03 -7.79969
## age:PhysDisorder 4.900730e-04 4.128050e-04 2.982426e+03 1.18718
## age:SocEfficacy 8.082962e-04 7.253723e-04 2.978800e+03 1.11432
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 0.0041995
## PhysDisorder 0.0843601
## SocEfficacy 0.0027497
## PovStatBelow 4.1703e-06
## RaceAfrAm 1.9294e-10
## SexMen 1.0214e-14
## age:PhysDisorder 0.2352520
## age:SocEfficacy 0.2652322
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.022
## PhysDisordr -0.791 -0.018
## SocEfficacy -0.893 -0.010 0.551
## PovStatBelw -0.084 -0.038 -0.109 0.052
## RaceAfrAm -0.195 0.016 0.100 -0.001 -0.166
## SexMen -0.103 -0.052 -0.027 -0.019 0.063 -0.014
## ag:PhysDsrd -0.028 -0.814 0.041 0.018 0.037 -0.013 0.028
## ag:ScEffccy -0.019 -0.917 0.011 -0.003 0.045 -0.006 0.058 0.552
Plot for Social Efficacy for CVLT Total Correct Trial B
California Verbal Learning Test: Learning Slope (Model 1)
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/CVLbet.Rda")
#Run regression model
CVLslope = lmer(CVLbet~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=CVLbet)
#Test for multicolinearity
vif.lme(CVLslope)
## age PhysDisorder SocEfficacy PovStatBelow
## 46.124597464 1.510973074 1.481643245 1.067903756
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.039708155 1.007945865 10.509798980 22.342442519
#Summary of results
summary(CVLslope)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: CVLbet ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: CVLbet
##
## REML criterion at convergence: 9383.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.7530665 -0.6104636 0.0217767 0.5982302 3.3498340
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 0.1656172 0.406961
## Residual 1.1063675 1.051840
## Number of obs: 3031, groups: HNDid, 2054
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.704344e+00 1.533721e-01 2.865724e+03 11.11247
## age -3.309044e-02 1.570269e-02 2.950863e+03 -2.10731
## PhysDisorder 5.955793e-04 2.129225e-03 2.913964e+03 0.27972
## SocEfficacy 8.013930e-03 3.766172e-03 2.894385e+03 2.12787
## PovStatBelow -7.770656e-02 4.502464e-02 1.966889e+03 -1.72587
## RaceAfrAm -1.288572e-01 4.415531e-02 1.899057e+03 -2.91827
## SexMen -2.512015e-01 4.323723e-02 1.917597e+03 -5.80984
## age:PhysDisorder 3.452137e-04 2.267550e-04 2.952630e+03 1.52241
## age:SocEfficacy 3.401833e-04 3.980851e-04 2.935900e+03 0.85455
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 0.0351749
## PhysDisorder 0.7797149
## SocEfficacy 0.0334320
## PovStatBelow 0.0845283
## RaceAfrAm 0.0035612
## SexMen 7.3048e-09
## age:PhysDisorder 0.1280139
## age:SocEfficacy 0.3928705
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.021
## PhysDisordr -0.793 -0.018
## SocEfficacy -0.895 -0.007 0.553
## PovStatBelw -0.081 -0.038 -0.113 0.052
## RaceAfrAm -0.190 0.014 0.100 -0.004 -0.165
## SexMen -0.103 -0.053 -0.026 -0.017 0.064 -0.016
## ag:PhysDsrd -0.027 -0.815 0.039 0.017 0.037 -0.014 0.030
## ag:ScEffccy -0.016 -0.918 0.011 -0.007 0.044 -0.003 0.060 0.553
Plot for Social Efficacy for CVLT Learning Slope
Mini Mental Satus Exam
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/MMStot.Rda")
#Run regression model
MMSE = lmer(MMStot~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=MMStot)
#Test for multicolinearity
vif.lme(MMSE)
## age PhysDisorder SocEfficacy PovStatBelow
## 34.800908177 1.444726969 1.425853723 1.052708095
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.032136704 1.005846537 8.053361093 17.377701443
#Summary of results
summary(MMSE)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: MMStot ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: MMStot
##
## REML criterion at convergence: 13706.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.4410653 -0.3305784 0.1084605 0.4686804 2.9798212
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 2.627843 1.621062
## Residual 1.640825 1.280947
## Number of obs: 3306, groups: HNDid, 2188
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 2.827167e+01 2.525037e-01 3.094613e+03 111.96541
## age -9.299712e-02 2.533707e-02 2.795303e+03 -3.67040
## PhysDisorder -3.453869e-04 3.446549e-03 3.034922e+03 -0.10021
## SocEfficacy 7.607589e-03 6.168252e-03 2.906207e+03 1.23335
## PovStatBelow -6.182256e-01 8.776419e-02 1.920161e+03 -7.04417
## RaceAfrAm -6.633849e-01 8.629252e-02 1.844639e+03 -7.68763
## SexMen -3.934396e-01 8.466371e-02 1.858323e+03 -4.64709
## age:PhysDisorder 7.015268e-04 3.653568e-04 2.930518e+03 1.92011
## age:SocEfficacy 1.675280e-03 6.412666e-04 2.737644e+03 2.61245
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 0.0002467
## PhysDisorder 0.9201823
## SocEfficacy 0.2175465
## PovStatBelow 2.5895e-12
## RaceAfrAm 2.4203e-14
## SexMen 3.6032e-06
## age:PhysDisorder 0.0549404
## age:SocEfficacy 0.0090386
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.038
## PhysDisordr -0.766 -0.027
## SocEfficacy -0.882 -0.031 0.533
## PovStatBelw -0.115 -0.017 -0.081 0.058
## RaceAfrAm -0.213 0.016 0.077 0.002 -0.157
## SexMen -0.114 -0.034 -0.037 -0.027 0.057 -0.013
## ag:PhysDsrd -0.042 -0.806 0.064 0.023 0.025 -0.009 0.021
## ag:ScEffccy -0.033 -0.916 0.009 0.026 0.021 -0.009 0.037 0.548
Plot for Age*SocEfficacy for Mini-Mental Status Exam
## [1] 26.82335148
## [1] 6.648986984
## [1] 20.1743645
## [1] 33.47233846
Verbal Fluency
#Load data file
load(file="/Users/meganwilliams/Desktop/Neighborhood and Cognitive Function/Data/FluencyWord.Rda")
#Run regression model
Fluency = lmer(FluencyWord~age + PhysDisorder + SocEfficacy + PovStat + Race + Sex + (1|HNDid) + age*PhysDisorder + age*SocEfficacy, data=FluencyWord)
#Test for multicolinearity
vif.lme(Fluency)
## age PhysDisorder SocEfficacy PovStatBelow
## 32.415587400 1.424299973 1.407032679 1.052629504
## RaceAfrAm SexMen age:PhysDisorder age:SocEfficacy
## 1.033898651 1.005135605 7.530431850 16.357523977
#Summary of results
summary(Fluency)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula:
## FluencyWord ~ age + PhysDisorder + SocEfficacy + PovStat + Race +
## Sex + (1 | HNDid) + age * PhysDisorder + age * SocEfficacy
## Data: FluencyWord
##
## REML criterion at convergence: 20263
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.3878068 -0.4983373 -0.0137283 0.4374900 2.7539974
##
## Random effects:
## Groups Name Variance Std.Dev.
## HNDid (Intercept) 18.003628 4.243068
## Residual 9.226262 3.037476
## Number of obs: 3404, groups: HNDid, 2207
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 2.030198e+01 6.107737e-01 3.154784e+03 33.23977
## age 3.188970e-02 6.090196e-02 2.878099e+03 0.52362
## PhysDisorder -3.504874e-03 8.307218e-03 3.052914e+03 -0.42191
## SocEfficacy -2.195426e-03 1.481048e-02 2.970202e+03 -0.14823
## PovStatBelow -1.159377e+00 2.216842e-01 2.229980e+03 -5.22986
## RaceAfrAm -1.817286e+00 2.184030e-01 2.167199e+03 -8.32079
## SexMen 8.021248e-01 2.138044e-01 2.171459e+03 3.75168
## age:PhysDisorder -8.059685e-04 8.763113e-04 2.941000e+03 -0.91973
## age:SocEfficacy -2.618956e-03 1.542578e-03 2.856802e+03 -1.69778
## Pr(>|t|)
## (Intercept) < 2.22e-16
## age 0.60058071
## PhysDisorder 0.67312254
## SocEfficacy 0.88216766
## PovStatBelow 1.8547e-07
## RaceAfrAm < 2.22e-16
## SexMen 0.00018026
## age:PhysDisorder 0.35779009
## age:SocEfficacy 0.08965838
##
## Correlation of Fixed Effects:
## (Intr) age PhysDs ScEffc PvSttB RcAfrA SexMen ag:PhD
## age 0.022
## PhysDisordr -0.759 -0.012
## SocEfficacy -0.877 -0.018 0.526
## PovStatBelw -0.119 -0.018 -0.078 0.057
## RaceAfrAm -0.224 0.016 0.077 0.007 -0.164
## SexMen -0.129 -0.035 -0.029 -0.020 0.056 -0.015
## ag:PhysDsrd -0.030 -0.803 0.049 0.014 0.026 -0.007 0.023
## ag:ScEffccy -0.019 -0.915 -0.002 0.014 0.022 -0.011 0.036 0.544