R Markdown

The following data is from the Elderly Sentence Processing Study. Older Spanish speaking adults read highly predictable sentences, presented one-word at a time, while their continuous EEG activity was recorded. Spanish language, among many other, possess a grammatical agreement between articles (e.g. “the”,“a”) and the corresponding noun: each noun is either masculine or feminine in grammatical gender, and the preceding article must take the corresponding form (i.e. in Spanish, “el” and “la” are the masculine and feminine forms of “the”). “La biblioteca” would be correct because “biblioteca” is feminine, and the preceding article “la” agrees.

If a fluent Spanish speaker is reading a sentence and predicting a particular article-noun pair to appear, the preceding article can tell the reader if the following word is of the expected gender. Indeed, the brain response to an unexpected article (i.e. one that disagrees with the gender of the word they expect), suggests greater processing demands compared to the response to expected articles. Critically, this effect is seen before the expected noun is presented one screen.

These predictive abilities are thought to decline with age, as evidenced by similar brain responses to expected and unexpected articles in older adults. However, this paradigm has only been tested in English that exploits the subtle dependency on “a/”an" on the sound of the subsequent noun. This dependency might be too subtle for older adults to rapidly utitlize in the fast pace of sentence processing, not to mention the phonological dependencies is not very common throughout English. Te Elderly Sentence Procsesing Study aims to test if older adults are capable of prediction by giving them the far more reliable cue of grammatical gender in the Spanish langauge.

First we import our data: behavioral and demographic, then our ERP data, and merge.

library(car)
## Loading required package: carData
dems<-read.csv("ESPS_dems.csv",header=TRUE,sep="\t")
ERP<-read.csv("ESPS_ERP.csv",header=TRUE,sep = "\t")
ESPS<-merge(ERP,dems,all.x=TRUE,by.x="Subject")
linfit<-lm(Mean.Amp~Education+Age+female+WJ7_SS+WJ9_SS+VFE_cat_raw+VFE_let_raw+VFS_cat_raw+VFS_let_raw+MMSE+Span_Read_Raw+Digit_Raw+BNTS_raw+BNTE_raw,data=ESPS)
vif(linfit)
##     Education           Age        female        WJ7_SS        WJ9_SS 
##      4.281792      3.989441      2.446150      4.001824      6.596070 
##   VFE_cat_raw   VFE_let_raw   VFS_cat_raw   VFS_let_raw          MMSE 
##      3.610352      3.905663      3.306244      5.941388      2.199270 
## Span_Read_Raw     Digit_Raw      BNTS_raw      BNTE_raw 
##      1.824761      1.987265      2.999248      4.574751

None of these values exceed my threshold for inflated variance (>10), so they will all be used for the future models.

These data must be normalized however.

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:car':
## 
##     recode
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
#Recode demographics and behavioral data
dems$Education<-scale(dems$Education,center=TRUE,scale=TRUE)
dems$Age<-scale(dems$Age,center=TRUE,scale=TRUE)
dems$female<-dplyr::recode_factor(dems$female, f = 1, m = 0)
dems$WJ7<-scale(dems$WJ7_SS,center=TRUE,scale=TRUE)
dems$WJ9<-scale(dems$WJ9_SS,center=TRUE,scale=TRUE)
dems$VFE_cat<-scale(dems$VFE_cat_raw,center=TRUE,scale=TRUE)
dems$VFE_let<-scale(dems$VFE_let_raw,center=TRUE,scale=TRUE)
dems$VFS_cat<-scale(dems$VFS_cat_raw,center=TRUE,scale=TRUE)
dems$VFS_let<-scale(dems$VFS_let_raw,center=TRUE,scale=TRUE)
dems$MMSE<-scale(dems$MMSE,center=TRUE,scale=TRUE)
dems$Span_Read<-scale(dems$Span_Read_Raw,center=TRUE,scale=TRUE)
dems$Digit<-scale(dems$Digit_Raw,center=TRUE,scale=TRUE)
dems$BNTS<-scale(dems$BNTS_raw,center=TRUE,scale=TRUE)
dems$BNTE<-scale(dems$BNTE_raw,center=TRUE,scale=TRUE)
#Recoding ERP data
ERP$Gen_Effect<-NA #initialize gender effect variable
ERP$Gen_Effect[ERP$Gender==2]<-ERP$Mean.Amp[ERP$Gender==1]-ERP$Mean.Amp[ERP$Gender==2] #calculate the gender effect in half the variables
ERP$Hemisphere[is.na(ERP$Hemisphere)]<-NA
ERP$Hem<-as.factor(ERP$Hemisphere) # 1 - left; 2 - right
ERP$Laterality[is.na(ERP$Laterality)]<-NA
ERP$Lat<-as.factor(ERP$Laterality) # 1 - lateral; 2 - medial
ERP$Anteriority[is.na(ERP$Anteriority)]<-NA
ERP$Ant<-as.factor(ERP$Anteriority) # 1 - prefrontal; 2 - frontal; 3 - central; 4 - occipital
#Merge data sets
dems<-dplyr::select(dems,Subject,Education,Age,female,WJ7,WJ9,VFE_cat,VFE_let,VFS_cat,VFS_let,MMSE,Span_Read,Digit,BNTS,BNTE)
ERP<-dplyr::select(ERP,Subject,Gen_Effect,Hem,Lat,Ant)
ESPS<-merge(ERP,dems,all.y=TRUE)
ESPS<-ESPS[complete.cases(ESPS),]

I scaled several of our offline behavioral measures, as well as demographic values. These will be our group level factors (one measure per subject).

I also calculated our ERP effect, the difference between unexpected and expected trials, sampled at 16 electrodes, (organized as 2 levels of hemisphere, 2 levels of laterality, and 4 levels of anteriority).

I will first build a model that tests how the effect is differently observed across the scalp collapsed across each participant.

library(lme4)
## Loading required package: Matrix
fit1<-glmer(Gen_Effect~Hem+Lat+Ant+(1|Subject),data=ESPS)
## Warning in glmer(Gen_Effect ~ Hem + Lat + Ant + (1 | Subject), data =
## ESPS): calling glmer() with family=gaussian (identity link) as a shortcut
## to lmer() is deprecated; please call lmer() directly
library(arm)
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
## 
## arm (Version 1.10-1, built: 2018-4-12)
## Working directory is C:/Users/mwood/Google Drive/School/UTSA/Hierarchical Modeling
## 
## Attaching package: 'arm'
## The following object is masked from 'package:car':
## 
##     logit
display(fit1,detail=T,digits=4)
## lme4::lmer(formula = Gen_Effect ~ Hem + Lat + Ant + (1 | Subject), 
##     data = ESPS)
##             coef.est coef.se t value
## (Intercept)  0.5421   0.1642  3.3013
## Hem2        -0.2591   0.0790 -3.2798
## Lat2        -0.0554   0.0790 -0.7016
## Ant2        -0.0728   0.1117 -0.6518
## Ant3        -0.2487   0.1117 -2.2263
## Ant4        -0.4793   0.1117 -4.2907
## 
## Error terms:
##  Groups   Name        Std.Dev.
##  Subject  (Intercept) 0.7020  
##  Residual             1.1823  
## ---
## number of obs: 896, groups: Subject, 28
## AIC = 2939.9, DIC = 2890
## deviance = 2907.0

This model suggests that the effect is larger in left hemisphere, as well as the posterior sections of the head.

Next, I will see what subject-level factors best predict the expectancy effect.

fit2<-lmer(Gen_Effect~Education+Age+female+WJ7+WJ9+VFE_cat+VFE_let+VFS_cat+VFS_let+MMSE+Span_Read+Digit+BNTS+BNTE+(1|Subject),data=ESPS)
display(fit2,detail=T,digits=4)
## lmer(formula = Gen_Effect ~ Education + Age + female + WJ7 + 
##     WJ9 + VFE_cat + VFE_let + VFS_cat + VFS_let + MMSE + Span_Read + 
##     Digit + BNTS + BNTE + (1 | Subject), data = ESPS)
##             coef.est coef.se t value
## (Intercept)  0.1513   0.2013  0.7520
## Education    0.1133   0.2887  0.3926
## Age         -0.5064   0.2786 -1.8176
## female0      0.1035   0.4588  0.2256
## WJ7          0.3081   0.2791  1.1041
## WJ9          0.0445   0.3583  0.1241
## VFE_cat     -0.0285   0.2651 -0.1074
## VFE_let     -0.1831   0.2757 -0.6640
## VFS_cat     -0.0217   0.2537 -0.0857
## VFS_let     -0.4118   0.3400 -1.2111
## MMSE        -0.0027   0.2069 -0.0132
## Span_Read    0.1964   0.1884  1.0421
## Digit       -0.3975   0.1967 -2.0216
## BNTS        -0.1392   0.2416 -0.5762
## BNTE         0.3567   0.2984  1.1955
## 
## Error terms:
##  Groups   Name        Std.Dev.
##  Subject  (Intercept) 0.6931  
##  Residual             1.2013  
## ---
## number of obs: 896, groups: Subject, 28
## AIC = 2979.5, DIC = 2891.7
## deviance = 2918.6

Participant’s performance on the digit span task, which is a test for working memory, did predict their expectancy effect. However, the effect is largest for those who performed worst on the assay, which is difficult to interpret.

Age is close to being a signiciant predictor of the expectancy effect, which is exciting because it is a critical element of the study. It would appear that the effect is smaller for individuals who are older, speaking to the original theory that predictive ability declines with age.

Next I will compare the fit of these two models to determine which is a better fit for the data.

anova(fit1,fit2)
## refitting model(s) with ML (instead of REML)
## Data: ESPS
## Models:
## fit1: Gen_Effect ~ Hem + Lat + Ant + (1 | Subject)
## fit2: Gen_Effect ~ Education + Age + female + WJ7 + WJ9 + VFE_cat + 
## fit2:     VFE_let + VFS_cat + VFS_let + MMSE + Span_Read + Digit + 
## fit2:     BNTS + BNTE + (1 | Subject)
##      Df    AIC    BIC  logLik deviance Chisq Chi Df Pr(>Chisq)
## fit1  8 2923.0 2961.4 -1453.5   2907.0                        
## fit2 17 2952.6 3034.2 -1459.3   2918.6     0      9          1

With a p value of 1 (suspicious), it would appear these models have similar fit for the data.

Next, I will test if the distribution of the effect across the head changes with age. ERP activity tends to become more diffuse and less focal on the scalp as individuals age, so I would expect younger adults to have a much larger difference of the expectancy effect across the scalp.

fit3<-lmer(Gen_Effect~(Hem+Lat+Ant)*Age+Education+female+WJ7+WJ9+VFE_cat+VFE_let+VFS_cat+VFS_let+MMSE+Span_Read+Digit+BNTS+BNTE+(1|Subject),data=ESPS)
display(fit3,detail=T,digits=4)
## lmer(formula = Gen_Effect ~ (Hem + Lat + Ant) * Age + Education + 
##     female + WJ7 + WJ9 + VFE_cat + VFE_let + VFS_cat + VFS_let + 
##     MMSE + Span_Read + Digit + BNTS + BNTE + (1 | Subject), data = ESPS)
##             coef.est coef.se t value
## (Intercept)  0.5088   0.2198  2.3151
## Hem2        -0.2591   0.0790 -3.2806
## Lat2        -0.0554   0.0790 -0.7018
## Ant2        -0.0728   0.1117 -0.6519
## Ant3        -0.2487   0.1117 -2.2268
## Ant4        -0.4793   0.1117 -4.2917
## Age         -0.5529   0.2928 -1.8886
## Education    0.1133   0.2887  0.3926
## female0      0.1035   0.4588  0.2256
## WJ7          0.3081   0.2791  1.1041
## WJ9          0.0445   0.3583  0.1241
## VFE_cat     -0.0285   0.2651 -0.1074
## VFE_let     -0.1831   0.2757 -0.6640
## VFS_cat     -0.0217   0.2537 -0.0857
## VFS_let     -0.4118   0.3400 -1.2111
## MMSE        -0.0027   0.2069 -0.0132
## Span_Read    0.1964   0.1884  1.0421
## Digit       -0.3975   0.1967 -2.0216
## BNTS        -0.1392   0.2416 -0.5762
## BNTE         0.3567   0.2984  1.1955
## Hem2:Age    -0.1320   0.0804 -1.6412
## Lat2:Age     0.0077   0.0804  0.0962
## Ant2:Age     0.1106   0.1137  0.9727
## Ant3:Age     0.1597   0.1137  1.4044
## Ant4:Age     0.1642   0.1137  1.4433
## 
## Error terms:
##  Groups   Name        Std.Dev.
##  Subject  (Intercept) 0.6941  
##  Residual             1.1820  
## ---
## number of obs: 896, groups: Subject, 28
## AIC = 2990.9, DIC = 2824.1
## deviance = 2880.5

While nothing came out greater than +/- 2 for the t-values, the interaction between age and hemsiphere was approaching an interaction, and the same could be said for the posterior sections of the head. Because these are the same areas where the effect was significant at the invidiual level in fit 1, this could just reflect a general decline in the effect in older individuals, and not necessarily a difference in distribution with age.