Load some libraries. You may not have these installed. If the library command gives an error then install the packages with this command:

install.packages('lme4')
install.packages('multcomp')

zStat and zUtil are my private packages so I'll need to provide them to you.

library(lme4)
library(multcomp)
library(zStat)
library(zUtil)

Get the data.

load(url('http://handls.nih.gov/zrdata/AK-2014-07-01.rdata'))

Perform longitudinal analyses on the attention test with covariates age, sex, poverty status, race, and NEO Openness. merAttention.1 has all the interactions (5-way); .2 has interactions up to 4-way; etc.

You may ignore the warning message if one is generated.

merAttention.1 = lmer(Attention ~ (Age + Sex + PovStat + Race + NEOO)^5 + (Age|HNDid), data=narNeu, control=lmerControl(check.nobs.vs.nRE = "warning"))
merAttention.2 = lmer(Attention ~ (Age + Sex + PovStat + Race + NEOO)^4 + (Age|HNDid), data=narNeu, control=lmerControl(check.nobs.vs.nRE = "warning"))
merAttention.3 = lmer(Attention ~ (Age + Sex + PovStat + Race + NEOO)^3 + (Age|HNDid), data=narNeu, control=lmerControl(check.nobs.vs.nRE = "warning"))
merAttention.4 = lmer(Attention ~ (Age + Sex + PovStat + Race + NEOO)^2 + (Age|HNDid), data=narNeu, control=lmerControl(check.nobs.vs.nRE = "warning"))
merAttention.5 = lmer(Attention ~  Age + Sex + PovStat + Race + NEOO    + (Age|HNDid), data=narNeu, control=lmerControl(check.nobs.vs.nRE = "warning"))

Print the results with cftest because it displays a concise table with p-values. Each analysis is one step in the backward elimination. The 5-way interaction is nonsignificant in merAttention.1, and none of the other interactions are significant in the other analyses as we eliminate interaction terms sequentially. This leaves just the main effects for age, sex, poverty status, race, and NEO Openness in merAttention.5.

cftest(merAttention.1)

     Simultaneous Tests for General Linear Hypotheses

Fit: lmer(formula = Attention ~ (Age + Sex + PovStat + Race + NEOO)^5 + 
    (Age | HNDid), data = narNeu, control = lmerControl(check.nobs.vs.nRE = "warning"))

Linear Hypotheses:
                                             Estimate Std. Error z value Pr(>|z|)
(Intercept) == 0                             7.14e+00   5.69e+00    1.25   0.2101
Age == 0                                    -2.88e-02   1.04e-01   -0.28   0.7824
SexMen == 0                                 -4.03e+00   8.80e+00   -0.46   0.6468
PovStatBelow == 0                            8.99e+00   1.40e+01    0.64   0.5196
RaceAfrAm == 0                               2.02e+01   1.50e+01    1.35   0.1782
NEOO == 0                                    2.62e-02   4.77e-02    0.55   0.5832
Age:SexMen == 0                              8.28e-02   1.59e-01    0.52   0.6016
Age:PovStatBelow == 0                       -1.51e-01   2.60e-01   -0.58   0.5619
Age:RaceAfrAm == 0                          -4.08e-01   2.87e-01   -1.42   0.1550
Age:NEOO == 0                               -1.72e-04   8.80e-04   -0.20   0.8454
SexMen:PovStatBelow == 0                    -7.15e+00   2.52e+01   -0.28   0.7769
SexMen:RaceAfrAm == 0                       -2.26e+01   2.38e+01   -0.95   0.3424
SexMen:NEOO == 0                             8.62e-03   7.32e-02    0.12   0.9063
PovStatBelow:RaceAfrAm == 0                 -5.36e+01   2.14e+01   -2.51   0.0120
PovStatBelow:NEOO == 0                      -8.74e-02   1.26e-01   -0.69   0.4883
RaceAfrAm:NEOO == 0                         -2.11e-01   1.30e-01   -1.63   0.1026
Age:SexMen:PovStatBelow == 0                 1.32e-01   4.72e-01    0.28   0.7794
Age:SexMen:RaceAfrAm == 0                    5.17e-01   4.49e-01    1.15   0.2500
Age:SexMen:NEOO == 0                        -2.78e-04   1.33e-03   -0.21   0.8351
Age:PovStatBelow:RaceAfrAm == 0              9.56e-01   4.06e-01    2.36   0.0185
Age:PovStatBelow:NEOO == 0                   1.31e-03   2.35e-03    0.56   0.5780
Age:RaceAfrAm:NEOO == 0                      4.05e-03   2.48e-03    1.63   0.1027
SexMen:PovStatBelow:RaceAfrAm == 0           5.62e+01   3.66e+01    1.53   0.1251
SexMen:PovStatBelow:NEOO == 0                1.03e-01   2.30e-01    0.45   0.6547
SexMen:RaceAfrAm:NEOO == 0                   2.39e-01   2.04e-01    1.17   0.2411
PovStatBelow:RaceAfrAm:NEOO == 0             4.99e-01   1.90e-01    2.63   0.0086
Age:SexMen:PovStatBelow:RaceAfrAm == 0      -1.11e+00   6.89e-01   -1.61   0.1068
Age:SexMen:PovStatBelow:NEOO == 0           -1.85e-03   4.30e-03   -0.43   0.6667
Age:SexMen:RaceAfrAm:NEOO == 0              -5.31e-03   3.88e-03   -1.37   0.1710
Age:PovStatBelow:RaceAfrAm:NEOO == 0        -8.87e-03   3.61e-03   -2.46   0.0140
SexMen:PovStatBelow:RaceAfrAm:NEOO == 0     -5.71e-01   3.26e-01   -1.75   0.0800
Age:SexMen:PovStatBelow:RaceAfrAm:NEOO == 0  1.12e-02   6.15e-03    1.83   0.0675
(Univariate p values reported)
cftest(merAttention.2)

     Simultaneous Tests for General Linear Hypotheses

Fit: lmer(formula = Attention ~ (Age + Sex + PovStat + Race + NEOO)^4 + 
    (Age | HNDid), data = narNeu, control = lmerControl(check.nobs.vs.nRE = "warning"))

Linear Hypotheses:
                                         Estimate Std. Error z value Pr(>|z|)
(Intercept) == 0                         8.54e+00   5.68e+00    1.50    0.133
Age == 0                                -5.51e-02   1.04e-01   -0.53    0.596
SexMen == 0                             -7.30e+00   8.68e+00   -0.84    0.401
PovStatBelow == 0                       -5.30e-01   1.30e+01   -0.04    0.967
RaceAfrAm == 0                           9.46e+00   1.38e+01    0.68    0.494
NEOO == 0                                1.43e-02   4.75e-02    0.30    0.764
Age:SexMen == 0                          1.43e-01   1.56e-01    0.92    0.359
Age:PovStatBelow == 0                    2.84e-02   2.42e-01    0.12    0.906
Age:RaceAfrAm == 0                      -2.00e-01   2.64e-01   -0.76    0.448
Age:NEOO == 0                            5.23e-05   8.76e-04    0.06    0.952
SexMen:PovStatBelow == 0                 2.43e+01   1.84e+01    1.32    0.188
SexMen:RaceAfrAm == 0                    4.12e+00   1.89e+01    0.22    0.827
SexMen:NEOO == 0                         3.62e-02   7.21e-02    0.50    0.616
PovStatBelow:RaceAfrAm == 0             -3.11e+01   1.75e+01   -1.77    0.076
PovStatBelow:NEOO == 0                  -1.09e-06   1.17e-01    0.00    1.000
RaceAfrAm:NEOO == 0                     -1.18e-01   1.19e-01   -0.99    0.324
Age:SexMen:PovStatBelow == 0            -4.60e-01   3.43e-01   -1.34    0.179
Age:SexMen:RaceAfrAm == 0                4.43e-03   3.52e-01    0.01    0.990
Age:SexMen:NEOO == 0                    -7.90e-04   1.31e-03   -0.60    0.546
Age:PovStatBelow:RaceAfrAm == 0          5.24e-01   3.31e-01    1.58    0.114
Age:PovStatBelow:NEOO == 0              -3.38e-04   2.18e-03   -0.16    0.877
Age:RaceAfrAm:NEOO == 0                  2.24e-03   2.28e-03    0.98    0.327
SexMen:PovStatBelow:RaceAfrAm == 0      -9.38e+00   7.47e+00   -1.25    0.210
SexMen:PovStatBelow:NEOO == 0           -1.87e-01   1.66e-01   -1.12    0.261
SexMen:RaceAfrAm:NEOO == 0               6.86e-03   1.60e-01    0.04    0.966
PovStatBelow:RaceAfrAm:NEOO == 0         2.96e-01   1.55e-01    1.91    0.056
Age:SexMen:PovStatBelow:RaceAfrAm == 0   1.35e-01   9.55e-02    1.41    0.158
Age:SexMen:PovStatBelow:NEOO == 0        3.60e-03   3.08e-03    1.17    0.243
Age:SexMen:RaceAfrAm:NEOO == 0          -8.42e-04   3.02e-03   -0.28    0.780
Age:PovStatBelow:RaceAfrAm:NEOO == 0    -4.98e-03   2.93e-03   -1.70    0.089
SexMen:PovStatBelow:RaceAfrAm:NEOO == 0  1.96e-02   4.66e-02    0.42    0.674
(Univariate p values reported)
cftest(merAttention.3)

     Simultaneous Tests for General Linear Hypotheses

Fit: lmer(formula = Attention ~ (Age + Sex + PovStat + Race + NEOO)^3 + 
    (Age | HNDid), data = narNeu, control = lmerControl(check.nobs.vs.nRE = "warning"))

Linear Hypotheses:
                                    Estimate Std. Error z value Pr(>|z|)
(Intercept) == 0                    7.73e+00   5.24e+00    1.48    0.140
Age == 0                           -4.14e-02   9.52e-02   -0.43    0.664
SexMen == 0                        -1.50e+00   7.27e+00   -0.21    0.836
PovStatBelow == 0                  -4.74e+00   8.88e+00   -0.53    0.593
RaceAfrAm == 0                     -3.04e+00   9.03e+00   -0.34    0.737
NEOO == 0                           1.90e-02   4.38e-02    0.43    0.664
Age:SexMen == 0                     4.14e-02   1.30e-01    0.32    0.750
Age:PovStatBelow == 0               1.11e-01   1.63e-01    0.68    0.498
Age:RaceAfrAm == 0                  4.78e-02   1.69e-01    0.28    0.778
Age:NEOO == 0                      -2.48e-05   8.02e-04   -0.03    0.975
SexMen:PovStatBelow == 0           -9.09e-01   3.68e+00   -0.25    0.805
SexMen:RaceAfrAm == 0               4.22e+00   3.80e+00    1.11    0.267
SexMen:NEOO == 0                   -6.89e-03   6.03e-02   -0.11    0.909
PovStatBelow:RaceAfrAm == 0        -5.29e+00   3.54e+00   -1.50    0.135
PovStatBelow:NEOO == 0              5.18e-02   7.93e-02    0.65    0.514
RaceAfrAm:NEOO == 0                 8.13e-04   7.69e-02    0.01    0.992
Age:SexMen:PovStatBelow == 0        9.43e-03   4.72e-02    0.20    0.842
Age:SexMen:RaceAfrAm == 0          -2.82e-02   4.62e-02   -0.61    0.541
Age:SexMen:NEOO == 0               -3.85e-05   1.09e-03   -0.04    0.972
Age:PovStatBelow:RaceAfrAm == 0     1.54e-02   4.48e-02    0.34    0.731
Age:PovStatBelow:NEOO == 0         -1.34e-03   1.46e-03   -0.92    0.359
Age:RaceAfrAm:NEOO == 0            -1.05e-04   1.45e-03   -0.07    0.942
SexMen:PovStatBelow:RaceAfrAm == 0 -1.25e-01   8.29e-01   -0.15    0.880
SexMen:PovStatBelow:NEOO == 0       7.34e-03   2.26e-02    0.32    0.746
SexMen:RaceAfrAm:NEOO == 0         -2.38e-02   2.31e-02   -1.03    0.304
PovStatBelow:RaceAfrAm:NEOO == 0    4.25e-02   2.26e-02    1.88    0.059
(Univariate p values reported)
cftest(merAttention.4)

     Simultaneous Tests for General Linear Hypotheses

Fit: lmer(formula = Attention ~ (Age + Sex + PovStat + Race + NEOO)^2 + 
    (Age | HNDid), data = narNeu, control = lmerControl(check.nobs.vs.nRE = "warning"))

Linear Hypotheses:
                             Estimate Std. Error z value Pr(>|z|)
(Intercept) == 0             5.414272   3.538115    1.53    0.126
Age == 0                     0.006527   0.063134    0.10    0.918
SexMen == 0                 -0.061987   1.704585   -0.04    0.971
PovStatBelow == 0            0.387108   1.737439    0.22    0.824
RaceAfrAm == 0              -3.766467   1.786714   -2.11    0.035
NEOO == 0                    0.038633   0.029313    1.32    0.188
Age:SexMen == 0              0.028205   0.019770    1.43    0.154
Age:PovStatBelow == 0       -0.028913   0.021942   -1.32    0.188
Age:RaceAfrAm == 0           0.036220   0.021457    1.69    0.091
Age:NEOO == 0               -0.000432   0.000528   -0.82    0.413
SexMen:PovStatBelow == 0     0.287850   0.406983    0.71    0.479
SexMen:RaceAfrAm == 0        0.105020   0.401802    0.26    0.794
SexMen:NEOO == 0            -0.015531   0.010374   -1.50    0.134
PovStatBelow:RaceAfrAm == 0  0.166205   0.397593    0.42    0.676
PovStatBelow:NEOO == 0       0.002053   0.010922    0.19    0.851
RaceAfrAm:NEOO == 0          0.006792   0.011058    0.61    0.539
(Univariate p values reported)
cftest(merAttention.5)

     Simultaneous Tests for General Linear Hypotheses

Fit: lmer(formula = Attention ~ Age + Sex + PovStat + Race + NEOO + 
    (Age | HNDid), data = narNeu, control = lmerControl(check.nobs.vs.nRE = "warning"))

Linear Hypotheses:
                  Estimate Std. Error z value Pr(>|z|)
(Intercept) == 0   7.52072    0.80607    9.33  < 2e-16
Age == 0          -0.02830    0.00921   -3.07   0.0021
SexMen == 0       -0.10451    0.18400   -0.57   0.5700
PovStatBelow == 0 -0.76349    0.19516   -3.91  9.1e-05
RaceAfrAm == 0    -0.98727    0.19259   -5.13  3.0e-07
NEOO == 0          0.01275    0.00500    2.55   0.0108
(Univariate p values reported)

Plot the results of the backward elimination. For attention, only the analysis with main effects survived backward elimination.

We're particularly interested in differences in Attention that are associated with NEO Openness. We can plot the model results for the outcomes (Attention on the y-axis) as a function of NEO Openness at somewhat low (90) and somewhat high (110) levels (about ±1 standard deviation). This helps us visualize both the magnitude of the differences and the direction of the assoication with age.

pAge = 30:70
hat = zMixHat(narNeu, merAttention.5, vary="Age=pAge, NEOO=c(90,110)", fixedCov=zQ(Sex,PovStat,Race))

par(las=1, lwd=2)

HNDcolors = HNDpltColors()
HNDlabels = HNDpltLabels()

with(subset(hat, NEOO== 90), plot (Age, hat, lty=1, col="darkgreen", typ="l", ylim=c(0,10), ylab="Attention", xlab="Age"))
with(subset(hat, NEOO==110), lines(Age, hat, lty=2, col="darkgreen"))

legend(30, 10, zQ(loOpenness,hiOpenness), lty=1:2, col=zQ(darkgreen))

plot of chunk merAttention3

We could have plotted by Openness, race, and sex, but the associations are more difficult to visualize among all of the lines so I plotted race by poverty status separately for each sex by openness group.

pltSeq = seq(min(hat$Age), max(hat$Age), 10)
lblLeg = c('AfrAm below poverty','White below poverty','AfrAm above poverty','White above poverty')

hat = zMixHat(narNeu, merAttention.5, vary="Age=pAge, Sex=levels(narNeu$Sex), PovStat=levels(narNeu$PovStat), Race=levels(narNeu$Race), NEOO=c(90,110)")

par(las=1, lwd=2, mfrow=c(2,2))

#
# ***Panel (1,1)...
#
with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='AfrAm' & NEOO== 90), plot (Age, hat, lty=1, col=HNDcolors$Sex['Women'], typ="l", ylim=c(4,10), ylab="Attention", xlab="Age", main='Low Openness for Women'))
with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Sex['Women']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='AfrAm' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Sex['Women']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Sex['Women']))

with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['White']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['White']))

legend(55, 10, lblLeg, pch=c(0,0,1,1), col=HNDcolors$Race, cex=.75)

#
# ***Panel (1,2)...
#
with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='AfrAm' & NEOO== 90), plot (Age, hat, lty=1, col=HNDcolors$Sex['Men'], typ="l", ylim=c(4,10), ylab="Attention", xlab="Age", main='Low Openness for Men'))
with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Sex['Men']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='AfrAm' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Sex['Men']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Sex['Men']))

with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['White']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['White']))

legend(55, 10, lblLeg, pch=c(0,0,1,1), col=HNDcolors$Race, cex=.75)
#
# ***Panel (2,1)...
#
with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='AfrAm' & NEOO==110), plot (Age, hat, lty=2, col=HNDcolors$Sex['Women'], typ="l", ylim=c(4,10), ylab="Attention", xlab="Age", main='High Openness for Women'))
with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='White' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Sex['Women']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='AfrAm' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Sex['Women']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='White' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Sex['Women']))

with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Women' & PovStat=='Below' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['White']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Women' & PovStat=='Above' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['White']))

legend(55, 10, lblLeg, pch=c(0,0,1,1), col=HNDcolors$Race, cex=.75)
#
# ***Panel (2,2)...
#
with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='AfrAm' & NEOO==110), plot (Age, hat, lty=2, col=HNDcolors$Sex['Men'], typ="l", ylim=c(4,10), ylab="Attention", xlab="Age", main='High Openness for Men'))
with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='White' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Sex['Men']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='AfrAm' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Sex['Men']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='White' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Sex['Men']))

with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Men' & PovStat=='Below' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=0, col=HNDcolors$Race['White']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['AfrAm']))
with(subset(hat, Sex=='Men' & PovStat=='Above' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=1, col=HNDcolors$Race['White']))

legend(55, 10, lblLeg, pch=c(0,0,1,1), col=HNDcolors$Race, cex=.75)

plot of chunk merAttention4

The results are more complicated for BVRtot as a function of age, poverty status, race, and NEO Openness. (I removed sex because there were no significant differences associated with sex as a main effect or as interactions when I ran the analyses initially.) Examining the backward elimination, we stop at a 4-way interaction because age×poverty×race×O was significant.

merBVRtot.1 = lmer(BVRtot ~ (Age + PovStat + Race + NEOO)^4 + (Age|HNDid), data=narNeu, control=lmerControl(check.nobs.vs.nRE = "warning"))
cftest(merBVRtot.1)

     Simultaneous Tests for General Linear Hypotheses

Fit: lmer(formula = BVRtot ~ (Age + PovStat + Race + NEOO)^4 + (Age | 
    HNDid), data = narNeu, control = lmerControl(check.nobs.vs.nRE = "warning"))

Linear Hypotheses:
                                       Estimate Std. Error z value Pr(>|z|)
(Intercept) == 0                       4.722309   9.574887    0.49    0.622
Age == 0                               0.096124   0.176627    0.54    0.586
PovStatBelow == 0                    -13.506442  25.702949   -0.53    0.599
RaceAfrAm == 0                       -25.309186  23.296257   -1.09    0.277
NEOO == 0                             -0.067578   0.079961   -0.85    0.398
Age:PovStatBelow == 0                  0.399964   0.483760    0.83    0.408
Age:RaceAfrAm == 0                     0.399258   0.445895    0.90    0.371
Age:NEOO == 0                          0.000534   0.001488    0.36    0.720
PovStatBelow:RaceAfrAm == 0           82.339681  36.284995    2.27    0.023
PovStatBelow:NEOO == 0                 0.119467   0.231293    0.52    0.605
RaceAfrAm:NEOO == 0                    0.190667   0.200784    0.95    0.342
Age:PovStatBelow:RaceAfrAm == 0       -1.487473   0.690946   -2.15    0.031
Age:PovStatBelow:NEOO == 0            -0.003141   0.004354   -0.72    0.471
Age:RaceAfrAm:NEOO == 0               -0.002604   0.003860   -0.67    0.500
PovStatBelow:RaceAfrAm:NEOO == 0      -0.685349   0.322795   -2.12    0.034
Age:PovStatBelow:RaceAfrAm:NEOO == 0   0.012163   0.006153    1.98    0.048
(Univariate p values reported)
hat = zMixHat(narNeu, merBVRtot.1, vary="Age=pAge, PovStat=levels(narNeu$PovStat), Race=levels(narNeu$Race), NEOO=c(90,110)")

par(las=1, lwd=2, mfcol=c(1,1))

with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO== 90), plot (Age, hat, lty=1, col=HNDcolors$Race['AfrAm'], typ="l", ylim=c(0,30), ylab="BVRtot", xlab="Age"))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Race['White']))

with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO==110), lines(Age, hat, lty=2, col=HNDcolors$Race['White']))

with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['White']))

with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['White']))

lblLeg = c('AfrAm,BelowPov','White,BelowPov','AfrAm,AbovePov','White,AbovePov')

legend(30, 30, lblLeg, lty=c(1,1,1,1), pch=c(0,0,15,15),col=HNDcolors$Race)

text(30, 22, "Dashed lines for high openness", adj = c(0, 0))
text(30, 21, "Solid lines for low openness", adj = c(0, 0))

plot of chunk merBVRtot1

This picture is pretty hard to interpret because there are so many lines. We can break it into two separate graphs to make it easier to visualize the relationships.

par(las=1, lwd=2, mfcol=c(2,1))

with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO== 90), plot (Age, hat, lty=1, col=HNDcolors$Race['AfrAm'], typ="l", ylim=c(0,30), ylab="BVRtot", xlab="Age", main='Low openness'))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO== 90), lines(Age, hat, lty=1, col=HNDcolors$Race['White']))

with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO== 90 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['White']))

lblLeg = c('AfrAm,BelowPov','White,BelowPov','AfrAm,AbovePov','White,AbovePov')

legend(30, 30, lblLeg, lty=c(1,1,1,1), pch=c(0,0,15,15),col=HNDcolors$Race, cex=.75)


with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO==110), plot (Age, hat, lty=1, col=HNDcolors$Race['AfrAm'], typ="l", ylim=c(0,30), main='High openness'))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO==110), lines(Age, hat, lty=1, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO==110), lines(Age, hat, lty=1, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO==110), lines(Age, hat, lty=1, col=HNDcolors$Race['White']))

with(subset(hat, PovStat=='Below' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Below' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch= 0, col=HNDcolors$Race['White']))
with(subset(hat, PovStat=='Above' & Race=='AfrAm' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['AfrAm']))
with(subset(hat, PovStat=='Above' & Race=='White' & NEOO==110 & Age %in% pltSeq), points(Age, hat, pch=15, col=HNDcolors$Race['White']))

legend(30, 30, lblLeg, lty=c(1,1,1,1), pch=c(0,0,15,15),col=HNDcolors$Race, cex=.75)

plot of chunk merBVRtot2