Baseline = -470 to -270
set working directory and load in data The eeg data file includes both L1 and L2 together, so need to restrict data to just L1
setwd("C:/Users/Katie/Desktop/Research/Dissertation/STUDIES/Studies 3 and 4 EEG/L1 and L2 French/EEG Inaccurate removed/EEG data/")
list.files()
## [1] "kate-output-470baseline-ALL-every-ms.txt"
## [2] "kate-output-470baseline-ALL.txt"
## [3] "L1 and L2 acc-only eeg amplitude.Rmd"
## [4] "L1___L2_acc-only_eeg_amplitude.Rmd"
## [5] "L1_and_L2_acc-only_eeg_amplitude.html"
## [6] "L2 acc-only eeg amplitude.Rmd"
## [7] "L2 offline data for R.csv"
## [8] "L2_acc-only_eeg_amplitude.html"
## [9] "rsconnect"
data<-read.table("kate-output-470baseline-ALL.txt",header=TRUE)
all.subs<-unique(data$subj)
L1.subj<-as.character(all.subs[32:61])
L2.subj<-as.character(all.subs[1:31])
lang.l1<-rep("L1",30)
L1<-cbind(L1.subj,lang.l1)
lang.l2<-rep("L2",31)
L2<-cbind(L2.subj,lang.l2)
colnames(L1)<-c("subj","lang")
colnames(L2)<-c("subj","lang")
subj.lang<-rbind(L1,L2)
library(qdap)
data$lang<-lookup(data$subj,subj.lang)
data<-data[data$lang=="L1",]
Add condition and relatedness to the dataframe
cond<-as.character(unique(data[,2]))
conditions<-c("id","id","morph","morph", "orth", "orth", "sem","sem")
match_cond<-cbind(cond,conditions)
relateds<-c("rel","unrel","rel","unrel", "rel", "unrel", "rel","unrel")
match_rel<-cbind(cond,relateds)
data$Condition<-lookup(data$cond,match_cond)
data$Related<-lookup(data$cond,match_rel)
data$Condition<-as.factor(as.character(data$Condition))
data$Related<-as.factor(as.character(data$Related))
data$lang<-as.factor(as.character(data$lang))
head(data,15)
## subj cond chan win mean lang Condition Related
## 29761 KC01 fidr Fp1 +100..+301 3.68640 L1 id rel
## 29762 KC01 fidr Fp1 +301..+500 -0.27918 L1 id rel
## 29763 KC01 fidr Fp1 +500..+600 -1.16070 L1 id rel
## 29764 KC01 fidr Fp1 +176..+275 2.98010 L1 id rel
## 29765 KC01 fidr Fp1 +350..+449 -1.60090 L1 id rel
## 29766 KC01 fidr Fp1 +449..+551 -0.50467 L1 id rel
## 29767 KC01 fidr Fp2 +100..+301 4.67800 L1 id rel
## 29768 KC01 fidr Fp2 +301..+500 1.01680 L1 id rel
## 29769 KC01 fidr Fp2 +500..+600 0.10319 L1 id rel
## 29770 KC01 fidr Fp2 +176..+275 3.48690 L1 id rel
## 29771 KC01 fidr Fp2 +350..+449 -0.37370 L1 id rel
## 29772 KC01 fidr Fp2 +449..+551 1.00140 L1 id rel
## 29773 KC01 fidr F3 +100..+301 3.52120 L1 id rel
## 29774 KC01 fidr F3 +301..+500 -0.74307 L1 id rel
## 29775 KC01 fidr F3 +500..+600 -0.36617 L1 id rel
Add factors of hemisphere (3 levels) and AntPos (3 levels) for 20 electrodes
electrodes<-as.character(unique(data$chan))
hems<-c("left","right","left","right","left","right","left","right","left","right","left","right","left","right","left","right","mid","mid","mid","mid")
el.hem<-cbind(electrodes,hems)
antpos<-c("ant","ant","ant","ant","central","central","post","post","ant","ant","central","central","post","post","post","post","ant","central","post","post")
el.antpost<-cbind(electrodes,antpos)
data$hemisphere<-lookup(data$chan,el.hem)
data$hemisphere<-as.factor(data$hemisphere)
data$antpos<-lookup(data$chan,el.antpost)
data$antpos<-as.factor(data$antpos)
Relevel to make the unrelated condition the baseline and make central the baseline for antpos and mid for hemisphere
data$Related<-relevel(data$Related,ref="unrel")
data$antpos<-relevel(data$antpos,ref="central")
data$hemisphere<-relevel(data$hemisphere,ref="mid")
Code hemisphere and antpos with sum coding instead of deviance coding
#contrasts(data$hemisphere)<-contr.sum(3,contrasts=FALSE)
#contrasts(data$antpos)<-contr.sum(3, contrasts=FALSE)
Remove participants
data<-data[data$subj!= "KC04" &data$subj!="KC15" &data$subj!="KC27",]
create time windows
time100<-data[data$win=="+100..+301",]
time300<-data[data$win=="+301..+500",]
time500<-data[data$win=="+500..+600",]
time175<-data[data$win=="+176..+275",]
time350<-data[data$win=="+350..+449",]
time450<-data[data$win=="+449..+551",]
library(lme4)
library(lmerTest)
t1.1<-lmer(mean~Condition*Related*hemisphere*antpos+(1+Related|subj),time100)
lmerTest::anova(t1.1)
## Analysis of Variance Table of type III with Satterthwaite
## approximation for degrees of freedom
## Sum Sq Mean Sq NumDF DenDF F.value
## Condition 112.7 37.6 3 4196.0 6.18
## Related 3.8 3.8 1 27.1 0.62
## hemisphere 93.6 46.8 2 4196.0 7.70
## antpos 20230.5 10115.2 2 4196.0 1664.03
## Condition:Related 170.0 56.7 3 4196.0 9.32
## Condition:hemisphere 14.5 2.4 6 4196.0 0.40
## Related:hemisphere 31.8 15.9 2 4196.0 2.62
## Condition:antpos 9.6 1.6 6 4196.0 0.26
## Related:antpos 3.1 1.6 2 4196.0 0.26
## hemisphere:antpos 680.5 170.1 4 4196.0 27.99
## Condition:Related:hemisphere 13.4 2.2 6 4196.0 0.37
## Condition:Related:antpos 45.5 7.6 6 4196.0 1.25
## Condition:hemisphere:antpos 3.6 0.3 12 4196.0 0.05
## Related:hemisphere:antpos 4.7 1.2 4 4196.0 0.19
## Condition:Related:hemisphere:antpos 6.3 0.5 12 4196.0 0.09
## Pr(>F)
## Condition 0.0003469 ***
## Related 0.4372846
## hemisphere 0.0004579 ***
## antpos < 2.2e-16 ***
## Condition:Related 3.85e-06 ***
## Condition:hemisphere 0.8811250
## Related:hemisphere 0.0732092 .
## Condition:antpos 0.9544263
## Related:antpos 0.7748739
## hemisphere:antpos < 2.2e-16 ***
## Condition:Related:hemisphere 0.8993872
## Condition:Related:antpos 0.2790867
## Condition:hemisphere:antpos 0.9999992
## Related:hemisphere:antpos 0.9411509
## Condition:Related:hemisphere:antpos 0.9999830
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#step(t1.1)
t1.final<-lmer(formula = mean ~ Condition + Related + hemisphere +
antpos + (1 + Related | subj) + Condition:Related + hemisphere:antpos,
data = time100)
summary(t1.final)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula:
## mean ~ Condition + Related + hemisphere + antpos + (1 + Related |
## subj) + Condition:Related + hemisphere:antpos
## Data: time100
##
## REML criterion at convergence: 20220.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.9904 -0.6251 0.0234 0.6239 6.4805
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 3.461 1.860
## Relatedrel 1.289 1.135 -0.33
## Residual 6.034 2.456
## Number of obs: 4320, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.49625 0.40731 42.00000 3.674
## Conditionmorph -0.24833 0.14949 4252.00000 -1.661
## Conditionorth -0.22576 0.14949 4252.00000 -1.510
## Conditionsem 0.11091 0.14949 4252.00000 0.742
## Relatedrel 0.49364 0.26471 45.00000 1.865
## hemisphereleft 0.12309 0.20470 4252.00000 0.601
## hemisphereright -0.15201 0.20470 4252.00000 -0.743
## antposant 1.58654 0.23636 4252.00000 6.712
## antpospost -2.29441 0.20470 4252.00000 -11.209
## Conditionmorph:Relatedrel -0.03028 0.21141 4252.00000 -0.143
## Conditionorth:Relatedrel -0.33615 0.21141 4252.00000 -1.590
## Conditionsem:Relatedrel -0.98495 0.21141 4252.00000 -4.659
## hemisphereleft:antposant 0.29381 0.28133 4252.00000 1.044
## hemisphereright:antposant 0.81016 0.28133 4252.00000 2.880
## hemisphereleft:antpospost -1.53043 0.25530 4252.00000 -5.995
## hemisphereright:antpospost -1.61491 0.25530 4252.00000 -6.326
## Pr(>|t|)
## (Intercept) 0.000676 ***
## Conditionmorph 0.096752 .
## Conditionorth 0.131066
## Conditionsem 0.458184
## Relatedrel 0.068751 .
## hemisphereleft 0.547653
## hemisphereright 0.457745
## antposant 2.17e-11 ***
## antpospost < 2e-16 ***
## Conditionmorph:Relatedrel 0.886121
## Conditionorth:Relatedrel 0.111904
## Conditionsem:Relatedrel 3.28e-06 ***
## hemisphereleft:antposant 0.296375
## hemisphereright:antposant 0.003999 **
## hemisphereleft:antpospost 2.21e-09 ***
## hemisphereright:antpospost 2.78e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns Rltdrl hmsphrl hmsphrr antpsn
## Conditnmrph -0.184
## Conditinrth -0.184 0.500
## Conditionsm -0.184 0.500 0.500
## Relatedrel -0.345 0.282 0.282 0.282
## hemisphrlft -0.335 0.000 0.000 0.000 0.000
## hemsphrrght -0.335 0.000 0.000 0.000 0.000 0.667
## antposant -0.290 0.000 0.000 0.000 0.000 0.577 0.577
## antpospost -0.335 0.000 0.000 0.000 0.000 0.667 0.667 0.577
## Cndtnmrph:R 0.130 -0.707 -0.354 -0.354 -0.399 0.000 0.000 0.000
## Cndtnrth:Rl 0.130 -0.354 -0.707 -0.354 -0.399 0.000 0.000 0.000
## Cndtnsm:Rlt 0.130 -0.354 -0.354 -0.707 -0.399 0.000 0.000 0.000
## hmsphrlft:ntpsn 0.244 0.000 0.000 0.000 0.000 -0.728 -0.485 -0.840
## hmsphrrght:ntpsn 0.244 0.000 0.000 0.000 0.000 -0.485 -0.728 -0.840
## hmsphrlft:ntpsp 0.269 0.000 0.000 0.000 0.000 -0.802 -0.535 -0.463
## hmsphrrght:ntpsp 0.269 0.000 0.000 0.000 0.000 -0.535 -0.802 -0.463
## antpsp Cndtnm:R Cndtnr:R Cndtns:R hmsphrlft:ntpsn
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## antposant
## antpospost
## Cndtnmrph:R 0.000
## Cndtnrth:Rl 0.000 0.500
## Cndtnsm:Rlt 0.000 0.500 0.500
## hmsphrlft:ntpsn -0.485 0.000 0.000 0.000
## hmsphrrght:ntpsn -0.485 0.000 0.000 0.000 0.706
## hmsphrlft:ntpsp -0.802 0.000 0.000 0.000 0.583
## hmsphrrght:ntpsp -0.802 0.000 0.000 0.000 0.389
## hmsphrrght:ntpsn hmsphrlft:ntpsp
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## antposant
## antpospost
## Cndtnmrph:R
## Cndtnrth:Rl
## Cndtnsm:Rlt
## hmsphrlft:ntpsn
## hmsphrrght:ntpsn
## hmsphrlft:ntpsp 0.389
## hmsphrrght:ntpsp 0.583 0.643
lmerTest::anova(t1.final)
## Analysis of Variance Table of type III with Satterthwaite
## approximation for degrees of freedom
## Sum Sq Mean Sq NumDF DenDF F.value Pr(>F)
## Condition 108.3 36.1 3 4252 5.98 0.0004574 ***
## Related 2.7 2.7 1 26 0.46 0.5057787
## hemisphere 93.6 46.8 2 4252 7.76 0.0004323 ***
## antpos 20230.5 10115.2 2 4252 1676.46 < 2.2e-16 ***
## Condition:Related 169.4 56.5 3 4252 9.36 3.65e-06 ***
## hemisphere:antpos 680.5 170.1 4 4252 28.19 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Summary 100-300, omnibus
lmer-outputs of interest
Resolve interactions by antpos
create antpos dataframes
ant100<-time100[time100$antpos=="ant",]
cent100<-time100[time100$antpos=="central",]
post100<-time100[time100$antpos=="post",]
100-300, anterior
ant1.1<-lmer(mean~Condition*Related*hemisphere+(1+Related|subj),ant100)
ant1.2<-lmer(mean~Condition*Related+(1+Related|subj),ant100)
summary(ant1.2)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: mean ~ Condition * Related + (1 + Related | subj)
## Data: ant100
##
## REML criterion at convergence: 6811.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.0678 -0.6091 0.0149 0.6004 6.7840
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 5.275 2.297
## Relatedrel 2.241 1.497 -0.50
## Residual 4.766 2.183
## Number of obs: 1512, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 3.49137 0.46966 31.10000 7.434
## Conditionmorph -0.41305 0.22457 1452.00000 -1.839
## Conditionorth 0.03931 0.22457 1452.00000 0.175
## Conditionsem 0.15333 0.22457 1452.00000 0.683
## Relatedrel 0.66388 0.36531 50.50000 1.817
## Conditionmorph:Relatedrel 0.11248 0.31760 1452.00000 0.354
## Conditionorth:Relatedrel -0.94323 0.31760 1452.00000 -2.970
## Conditionsem:Relatedrel -1.06981 0.31760 1452.00000 -3.368
## Pr(>|t|)
## (Intercept) 2.21e-08 ***
## Conditionmorph 0.066081 .
## Conditionorth 0.861072
## Conditionsem 0.494878
## Relatedrel 0.075105 .
## Conditionmorph:Relatedrel 0.723278
## Conditionorth:Relatedrel 0.003028 **
## Conditionsem:Relatedrel 0.000776 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns Rltdrl Cndtnm:R Cndtnr:R
## Conditnmrph -0.239
## Conditinrth -0.239 0.500
## Conditionsm -0.239 0.500 0.500
## Relatedrel -0.518 0.307 0.307 0.307
## Cndtnmrph:R 0.169 -0.707 -0.354 -0.354 -0.435
## Cndtnrth:Rl 0.169 -0.354 -0.707 -0.354 -0.435 0.500
## Cndtnsm:Rlt 0.169 -0.354 -0.354 -0.707 -0.435 0.500 0.500
Anterior, 100-300
100-300, central
cent1.1<-lmer(mean~Condition*Related*hemisphere+(1+Related|subj),cent100)
cent1.2<-lmer(mean~Condition*Related+(1+Related|subj),cent100)
summary(cent1.2)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: mean ~ Condition * Related + (1 + Related | subj)
## Data: cent100
##
## REML criterion at convergence: 4390.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.4500 -0.6227 0.0003 0.5965 6.0935
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 4.682 2.164
## Relatedrel 1.679 1.296 -0.42
## Residual 2.939 1.714
## Number of obs: 1080, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.51813 0.44179 31.00000 3.436
## Conditionmorph -0.36289 0.20866 1020.00000 -1.739
## Conditionorth -0.30490 0.20866 1020.00000 -1.461
## Conditionsem 0.11426 0.20866 1020.00000 0.548
## Relatedrel 0.59084 0.32514 54.20000 1.817
## Conditionmorph:Relatedrel -0.02403 0.29509 1020.00000 -0.081
## Conditionorth:Relatedrel -0.37204 0.29509 1020.00000 -1.261
## Conditionsem:Relatedrel -1.23092 0.29509 1020.00000 -4.171
## Pr(>|t|)
## (Intercept) 0.0017 **
## Conditionmorph 0.0823 .
## Conditionorth 0.1443
## Conditionsem 0.5841
## Relatedrel 0.0747 .
## Conditionmorph:Relatedrel 0.9351
## Conditionorth:Relatedrel 0.2077
## Conditionsem:Relatedrel 3.29e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns Rltdrl Cndtnm:R Cndtnr:R
## Conditnmrph -0.236
## Conditinrth -0.236 0.500
## Conditionsm -0.236 0.500 0.500
## Relatedrel -0.454 0.321 0.321 0.321
## Cndtnmrph:R 0.167 -0.707 -0.354 -0.354 -0.454
## Cndtnrth:Rl 0.167 -0.354 -0.707 -0.354 -0.454 0.500
## Cndtnsm:Rlt 0.167 -0.354 -0.354 -0.707 -0.454 0.500 0.500
Central, 100-300
100-300, posterior
post1.1<-lmer(mean~Condition*Related*hemisphere+(1+Related|subj),post100)
post1.2<-lmer(mean~Condition*Related+hemisphere+(1+Related|subj),post100)
summary(post1.2)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: mean ~ Condition * Related + hemisphere + (1 + Related | subj)
## Data: post100
##
## REML criterion at convergence: 8135.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.97168 -0.68360 -0.02988 0.65761 3.10566
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 4.470 2.1142
## Relatedrel 0.865 0.9301 0.02
## Residual 5.982 2.4458
## Number of obs: 1728, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) -0.77341 0.45125 36.20000 -1.714
## Conditionmorph -0.03259 0.23535 1666.00000 -0.138
## Conditionorth -0.40823 0.23535 1666.00000 -1.735
## Conditionsem 0.07170 0.23535 1666.00000 0.305
## Relatedrel 0.28394 0.29568 93.20000 0.960
## hemisphereleft -1.40734 0.15192 1666.00000 -9.264
## hemisphereright -1.76693 0.15192 1666.00000 -11.631
## Conditionmorph:Relatedrel -0.15909 0.33284 1666.00000 -0.478
## Conditionorth:Relatedrel 0.21749 0.33284 1666.00000 0.653
## Conditionsem:Relatedrel -0.75696 0.33284 1666.00000 -2.274
## Pr(>|t|)
## (Intercept) 0.0951 .
## Conditionmorph 0.8899
## Conditionorth 0.0830 .
## Conditionsem 0.7607
## Relatedrel 0.3394
## hemisphereleft <2e-16 ***
## hemisphereright <2e-16 ***
## Conditionmorph:Relatedrel 0.6327
## Conditionorth:Relatedrel 0.5136
## Conditionsem:Relatedrel 0.0231 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns Rltdrl hmsphrl hmsphrr Cndtnm:R
## Conditnmrph -0.261
## Conditinrth -0.261 0.500
## Conditionsm -0.261 0.500 0.500
## Relatedrel -0.198 0.398 0.398 0.398
## hemisphrlft -0.202 0.000 0.000 0.000 0.000
## hemsphrrght -0.202 0.000 0.000 0.000 0.000 0.600
## Cndtnmrph:R 0.184 -0.707 -0.354 -0.354 -0.563 0.000 0.000
## Cndtnrth:Rl 0.184 -0.354 -0.707 -0.354 -0.563 0.000 0.000 0.500
## Cndtnsm:Rlt 0.184 -0.354 -0.354 -0.707 -0.563 0.000 0.000 0.500
## Cndtnr:R
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## Cndtnmrph:R
## Cndtnrth:Rl
## Cndtnsm:Rlt 0.500
Posterior, 100-300
Looking at the voltage maps, the id condition is positive in posterior. in the the morph condition it’s kind of negative in the back
t3.1<-lmer(mean~Condition*Related*hemisphere*antpos+(1+Related|subj),time300)
#step(t3.1)
t3.final<-lmer(formula = mean ~ Condition + Related + hemisphere +
antpos + (1 + Related | subj) + Condition:Related + Related:antpos +
hemisphere:antpos, data = time300)
summary(t3.final)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula:
## mean ~ Condition + Related + hemisphere + antpos + (1 + Related |
## subj) + Condition:Related + Related:antpos + hemisphere:antpos
## Data: time300
##
## REML criterion at convergence: 21638.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.5356 -0.5712 0.0586 0.6002 4.1740
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 5.4612 2.3369
## Relatedrel 0.9087 0.9533 -0.17
## Residual 8.4054 2.8992
## Number of obs: 4320, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 2.28403 0.51053 42.00000 4.474
## Conditionmorph -0.22424 0.17644 4250.00000 -1.271
## Conditionorth -0.41552 0.17644 4250.00000 -2.355
## Conditionsem -0.31532 0.17644 4250.00000 -1.787
## Relatedrel 0.87871 0.29688 117.00000 2.960
## hemisphereleft -0.10785 0.24160 4250.00000 -0.446
## hemisphereright 0.46757 0.24160 4250.00000 1.935
## antposant -0.37605 0.30194 4250.00000 -1.245
## antpospost 0.59281 0.26649 4250.00000 2.225
## Conditionmorph:Relatedrel 0.16309 0.24952 4250.00000 0.654
## Conditionorth:Relatedrel -0.44865 0.24952 4250.00000 -1.798
## Conditionsem:Relatedrel -0.50207 0.24952 4250.00000 -2.012
## Relatedrel:antposant -0.68292 0.23101 4250.00000 -2.956
## Relatedrel:antpospost 0.03697 0.22492 4250.00000 0.164
## hemisphereleft:antposant -0.73283 0.33205 4250.00000 -2.207
## hemisphereright:antposant 0.08890 0.33205 4250.00000 0.268
## hemisphereleft:antpospost -1.04531 0.30133 4250.00000 -3.469
## hemisphereright:antpospost -1.72405 0.30133 4250.00000 -5.721
## Pr(>|t|)
## (Intercept) 5.86e-05 ***
## Conditionmorph 0.203825
## Conditionorth 0.018566 *
## Conditionsem 0.073992 .
## Relatedrel 0.003729 **
## hemisphereleft 0.655329
## hemisphereright 0.053017 .
## antposant 0.213044
## antpospost 0.026166 *
## Conditionmorph:Relatedrel 0.513389
## Conditionorth:Relatedrel 0.072246 .
## Conditionsem:Relatedrel 0.044271 *
## Relatedrel:antposant 0.003132 **
## Relatedrel:antpospost 0.869439
## hemisphereleft:antposant 0.027367 *
## hemisphereright:antposant 0.788910
## hemisphereleft:antpospost 0.000528 ***
## hemisphereright:antpospost 1.13e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns Rltdrl hmsphrl hmsphrr antpsn
## Conditnmrph -0.173
## Conditinrth -0.173 0.500
## Conditionsm -0.173 0.500 0.500
## Relatedrel -0.270 0.297 0.297 0.297
## hemisphrlft -0.315 0.000 0.000 0.000 0.000
## hemsphrrght -0.315 0.000 0.000 0.000 0.000 0.667
## antposant -0.303 0.000 0.000 0.000 0.174 0.533 0.533
## antpospost -0.343 0.000 0.000 0.000 0.197 0.604 0.604 0.580
## Cndtnmrph:R 0.122 -0.707 -0.354 -0.354 -0.420 0.000 0.000 0.000
## Cndtnrth:Rl 0.122 -0.354 -0.707 -0.354 -0.420 0.000 0.000 0.000
## Cndtnsm:Rlt 0.122 -0.354 -0.354 -0.707 -0.420 0.000 0.000 0.000
## Rltdrl:ntpsn 0.132 0.000 0.000 0.000 -0.454 0.000 0.000 -0.383
## Rltdrl:ntpsp 0.136 0.000 0.000 0.000 -0.466 0.000 0.000 -0.229
## hmsphrlft:ntpsn 0.230 0.000 0.000 0.000 0.000 -0.728 -0.485 -0.776
## hmsphrrght:ntpsn 0.230 0.000 0.000 0.000 0.000 -0.485 -0.728 -0.776
## hmsphrlft:ntpsp 0.253 0.000 0.000 0.000 0.000 -0.802 -0.535 -0.428
## hmsphrrght:ntpsp 0.253 0.000 0.000 0.000 0.000 -0.535 -0.802 -0.428
## antpsp Cndtnm:R Cndtnr:R Cndtns:R Rltdrl:ntpsn
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## antposant
## antpospost
## Cndtnmrph:R 0.000
## Cndtnrth:Rl 0.000 0.500
## Cndtnsm:Rlt 0.000 0.500 0.500
## Rltdrl:ntpsn -0.253 0.000 0.000 0.000
## Rltdrl:ntpsp -0.422 0.000 0.000 0.000 0.599
## hmsphrlft:ntpsn -0.440 0.000 0.000 0.000 0.000
## hmsphrrght:ntpsn -0.440 0.000 0.000 0.000 0.000
## hmsphrlft:ntpsp -0.727 0.000 0.000 0.000 0.000
## hmsphrrght:ntpsp -0.727 0.000 0.000 0.000 0.000
## Rltdrl:ntpsp hmsphrlft:ntpsn hmsphrrght:ntpsn
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## antposant
## antpospost
## Cndtnmrph:R
## Cndtnrth:Rl
## Cndtnsm:Rlt
## Rltdrl:ntpsn
## Rltdrl:ntpsp
## hmsphrlft:ntpsn 0.000
## hmsphrrght:ntpsn 0.000 0.706
## hmsphrlft:ntpsp 0.000 0.583 0.389
## hmsphrrght:ntpsp 0.000 0.389 0.583
## hmsphrlft:ntpsp
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## antposant
## antpospost
## Cndtnmrph:R
## Cndtnrth:Rl
## Cndtnsm:Rlt
## Rltdrl:ntpsn
## Rltdrl:ntpsp
## hmsphrlft:ntpsn
## hmsphrrght:ntpsn
## hmsphrlft:ntpsp
## hmsphrrght:ntpsp 0.643
lmerTest::anova(t3.final)
## Analysis of Variance Table of type III with Satterthwaite
## approximation for degrees of freedom
## Sum Sq Mean Sq NumDF DenDF F.value Pr(>F)
## Condition 319.29 106.431 3 4250.0 12.6623 3.082e-08 ***
## Related 43.81 43.812 1 26.4 5.2124 0.0307152 *
## hemisphere 418.87 209.437 2 4250.0 24.9171 1.744e-11 ***
## antpos 496.88 248.442 2 4250.0 29.5575 1.785e-13 ***
## Condition:Related 87.72 29.238 3 4250.0 3.4785 0.0152851 *
## Related:antpos 122.58 61.289 2 4250.0 7.2917 0.0006897 ***
## hemisphere:antpos 627.18 156.794 4 4250.0 18.6540 3.331e-15 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
300-500, omnibus lmer-output of interest
Resolve interactions by splitting by antpos create antpos dataframes
ant300<-time300[time300$antpos=="ant",]
cent300<-time300[time300$antpos=="central",]
post300<-time300[time300$antpos=="post",]
300-500, anterior
ant3.1<-lmer(mean~Condition*Related*hemisphere+(1+Related|subj),ant300)
#step(ant3.1)
ant3.final<-lmer(formula = mean ~ Condition + hemisphere + (1 + Related |
subj), data = ant300)
summary(ant3.final)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: mean ~ Condition + hemisphere + (1 + Related | subj)
## Data: ant300
##
## REML criterion at convergence: 7215.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.4832 -0.5692 0.0706 0.6441 3.3513
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 9.354 3.058
## Relatedrel 1.429 1.195 -0.47
## Residual 6.243 2.499
## Number of obs: 1512, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.85213 0.56350 33.30000 3.287 0.00239 **
## Conditionmorph -0.07529 0.18175 1453.00000 -0.414 0.67876
## Conditionorth -0.54165 0.18175 1453.00000 -2.980 0.00293 **
## Conditionsem -0.11935 0.18175 1453.00000 -0.657 0.51148
## hemisphereleft -0.84068 0.19631 1453.00000 -4.282 1.97e-05 ***
## hemisphereright 0.55648 0.19631 1453.00000 2.835 0.00465 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns hmsphrl
## Conditnmrph -0.161
## Conditinrth -0.161 0.500
## Conditionsm -0.161 0.500 0.500
## hemisphrlft -0.261 0.000 0.000 0.000
## hemsphrrght -0.261 0.000 0.000 0.000 0.750
lmerTest::anova(ant3.final)
## Analysis of Variance Table of type III with Satterthwaite
## approximation for degrees of freedom
## Sum Sq Mean Sq NumDF DenDF F.value Pr(>F)
## Condition 67.2 22.4 3 1453 3.588 0.0133 *
## hemisphere 636.2 318.1 2 1453 50.952 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anterior, 300-500
300-500, central
cent3.1<-lmer(mean~Condition*Related*hemisphere+(1+Related|subj),cent300)
#step(cent3.1)
cent3.final<-lmer(formula = mean ~ Condition + Related + hemisphere +
(1 + Related | subj) + Condition:Related, data = cent300)
summary(cent3.final)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: mean ~ Condition + Related + hemisphere + (1 + Related | subj) +
## Condition:Related
## Data: cent300
##
## REML criterion at convergence: 4748.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.4175 -0.5890 0.0369 0.6089 3.1305
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 6.9171 2.6300
## Relatedrel 0.6503 0.8064 -0.39
## Residual 4.1850 2.0457
## Number of obs: 1080, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 2.30345 0.55017 34.20000 4.187
## Conditionmorph -0.18048 0.24900 1018.00000 -0.725
## Conditionorth -0.55469 0.24900 1018.00000 -2.228
## Conditionsem -0.29760 0.24900 1018.00000 -1.195
## Relatedrel 1.01666 0.29340 118.80000 3.465
## hemisphereleft -0.10785 0.17048 1018.00000 -0.633
## hemisphereright 0.46757 0.17048 1018.00000 2.743
## Conditionmorph:Relatedrel 0.00344 0.35214 1018.00000 0.010
## Conditionorth:Relatedrel -0.53914 0.35214 1018.00000 -1.531
## Conditionsem:Relatedrel -0.80374 0.35214 1018.00000 -2.282
## Pr(>|t|)
## (Intercept) 0.000188 ***
## Conditionmorph 0.468731
## Conditionorth 0.026119 *
## Conditionsem 0.232284
## Relatedrel 0.000738 ***
## hemisphereleft 0.527110
## hemisphereright 0.006200 **
## Conditionmorph:Relatedrel 0.992207
## Conditionorth:Relatedrel 0.126064
## Conditionsem:Relatedrel 0.022668 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns Rltdrl hmsphrl hmsphrr Cndtnm:R
## Conditnmrph -0.226
## Conditinrth -0.226 0.500
## Conditionsm -0.226 0.500 0.500
## Relatedrel -0.380 0.424 0.424 0.424
## hemisphrlft -0.207 0.000 0.000 0.000 0.000
## hemsphrrght -0.207 0.000 0.000 0.000 0.000 0.667
## Cndtnmrph:R 0.160 -0.707 -0.354 -0.354 -0.600 0.000 0.000
## Cndtnrth:Rl 0.160 -0.354 -0.707 -0.354 -0.600 0.000 0.000 0.500
## Cndtnsm:Rlt 0.160 -0.354 -0.354 -0.707 -0.600 0.000 0.000 0.500
## Cndtnr:R
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## Cndtnmrph:R
## Cndtnrth:Rl
## Cndtnsm:Rlt 0.500
lmerTest::anova(cent3.final)
## Analysis of Variance Table of type III with Satterthwaite
## approximation for degrees of freedom
## Sum Sq Mean Sq NumDF DenDF F.value Pr(>F)
## Condition 128.521 42.840 3 1018 10.2367 1.21e-06 ***
## Related 49.144 49.144 1 26 11.7429 0.0020419 **
## hemisphere 77.111 38.555 2 1018 9.2128 0.0001083 ***
## Condition:Related 32.950 10.983 3 1018 2.6245 0.0492813 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
central, 300-500
300-500, posterior
post3.1<-lmer(mean~Condition*Related*hemisphere+(1+Related|subj),post300)
#step(post3.1)
post3.final<-lmer(formula = mean ~ Condition + Related + hemisphere +
(1 + Related | subj) + Condition:Related, data = post300)
summary(post3.final)
## Linear mixed model fit by REML t-tests use Satterthwaite approximations
## to degrees of freedom [lmerMod]
## Formula: mean ~ Condition + Related + hemisphere + (1 + Related | subj) +
## Condition:Related
## Data: post300
##
## REML criterion at convergence: 8495.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.1996 -0.6262 -0.0352 0.6267 5.1788
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## subj (Intercept) 6.707 2.590
## Relatedrel 1.249 1.118 0.32
## Residual 7.347 2.711
## Number of obs: 1728, groups: subj, 27
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 2.80197 0.54329 34.30000 5.157
## Conditionmorph -0.03239 0.26082 1666.00000 -0.124
## Conditionorth -0.24739 0.26082 1666.00000 -0.949
## Conditionsem -0.37583 0.26082 1666.00000 -1.441
## Relatedrel 1.22293 0.33809 84.00000 3.617
## hemisphereleft -1.15316 0.16836 1666.00000 -6.849
## hemisphereright -1.25647 0.16836 1666.00000 -7.463
## Conditionmorph:Relatedrel -0.29350 0.36886 1666.00000 -0.796
## Conditionorth:Relatedrel -0.72625 0.36886 1666.00000 -1.969
## Conditionsem:Relatedrel -0.99688 0.36886 1666.00000 -2.703
## Pr(>|t|)
## (Intercept) 1.05e-05 ***
## Conditionmorph 0.901188
## Conditionorth 0.343011
## Conditionsem 0.149780
## Relatedrel 0.000507 ***
## hemisphereleft 1.04e-11 ***
## hemisphereright 1.35e-13 ***
## Conditionmorph:Relatedrel 0.426324
## Conditionorth:Relatedrel 0.049128 *
## Conditionsem:Relatedrel 0.006949 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cndtnm Cndtnr Cndtns Rltdrl hmsphrl hmsphrr Cndtnm:R
## Conditnmrph -0.240
## Conditinrth -0.240 0.500
## Conditionsm -0.240 0.500 0.500
## Relatedrel 0.003 0.386 0.386 0.386
## hemisphrlft -0.186 0.000 0.000 0.000 0.000
## hemsphrrght -0.186 0.000 0.000 0.000 0.000 0.600
## Cndtnmrph:R 0.170 -0.707 -0.354 -0.354 -0.546 0.000 0.000
## Cndtnrth:Rl 0.170 -0.354 -0.707 -0.354 -0.546 0.000 0.000 0.500
## Cndtnsm:Rlt 0.170 -0.354 -0.354 -0.707 -0.546 0.000 0.000 0.500
## Cndtnr:R
## Conditnmrph
## Conditinrth
## Conditionsm
## Relatedrel
## hemisphrlft
## hemsphrrght
## Cndtnmrph:R
## Cndtnrth:Rl
## Cndtnsm:Rlt 0.500
lmerTest::anova(post3.final)
## Analysis of Variance Table of type III with Satterthwaite
## approximation for degrees of freedom
## Sum Sq Mean Sq NumDF DenDF F.value Pr(>F)
## Condition 206.07 68.689 3 1666 9.349 3.956e-06 ***
## Related 59.98 59.980 1 26 8.164 0.008299 **
## hemisphere 473.77 236.885 2 1666 32.243 1.821e-14 ***
## Condition:Related 63.79 21.263 3 1666 2.894 0.034130 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
posterior, 300-500
Looking at the voltage maps you can see the scalp distribution is similar in id and morph, but the positivity is much greater in id than morph