1 Analyses for Experiment 1

See Analyses file in the Experiment 1 folder

2 Analyses for Experiment 2

See Analyses file in the Experiment 2 folder

3 Analyses for Experiment 3

This file presents the analyses reported in the manuscript titled “Lexical stress representation in Greek spoken word recognition” by Andrikopoulou et al. See the file “mega script.R” for pre-processing of raw data and additional analyses.

load("newcordat.rda")
targettimes <- read.table(paste("TargetTimes3.txt",sep=""),header=T,sep="\t",encoding="UTF-8") 
names(targettimes)[1] <- "Item"
sylbnd <- cbind(tapply(targettimes$Syl1Dur,targettimes$StrPos,mean),
                tapply(targettimes$Syl12Dur,targettimes$StrPos,mean),
                tapply(targettimes$AllDur,targettimes$StrPos,mean))*1000
sylnm  <- c("1st syllable","2nd syllable","Word end")
sylnm2 <- paste(sylnm,"+ 200ms",sep=" ")

3.1 Graph raw data

strpos <- c("fir"="Ant","sec"="Pen","thi"="Fin")
strpof <- c("rst"="Ant","sec"="Pen","ird"="Fin")
avg <- aggregate(cbind(IA_1_P,IA_2_P,IA_3_P,IA_4_P) ~ Time + str_type, data=newcordat, mean, na.rm=TRUE)
avg$trgstr <- strpos[substr(as.character(avg$str_type),1,3)]
avg$cmpstr <- strpof[substr(as.character(avg$str_type),nchar(as.character(avg$str_type))-2,nchar(as.character(avg$str_type)))]

par(mfcol=c(2,3))
par(oma=c(0.5,0.5,0,0.2))
par(mai=c(0.4,0.4,0.3,0.09))
par(mgp=c(2,0.5,0))
par(tcl=-0.35)

for (tpi in 1:3) {
  tp <- strpos[tpi]
  for (pp in strpos[-tpi]) {
    emptyPlot(range(avg$Time), c(0,1),xlab = 'Time from target onset (ms)', ylab = 'Proportion of Looks',
              main=paste(tp,"target,",pp,"competitor"))
    lines(IA_1_P~Time,avg,subset= trgstr==tp & cmpstr==pp,col="turquoise4", lwd = 2)    # Target
    lines(IA_2_P~Time,avg,subset= trgstr==tp & cmpstr==pp,col="turquoise3", lwd = 2)    # Competitor
    lines(IA_3_P~Time,avg,subset= trgstr==tp & cmpstr==pp,col="antiquewhite4", lwd = 2) # Distractor 1
    lines(IA_4_P~Time,avg,subset= trgstr==tp & cmpstr==pp,col="antiquewhite3", lwd = 2) # Distractor 2
  }
}

legend(-325,1.05, ncol=2,legend=c("Target","Competitor", "Distractor 1", "Distractor 2"), bg="white",
       fill=c("turquoise4","turquoise3", "antiquewhite4", "antiquewhite3"), title="Interest Areas", xpd=NA, cex=1)

This is Figure 5 in the submitted manuscript

3.2 Fit model to the target/competitor proportion

See file “mega script.R” in the folder above for additional models and model comparisons.

if (FALSE) { # takes a long time to run
 newm4b <- bam(TargetLooks ~ str_type + s(TRIAL_INDEX) + s(Time)
          +s(Time, by=str_type)
          +s(Time, Subject, bs = 'fs', m = 1)
          +s(Time, Item, bs = 'fs', m = 1),
          data = newcordat, family = "binomial",
          cluster = cl)
 save(newm4b, file = "model_newm4b.rda", compress = 'xz')
} else { load("model_newm4b.rda") }
selmod <- newm4b
summary(newm4b)
## 
## Family: binomial 
## Link function: logit 
## 
## Formula:
## TargetLooks ~ str_type + s(TRIAL_INDEX) + s(Time) + s(Time, by = str_type) + 
##     s(Time, Subject, bs = "fs", m = 1) + s(Time, Item, bs = "fs", 
##     m = 1)
## 
## Parametric coefficients:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)         0.904852   0.251181   3.602 0.000315 ***
## str_typefirstthird  0.357795   0.317999   1.125 0.260527    
## str_typesecfirst    0.041407   0.319819   0.129 0.896986    
## str_typesecthird   -0.051370   0.337369  -0.152 0.878978    
## str_typethirdfirst -0.006381   0.306012  -0.021 0.983363    
## str_typethirdsec    0.058345   0.336193   0.174 0.862221    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Approximate significance of smooth terms:
##                                edf  Ref.df    Chi.sq p-value    
## s(TRIAL_INDEX)               8.992   9.000  5919.494  <2e-16 ***
## s(Time)                      4.070   4.406    15.550  0.0053 ** 
## s(Time):str_typefirstsec     3.954   4.305     4.134  0.4325    
## s(Time):str_typefirstthird   1.856   2.036     1.219  0.5672    
## s(Time):str_typesecfirst     1.000   1.000     0.214  0.6441    
## s(Time):str_typesecthird     6.317   6.605     6.058  0.4068    
## s(Time):str_typethirdfirst   1.012   1.016     0.970  0.3284    
## s(Time):str_typethirdsec     4.137   4.481     7.717  0.1364    
## s(Time,Subject)            352.989 368.000 58932.072  <2e-16 ***
## s(Time,Item)               423.492 453.000 60606.220  <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Rank: 905/906
## R-sq.(adj) =  0.158   Deviance explained = 14.9%
## fREML = 8.523e+05  Scale est. = 1         n = 104946

3.3 Graph target/competitor curves for each stress position

In the first graph, the vertical dotted lines indicate the syllable boundaries, offset by 200 ms to account for saccadic programming. The region marked in red shows the time interval during which the target and competitor curves were significantly different.

par(mfcol=c(2,3))
par(oma=c(0.5,0.5,0,0.2))
par(mai=c(0.4,0.4,0.3,0.09))
par(mgp=c(2,0.5,0))
par(tcl=-0.35)

for (cnd in levels(selmod$model$str_type)) {
  out <- plot_smooth(selmod,view="Time", cond=list(str_type=cnd),ylab="Target vs. competitor looks (log odds)", 
                     main=paste(strpos[substr(cnd,1,3)],"target,",strpof[substr(cnd,nchar(cnd)-2,nchar(cnd))],"competitor"),
                     col="blue",ylim=c(-1,4),rug=F,
                     rm.ranef=TRUE,hide.label=T,print.summary=F)
  (diff <- find_difference(out$fv$fit, out$fv$CI, xVals=out$fv$Time))
  addInterval(0, lowVals=diff$start, highVals = diff$end, col='red', lwd=2)
  abline(v=c(diff$start, diff$end), lty=3, col='red')
  syl <- 4-which(names(strpos)==substr(cnd,1,3))
  abline(v=sylbnd[syl,]+200,lty=3,col="gray50")
  text(sylbnd[syl,]+200,rep(4,3),sylnm2,adj=c(0,1),srt=-90,col="gray50")
}  

This is Figure 6 in the submitted manuscript

In the second graph, the top row shows the curves for the same targets following two different competitors, superimposed. “c” stands for “competitor”. The bottom row plots the difference between the two curves shown on the top row, along with the corresponding confidence interval. Any regions of significant difference are marked in red (none in this case).

par(mfrow=c(2,3))
par(oma=c(0.3,0.2,0,0))
par(mai=c(0.4,0.4,0.2,0.1))
par(mgp=c(2,0.5,0.5))
par(tcl=-0.35)

plot_smooth(selmod,view="Time", cond=list(str_type="firstsec"),ylab="Target vs. competitor looks (log odds)",
            rm.ranef=TRUE,col="red",ylim=c(-1,4),main="Ant targets",rug=F,hide.label=T,print.summary=F)
plot_smooth(selmod,view="Time", cond=list(str_type="firstthird"),
            rm.ranef=TRUE,col="blue",add=T,rug=F,print.summary=F)
text(1000,3.7,"Fin c",adj=c(1,0),col="blue")
text(1000,1.5,"Pen c",adj=c(1,0),col="red")

plot_smooth(selmod,view="Time", cond=list(str_type="secfirst"),ylab="",
            rm.ranef=TRUE,col="blue",ylim=c(-1,4),main="Pen  targets",rug=F,hide.label=T,print.summary=F)
plot_smooth(selmod,view="Time", cond=list(str_type="secthird"),  
            rm.ranef=TRUE,col="red",add=T,rug=F,print.summary=F)
text(1000,1.2,"Ant c",adj=c(1,0),col="blue")
text( 900,3.3,"Fin c",adj=c(1,0),col="red")

plot_smooth(selmod,view="Time", cond=list(str_type="thirdfirst"),ylab="",
            rm.ranef=TRUE,col="red",ylim=c(-1,4),main="Fin  targets",rug=F,hide.label=T,print.summary=F)
plot_smooth(selmod,view="Time", cond=list(str_type="thirdsec"),
            rm.ranef=TRUE,col="blue",add=T,rug=F,print.summary=F)
text(1000,3.3,"Pen c",adj=c(1,0),col="blue")
text(1000,1.4,"Ant c",adj=c(1,0),col="red")

plot_diff(selmod,view="Time",ylab = "Difference in target looks (logits)",comp=list(str_type=c("firstthird","firstsec")),rm.ranef=T,main="Fin minus Pen",ylim=c(-2,2),hide.label=T,print.summary=F)

plot_diff(selmod,view="Time",comp=list(str_type=c("secthird","secfirst")),ylab="",rm.ranef=T,main="Fin minus Ant",ylim=c(-2,2),hide.label=T,print.summary=F)

plot_diff(selmod,view="Time",comp=list(str_type=c("thirdsec","thirdfirst")),ylab="",rm.ranef=T,main="Pen minus Ant",ylim=c(-2,2),hide.label=T,print.summary=F)

This figure was not included in the manuscript.

3.4 Underspecification comparisons

In this graph, each panel contrasts two conditions with opposite target-competitor stress patterns (e.g., Ant target with Pen competitor vs. Pen target with Ant competitor). The top row shows the curves for the two conditions superimposed. The bottom row plots the difference between the two curves shown on the top row, along with the corresponding confidence interval. Any regions of significant difference are marked in red (none in this case). It is in these graphs where any effects of underspecification should be seen, exposing any asymmetry between stress patterns.

par(mfrow=c(2,3))
par(oma=c(0.5,0.5,0,0.2))
par(mai=c(0.4,0.4,0.3,0.09))
par(mgp=c(2,0.5,0))
par(tcl=-0.35)

plot_smooth(selmod,view="Time", cond=list(str_type="firstsec"),rm.ranef=TRUE,col="red", ylab="Target vs. competitor looks (log odds)",
            ylim=c(-1,4),main="Ant vs Pen",rug=F,hide.label=T,print.summary=F)
plot_smooth(selmod,view="Time", cond=list(str_type="secfirst"),rm.ranef=TRUE,col="blue",add=T,rug=F,print.summary=F)
text(1000,1.2,"Pen targ",adj=c(1,0),col="blue")
text(1000,3.3,"Ant targ",adj=c(1,0),col="red")

plot_smooth(selmod,view="Time", cond=list(str_type="thirdsec"),  rm.ranef=TRUE,col="blue", ylab = "", 
            ylim=c(-1,4),main="Fin vs Pen",rug=F,hide.label=T,print.summary=F)
plot_smooth(selmod,view="Time", cond=list(str_type="secthird"),  rm.ranef=TRUE,col="red",add=T,rug=F,print.summary=F)
text(1000,1.2,"Fin targ",adj=c(1,0),col="blue")
text(1000,3.4,"Pen targ",adj=c(1,0),col="red")

plot_smooth(selmod,view="Time", cond=list(str_type="thirdfirst"),rm.ranef=TRUE,col="red",ylab = "", 
            ylim=c(-1,4),main="Ant vs Final",rug=F,hide.label=T,print.summary=F)
plot_smooth(selmod,view="Time", cond=list(str_type="firstthird"),rm.ranef=TRUE,col="blue",add=T,rug=F,print.summary=F)
text(1000,1.4,"Fin targ",adj=c(1,0),col="red")
text(1000,3.8,"Ant targ",adj=c(1,0),col="blue")

plot_diff(selmod,view="Time",comp=list(str_type=c("firstsec","secfirst")),ylab="Difference in target looks (logits)", 
          rm.ranef=T,main="Ant target minus Pen target",ylim=c(-2,2),hide.label=T,print.summary=F)

plot_diff(selmod,view="Time",comp=list(str_type=c("thirdsec","secthird")),ylab="", 
          rm.ranef=T,main="Fin target minus Pen target",ylim=c(-2,2),hide.label=T,print.summary=F)

plot_diff(selmod,view="Time",comp=list(str_type=c("firstthird","thirdfirst")),ylab="", 
          rm.ranef=T,main="Ant target minus Final target",ylim=c(-2,2),hide.label=T,print.summary=F)

This is Figure 7 in the submitted manuscript.

3.5 Session information

sessionInfo()
## R version 3.6.2 (2019-12-12)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 18363)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_United States.1252 
## [2] LC_CTYPE=English_United States.1252   
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                          
## [5] LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] parallel  stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
## [1] gtools_3.8.1      itsadug_2.3       plotfunctions_1.3 mgcv_1.8-31      
## [5] nlme_3.1-144     
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.3      lattice_0.20-40 digest_0.6.25   grid_3.6.2     
##  [5] magrittr_1.5    evaluate_0.14   rlang_0.4.2     stringi_1.4.6  
##  [9] Matrix_1.2-18   rmarkdown_2.1   splines_3.6.2   tools_3.6.2    
## [13] stringr_1.4.0   xfun_0.12       yaml_2.2.1      compiler_3.6.2 
## [17] htmltools_0.4.0 knitr_1.28