Analysis walkthrough for the paper “Good-enough production: Selecting easier words instead of accurate ones.” (authors removed, 2020).

See WordChoice_codebook for information about individual columns.

We first load all data across Experiments 1-4.

all_data <- read.csv(here::here("processed_data","Words_final_preprocessed.csv"))

Functions

This section defines a series of functions that are reused across the analyses. In general, we analyze the data in the same way across all four experiments - therefore, wrapping particular summary and plotting steps in single functions reduces code redundancy. Refer to these functions to inspect how particular data is plotted and how descriptives are computed

Functions for descriptives

#summarize subject accuracy by frequency by block
subject_accuracy_by_frequency_by_block <- function(experiment_data) {
  subjAccFreq <- experiment_data %>%
  group_by(subjCode,block,freq) %>%
  summarize(
    accuracy=mean(isRight,na.rm=T),
    all_rt = mean(rt,na.rm=T),
    correct_rt = mean(rt[isRight==1],na.rm=T)) %>%
  ungroup()
  subjAccFreq
}

#summarize within subject 95% CIs
summary_se_within_cis <- function(data,measurevar, betweenvars=NULL, withinvars=NULL,idvar=NULL, na.rm=FALSE, conf.interval=.95) {
  summarized_data <- summarySEwithin(data=data,measurevar=measurevar,withinvars=withinvars,idvar=idvar,na.rm=na.rm, conf.interval=conf.interval) %>%
    mutate(
      lowerCI = !!as.name({{ measurevar }}) - ci,
      upperCI = !!as.name({{ measurevar }}) + ci
    ) %>%
    select(-se, -sd,-ci,-!!as.name(paste0({{ measurevar }},"_norm")))
} 

Functions for plotting

#### Plotting Accuracy and RT for Participants' final retention ####
final_retention_plot <- function(
  summarized_accuracy_data,
  subject_accuracy_data,
  summarized_rt_data,
  subject_rt_data,
  plot_path
  ) {
  #accuracy plot
  p1 <- ggplot(summarized_accuracy_data,aes(freq,accuracy,color=freq,fill=freq))+
  geom_bar(stat="identity",alpha=0.5,size=1.2)+ 
  geom_jitter(data=subject_accuracy_data,width=0.2,height=0.03)+
  geom_errorbar(aes(ymin=lowerCI,ymax=upperCI),width=0.05,color="black",size=1.2)+
    #scale_color_brewer(palette="Set1",name="Frequency",
  #                   breaks=c("hf","lf"),
  #                   labels=c("high-frequency","low-frequency"))+
  scale_color_manual(values = c("#E41A1C","#377EB8"),
                     #values = c("#E41A1C","#BDE0ED"),
                    name="Frequency",
                     breaks=c("hf","lf"),
                     labels=c("high-frequency","low-frequency"))+
  # scale_fill_brewer(palette="Set1",name="Frequency",
  #                   breaks=c("hf","lf"),
  #                   labels=c("high-frequency","low-frequency"))+
  scale_fill_manual(values = c("#E41A1C","#BDE0ED"),
                    name="Frequency",
                     breaks=c("hf","lf"),
                     labels=c("high-frequency","low-frequency"))+
  scale_x_discrete(name="Frequency",breaks=c("hf","lf"),labels=c("high-\nfrequency","low-\nfrequency"))+
  theme_classic(base_size=20)+
  theme(legend.position="none")+
  ylim(0,1.05)
#rt plot
p2 <- ggplot(summarized_rt_data,aes(freq,correct_rt,color=freq,fill=freq))+
  geom_bar(stat="identity",alpha=0.5,size=1.2)+ 
  geom_violin(data=subject_rt_data,fill=NA,alpha=0)+
  geom_jitter(data=subject_rt_data,width=0.2,height=0.03)+
  geom_errorbar(aes(ymin=lowerCI,ymax=upperCI),width=0.05,color="black",size=1.2)+
    #scale_color_brewer(palette="Set1",name="Frequency",
  #                   breaks=c("hf","lf"),
  #                   labels=c("high-frequency","low-frequency"))+
  scale_color_manual(values = c("#E41A1C","#377EB8"),
                     #values = c("#E41A1C","#BDE0ED"),
                    name="Frequency",
                     breaks=c("hf","lf"),
                     labels=c("high-frequency","low-frequency"))+
  # scale_fill_brewer(palette="Set1",name="Frequency",
  #                   breaks=c("hf","lf"),
  #                   labels=c("high-frequency","low-frequency"))+
  scale_fill_manual(values = c("#E41A1C","#BDE0ED"),
                    name="Frequency",
                     breaks=c("hf","lf"),
                     labels=c("high-frequency","low-frequency"))+
  scale_x_discrete(name="Frequency",breaks=c("hf","lf"),labels=c("high-\nfrequency","low-\nfrequency"))+
  ylab("Reaction Time (ms)")+
  theme_classic(base_size=20)+
  theme(legend.position="none")
p <- plot_grid(p1,p2)
#save plot
ggsave(plot_path,plot=p,width=9, height=6)
#return plot
return(p)
}

#### Plotting the frequency effect on word choice ####
#three different plotting options for the same effect
plot_frequency_effect <- function(
  experiment_data,
  predicted_data,
  plot_option=c("plot1","plot2","plot3"),
  plot_path
  ) {
#plot one of three different design options
  if (plot_option=="plot1") {
    # Plot 1
    p <- ggplot(subset(experiment_data,trialType=="test"&!is.na(matchChoice)),aes(angleDiffFromMatch,matchChoice,color=as.character(hfTrial)))+
      geom_jitter(width=0.5,height=0.03,alpha=0.2)+
      #geom_violinh(aes(y=as.factor(matchChoice),fill=as.character(hfTrial)),scale="count",width=0.3,alpha=0.3,color=NA)+
      #geom_violinhalf(aes(y=as.factor(matchChoice),fill=as.character(hfTrial)),scale="count",width=0.3,alpha=0.3,color=NA,orientation="y")+
      geom_smooth(data=predicted_data,aes(y=fit,ymax=fit+se.fit,ymin=fit-se.fit,fill=as.character(hfTrial)),stat="identity")+
      theme_classic(base_size=18)+
      ylab("Probability of choosing\nnearest compass direction")+
      # scale_color_brewer(
      #   palette="Set1",name="Frequency of Nearest Word",
      #   breaks=c(0.5,-0.5),
      #   labels=c("High-Frequency","Low-Frequency"),
      #   direction=-1)+
      scale_color_manual(
        values = c("#E41A1C","#377EB8"),
        name="Frequency of Compass Direction",
        breaks=c(0.5,-0.5),
        labels=c("High-Frequency","Low-Frequency"))+
      # scale_fill_brewer(
      #   palette="Set1",
      #   name="Frequency of Nearest Compass Direction",
      #   breaks=c(0.5,-0.5),
      #   labels=c("High-Frequency","Low-Frequency"),direction=-1)+
      scale_fill_manual(
        values = c("#E41A1C","#BDE0ED"),
        name="Frequency of Compass Direction",
        breaks=c(0.5,-0.5),
        labels=c("High-Frequency","Low-Frequency"))+
      xlab("Distance from nearest compass direction")+
      geom_vline(xintercept=22.5,linetype="dashed")+
      theme(legend.position=c(0.4,0.4))#+
      #ylim(-0.05,1.05)
    #plot_path format: here::here("plots","exp#_frequencyEffect_old.jpg")
  } else if (plot_option=="plot2") {
    #Plot 2
    p <- ggplot(subset(experiment_data,trialType=="test"&!is.na(matchChoice)),aes(angleDiffFromMatch,as.factor(matchChoice),color=as.character(hfTrial)))+
      geom_point(size = 0.5, alpha=0.3,shape=19,position  = position_jitterdodge(jitter.width = 0.05,jitter.height = 0.5,dodge.width = 0.2,seed = 1))+
      geom_violinh(data=subset(experiment_data, trialType=="test"&!is.na(matchChoice)&hfTrial==0.5),aes(fill=as.character(hfTrial)),position = position_nudge(x = 0, y = .3 ),scale="count",width=0.4,alpha=0.5,color=NA)+
      geom_violinh(data=subset(experiment_data, trialType=="test"&!is.na(matchChoice)&hfTrial==-0.5),aes(fill=as.character(hfTrial)),position = position_nudge(x = 0, y = -.3 ),scale="count",width=0.4,alpha=0.5,color=NA)+
      geom_smooth(data=predicted_data,aes(y=fit*4+1,ymax=(fit+se.fit)*4+1,ymin=(fit-se.fit)*4+1,fill=as.character(hfTrial)),stat="identity")+
      theme_classic(base_size=18)+
      ylab("Probability of choosing\nnearest compass direction")+
      # scale_color_brewer(
      #   palette="Set1",
      #   name="Frequency of Nearest Word",
      #   breaks=c(0.5,-0.5),
      #   labels=c("High-Frequency","Low-Frequency"),direction=-1)+
      scale_color_manual(
        values = c("#E41A1C","#377EB8"),
        name="Frequency of Compass Direction",
        breaks=c(0.5,-0.5),
        labels=c("High-Frequency","Low-Frequency"))+
      # scale_fill_brewer(
      #   palette="Set1",
      #   name="Frequency of Nearest Compass Direction",
      #   breaks=c(0.5,-0.5),
      #   labels=c("High-Frequency","Low-Frequency"),
      #   direction=-1)+
      scale_fill_manual(
        values = c("#E41A1C","#BDE0ED"),
        name="Frequency of Compass Direction",
        breaks=c(0.5,-0.5),
        labels=c("High-Frequency","Low-Frequency"))+
      scale_y_discrete(limits=c("0","0.25","0.5","0.75","1"))+
      xlab("Distance from nearest compass direction")+
      geom_vline(xintercept=22.5,linetype="dashed")+
      theme(legend.position=c(0.4,0.4))
    #plot_path format: here::here("plots","exp#_frequencyEffect.jpg")
  } else if (plot_option=="plot3") {
    # Plot 3
    p <- ggplot(subset(experiment_data, trialType=="test"&!is.na(matchChoice)),aes(angleDiffFromMatch,as.factor(matchChoice),color=as.character(hfTrial)))+
      geom_point(size = 0.5, shape=19,alpha=0.2,position = position_jitterdodge(jitter.width = 0.05,jitter.height = 0.5,dodge.width = 1.2,seed = 1))+
      geom_violinh(data=subset(experiment_data, trialType=="test"&!is.na(matchChoice)&hfTrial==0.5),aes(fill=as.character(hfTrial)),position = position_nudge(x = 0, y = .3 ),scale="count",width=0.75,alpha=0.4, color=NA)+
      geom_violinh(data=subset(experiment_data, trialType=="test"&!is.na(matchChoice)&hfTrial==-0.5),aes(fill=as.character(hfTrial)),position = position_nudge(x = 0, y = -.3 ),scale="count",width=0.75,alpha=0.4,color=NA)+
      geom_smooth(data=predicted_data,aes(y=fit*4+1,ymax=(fit+se.fit)*4+1,ymin=(fit-se.fit)*4+1,fill=as.character(hfTrial)),stat="identity")+
      theme_classic(base_size=18)+
      ylab("Probability of choosing\nnearest compass direction")+
      # scale_color_brewer(
      #   palette="Set1",
      #   name="Frequency of Nearest Word",
      #   breaks=c(0.5,-0.5),
      #   labels=c("High-Frequency","Low-Frequency"),
      #   direction=-1)+
      scale_color_manual(
        values = c("#E41A1C","#377EB8"),
        name="Frequency of Compass Direction",
        breaks=c(0.5,-0.5),
        labels=c("High-Frequency","Low-Frequency"))+
      # scale_fill_brewer(
      #   palette="Set1",
      #   name="Frequency of Nearest Compass Direction",
      #   breaks=c(0.5,-0.5),
      #   labels=c("High-Frequency","Low-Frequency"),
      #   direction=-1)+
      scale_fill_manual(
        values = c("#E41A1C","#BDE0ED"),
        name="Frequency of Compass Direction",
        breaks=c(0.5,-0.5),
        labels=c("High-Frequency","Low-Frequency"))+
      scale_y_discrete(limits=c("0","0.25","0.5","0.75","1"))+
      xlab("Distance from nearest compass direction")+
      geom_vline(xintercept=22.5,linetype="dashed")+
      theme(legend.position=c(0.4,0.4))
    #plot_path format: here::here("plots","exp#_frequencyEffect_alternate.jpg")
  }
  ggsave(plot_path, plot=p,width=9, height=6)
  return(p)
}

Demographics

Summarize demographic information about participants

#demographics and by-subject accuracy for each block
subjDemographics <- all_data %>%
  select(version,subjCode,Gender,Age,NativeLang,SecondLangYN) %>%
  unique() %>%
  group_by(version) %>%
  summarize(
    N=n(),
    gender_f=sum(Gender=="Female"),
    mean_age=round(mean(Age,na.rm=T),2),
    sd_age=round(sd(Age,na.rm=T),2),
    min_age=round(min(Age,na.rm=T),2),
    max_age=round(max(Age,na.rm=T),2),
    native_english=sum(NativeLang=="Yes"),
    language_besides_english=sum(SecondLangYN=="Yes"),
  )

Experiment 1

Overview over the demographics of participants in Experiment 1.

subjDemographics %>%
  filter(version=="exp1") %>%
  kable()
version N gender_f mean_age sd_age min_age max_age native_english language_besides_english
exp1 39 25 18.85 0.84 18 21 38 9

Experiment 2

Overview over the demographics of participants in Experiment 2.

subjDemographics %>%
  filter(version=="exp2") %>%
  kable()
version N gender_f mean_age sd_age min_age max_age native_english language_besides_english
exp2 44 26 18.45 0.87 18 23 43 5

Experiment 3

Overview over the demographics of participants in Experiment 3.

subjDemographics %>%
  filter(version=="exp3") %>%
  kable()
version N gender_f mean_age sd_age min_age max_age native_english language_besides_english
exp3 55 38 18.87 0.88 18 22 54 6

Experiment 4

Overview over the demographics of participants in Experiment 4.

subjDemographics %>%
  filter(version=="exp4") %>%
  kable()
version N gender_f mean_age sd_age min_age max_age native_english language_besides_english
exp4 43 24 18.72 0.88 18 21 43 5

Word Training Accuracy

Compute overview of participants’ performance during the Training Phase in which word participants learn each of the 8 compass directions.

#generate summary of learning block numbers
subj_block_numbers <- all_data %>%
  filter(trialType=="pairLearn"|trialType=="name") %>%
  group_by(version,subjCode) %>%
  summarize(
    num_pairlearn_blocks=max(pairLearnBlockNum,na.rm=T),
    num_name_blocks=max(nameBlockNum,na.rm=T),
  )
#combine with main data frame (for later covariate analysis)
all_data <- all_data %>%
  left_join(subj_block_numbers)

#generate by-subject accuracy for each block (repeated training blocks are averaged together)
subjAcc <- all_data %>%
  group_by(version,subjCode,trialType) %>%
  summarize(
    accuracy=mean(isRight,na.rm=T),
    numTrials=sum(!is.na(subjCode)),
    rt = mean(rt[isRight==1],na.rm=T)) %>%
  ungroup()

#Overall Accuracy Pair Learning
overallPairAcc <- subjAcc %>%
  group_by(version) %>%
  filter(trialType=="pairLearn") %>%
  summarize(
    acc=mean(accuracy,na.rm=T),
    sd = sd(accuracy),
    num_trials_avg = mean(numTrials),
    num_trials_sd = sd(numTrials),
    num_blocks_avg = mean(numTrials/20),
    num_blocks_sd= sd(numTrials/20))

Also compute training accuracy and recall by block to see the general trajectory of learning (reported in supplementary materials).

#pair learning over time
#summarize by block
subj_pair_accuracy_by_block <- all_data %>%
  filter(trialType=="pairLearn"&!is.na(pairLearnBlockNum)) %>%
  group_by(version,subjCode,pairLearnBlockNum) %>%
  summarize(
    accuracy=mean(isRight,na.rm=T),
    numTrials=sum(!is.na(subjCode))) %>%
  ungroup()

# recall by block
subj_training_recall_by_block <- all_data %>%
  filter(trialType=="name"&!is.na(nameBlockNum)) %>%
  group_by(version,subjCode,nameBlockNum) %>%
  summarize(
    accuracy=mean(isRight,na.rm=T),
    numTrials=sum(!is.na(subjCode))) %>%
  ungroup()

Experiment 1

Word Training Overall Accuracy

overallPairAcc %>%
  filter(version=="exp1") %>%
  kable()
version acc sd num_trials_avg num_trials_sd num_blocks_avg num_blocks_sd
exp1 0.9520604 0.0308001 91.79487 38.58496 4.589744 1.929248

Word Training Accuracy by Block

overall_pair_accuracy_by_block <- subj_pair_accuracy_by_block %>%
  summarySEwithin(measurevar="accuracy",betweenvars=c("version"),withinvars=c("pairLearnBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(pairLearnBlockNum=as.numeric(as.character(pairLearnBlockNum)))


#summarized accuracy by block
overall_pair_accuracy_by_block_exp1 <- subj_pair_accuracy_by_block %>%
  filter(version=="exp1") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("pairLearnBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(pairLearnBlockNum=as.numeric(as.character(pairLearnBlockNum)))


#plot; each subject is a line
pair_accuracy_by_block_exp1 <- ggplot(overall_pair_accuracy_by_block_exp1,aes(pairLearnBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.8))+
  scale_x_continuous(breaks=1:20)+
  scale_y_continuous(breaks=seq(0.5,1,0.1))+
  coord_cartesian(ylim = c(0.45, 1.05))+
  geom_hline(yintercept=0.5,linetype="dashed")+
  annotate("text",x=2,y=0.55,label="chance")+
  xlab("Word Learning Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
pair_accuracy_by_block_exp1

Word Recall by Block

overall_training_recall_by_block_exp1 <- subj_training_recall_by_block %>%
  filter(version=="exp1") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("nameBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(nameBlockNum=as.numeric(as.character(nameBlockNum)))

#plot; each subject is a line
training_recall_by_block_exp1 <- ggplot(overall_training_recall_by_block_exp1,aes(nameBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.25))+
  scale_x_continuous(breaks=1:20)+
  xlab("Training - Word Recall Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
training_recall_by_block_exp1

Experiment 2

Word Training Overall Accuracy

overallPairAcc %>%
  filter(version=="exp2") %>%
  kable()
version acc sd num_trials_avg num_trials_sd num_blocks_avg num_blocks_sd
exp2 0.958008 0.0324513 87.27273 52.48981 4.363636 2.62449

Word Training Accuracy by Block

overall_pair_accuracy_by_block_exp2 <- subj_pair_accuracy_by_block %>%
  filter(version=="exp2") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("pairLearnBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(pairLearnBlockNum=as.numeric(as.character(pairLearnBlockNum)))

#one plot each subject is a line
pair_accuracy_by_block_exp2 <- ggplot(overall_pair_accuracy_by_block_exp2,aes(pairLearnBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.8))+
  scale_x_continuous(breaks=1:20)+
  scale_y_continuous(breaks=seq(0.5,1,0.1))+
  coord_cartesian(ylim = c(0.45, 1.05))+
  geom_hline(yintercept=0.5,linetype="dashed")+
  annotate("text",x=2,y=0.55,label="chance")+
  xlab("Word Learning Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
pair_accuracy_by_block_exp2

Word Recall by Block

overall_training_recall_by_block_exp2 <- subj_training_recall_by_block %>%
  filter(version=="exp2") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("nameBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(nameBlockNum=as.numeric(as.character(nameBlockNum)))

#one plot each subject is a line
training_recall_by_block_exp2 <- ggplot(overall_training_recall_by_block_exp2,aes(nameBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.25))+
  scale_x_continuous(breaks=1:20)+
  xlab("Training - Word Recall Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
training_recall_by_block_exp2

Experiment 3

Word Training Overall Accuracy

overallPairAcc %>%
  filter(version=="exp3") %>%
  kable()
version acc sd num_trials_avg num_trials_sd num_blocks_avg num_blocks_sd
exp3 0.9441321 0.0415011 92.72727 39.88198 4.636364 1.994099

Word Training Accuracy by Block

overall_pair_accuracy_by_block_exp3 <- subj_pair_accuracy_by_block %>%
  filter(version=="exp3") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("pairLearnBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(pairLearnBlockNum=as.numeric(as.character(pairLearnBlockNum)))

pair_accuracy_by_block_exp3 <- ggplot(overall_pair_accuracy_by_block_exp3,aes(pairLearnBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.8))+
  scale_x_continuous(breaks=1:20)+
  scale_y_continuous(breaks=seq(0.5,1,0.1))+
  coord_cartesian(ylim = c(0.45, 1.05))+
  geom_hline(yintercept=0.5,linetype="dashed")+
  annotate("text",x=2,y=0.55,label="chance")+
  xlab("Word Learning Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
pair_accuracy_by_block_exp3

Word Recall by Block

overall_training_recall_by_block_exp3 <- subj_training_recall_by_block %>%
  filter(version=="exp3") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("nameBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(nameBlockNum=as.numeric(as.character(nameBlockNum)))

training_recall_by_block_exp3 <- ggplot(overall_training_recall_by_block_exp3,aes(nameBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.25))+
  scale_x_continuous(breaks=1:20)+
  xlab("Training - Word Recall Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
training_recall_by_block_exp3

Experiment 4

Word Training Overall Accuracy

overallPairAcc %>%
  filter(version=="exp4") %>%
  kable()
version acc sd num_trials_avg num_trials_sd num_blocks_avg num_blocks_sd
exp4 0.93 0.0767184 100 0 5 0

Word Training Accuracy by Block

overall_pair_accuracy_by_block_exp4 <- subj_pair_accuracy_by_block %>%
  filter(version=="exp4") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("pairLearnBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(pairLearnBlockNum=as.numeric(as.character(pairLearnBlockNum)))

pair_accuracy_by_block_exp4 <- ggplot(overall_pair_accuracy_by_block_exp4,aes(pairLearnBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.8))+
  scale_x_continuous(breaks=1:20)+
  scale_y_continuous(breaks=seq(0.5,1,0.1))+
  coord_cartesian(ylim = c(0.45, 1.05))+
  geom_hline(yintercept=0.5,linetype="dashed")+
  annotate("text",x=2,y=0.55,label="chance")+
  xlab("Word Learning Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
pair_accuracy_by_block_exp4

Word Recall by Block

overall_training_recall_by_block_exp4 <- subj_training_recall_by_block %>%
  filter(version=="exp4") %>%
  summarySEwithin(measurevar="accuracy",withinvars=c("nameBlockNum"),idvar="subjCode") %>%
  mutate(lower_ci=accuracy-ci,
         upper_ci=accuracy+ci) %>%
  mutate(nameBlockNum=as.numeric(as.character(nameBlockNum)))

training_recall_by_block_exp4 <- ggplot(overall_training_recall_by_block_exp4,aes(nameBlockNum,y=accuracy,label=N))+
  geom_point()+
  geom_line()+
  geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
  geom_label(aes(y=0.25))+
  scale_x_continuous(breaks=1:20)+
  xlab("Training - Word Recall Block")+
  ylab("Accuracy")+
  ylim(0,1.05)
training_recall_by_block_exp4

Compass Training

In Experiment 4, participants were first familiarized with the compass directions in order to unconfound visual familiarity with specific compass directions with naming experience with those compass directions. During Compass Practice Block, the compass directions for which a high-frequency name would later be assigned appeared four times less than the compass directions for which a low-frequency name would be assigned in a training task that did not involve assigning names to the compass direction.

Below, we verify visually that the manipulation was appropriately applied to each participant (to unconfound visual familiarity and naming experience), and summarize participants’ performance during the compass direction memory task.

#manipulation check
#is angle frequency expsoure during learning balanced
ggplot(subset(all_data, version=="exp4" &trialType=="pairLearn"|trialType=="nonvLearn"),aes(angle,fill=trialType))+
  geom_histogram(position=position_dodge())+
  facet_wrap(~subjCode)

ggsave(here::here("plots","exp4_learningAnglesManCheck.jpg"), width=9, height=6)

#generate by-subject accuracy for each block (repeated training blocks are averaged together)
subjAcc <- all_data %>%
  filter(version=="exp4") %>%
  group_by(subjCode,trialType) %>%
  summarize(
    accuracy=mean(isRight,na.rm=T),
    numTrials=sum(!is.na(subjCode)),
    rt = mean(rt[isRight==1],na.rm=T)) %>%
  ungroup()

#accuracy on angle memory task
overallNonVLearn <- subjAcc %>%
  filter(trialType=="nonvLearn") %>%
  summarize(acc=mean(accuracy,na.rm=T),
            sd = sd(accuracy),
            rt=mean(rt))

kable(overallNonVLearn)
acc sd rt
0.9765116 0.0382899 1607.896

All Exps (1-4)

Word Training Accuracy by Block

plot_grid(
  pair_accuracy_by_block_exp1,
  pair_accuracy_by_block_exp2,
  pair_accuracy_by_block_exp3,
  pair_accuracy_by_block_exp4,
  ncol=2,
  labels=c("A","B","C","D"))

ggsave(here::here("plots","pair_accuracy_by_block.jpg"), width=9, height=6)

Word Recall by Block

plot_grid(
  training_recall_by_block_exp1,
  training_recall_by_block_exp2,
  training_recall_by_block_exp3,
  training_recall_by_block_exp4,
  ncol=2,
  labels=c("A","B","C","D"))

ggsave(here::here("plots","training_recall_by_block.jpg"), width=9, height=6)

Final word retention

Participants’ performance during the Timed and Untimed Retention test at the conclusion of the experiment.

Experiment 1

Timed Retention Test

Accuracy

Descriptives
#summarize subject accuracy by frequency
subjAccFreq_exp1 <- all_data %>%
  filter(version=="exp1") %>%
  subject_accuracy_by_frequency_by_block()

testXAcc_exp1 <-  summary_se_within_cis(data=subset(subjAccFreq_exp1,block=="test_x"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
testXAcc_exp1 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 39 0.9166667 0.8658375 0.9674958
lf 39 0.8461538 0.7953247 0.8969830

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp1,block=="test_x")$accuracy[subset(subjAccFreq_exp1,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp1,block=="test_x")$accuracy[subset(subjAccFreq_exp1,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp1, block == "test_x")$accuracy[subset(subjAccFreq_exp1, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp1, block == "test_x")$accuracy[subset(subjAccFreq_exp1, block == "test_x")$freq == "lf"]
## t = 1.9858, df = 38, p-value = 0.05431
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.001370471  0.142396112
## sample estimates:
## mean of the differences 
##              0.07051282
Logistic mixed-effects model
#center frequency condition
all_data <- all_data %>%
  mutate(freqC=case_when(
    freq=="hf" ~ 0.5,
    freq=="lf" ~ -0.5,
    TRUE ~ NA_real_))
#logistic mixed-effects model
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp1" & block=="test_x"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp1" & block == "test_x")
## 
##      AIC      BIC   logLik deviance df.resid 
##    238.7    268.6   -111.3    222.7      304 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.5682  0.2807  0.3205  0.3866  0.5396 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept) 0.030312 0.17410       
##               freqC       0.131484 0.36261  -1.00
##  nearestLabel (Intercept) 0.169568 0.41179       
##               freqC       0.003578 0.05982  -1.00
## Number of obs: 312, groups:  subjCode, 39; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   2.1289     0.2463   8.643   <2e-16 ***
## freqC         0.5919     0.4543   1.303    0.193    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.084

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
testXRT_exp1 <-  summary_se_within_cis(subset(subjAccFreq_exp1,block=="test_x"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
testXRT_exp1 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 39 2315.379 2172.66 2458.099
lf 39 2583.139 2440.42 2725.859

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp1,block=="test_x")$correct_rt[subset(subjAccFreq_exp1,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp1,block=="test_x")$correct_rt[subset(subjAccFreq_exp1,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp1, block == "test_x")$correct_rt[subset(subjAccFreq_exp1, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp1, block == "test_x")$correct_rt[subset(subjAccFreq_exp1, block == "test_x")$freq == "lf"]
## t = -2.6856, df = 38, p-value = 0.01067
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -469.5958  -65.9240
## sample estimates:
## mean of the differences 
##               -267.7599
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp1" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp1" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 4446.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.9372 -0.6763 -0.2172  0.4986  3.1246 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev.  Corr 
##  subjCode     (Intercept) 1.311e+05 3.621e+02      
##               freqC       2.000e+04 1.414e+02 -1.00
##  nearestLabel (Intercept) 3.567e+04 1.889e+02      
##               freqC       8.214e-05 9.063e-03 1.00 
##  Residual                 5.608e+05 7.489e+02      
## Number of obs: 275, groups:  subjCode, 39; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2426.41      86.44   30.28  28.071   <2e-16 ***
## freqC        -205.32      97.51  119.98  -2.106   0.0373 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.176
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, version=="exp1" & block=="test_x"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
all_data <- all_data %>%
  mutate(
    log_rt = log(rt)
  )
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp1" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp1" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 152.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.4487 -0.6764 -0.1034  0.6295  2.4667 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev. Corr 
##  subjCode     (Intercept) 1.624e-02 0.127430      
##               freqC       4.464e-04 0.021129 -1.00
##  nearestLabel (Intercept) 6.155e-03 0.078456      
##               freqC       5.294e-06 0.002301 1.00 
##  Residual                 8.372e-02 0.289341      
## Number of obs: 275, groups:  subjCode, 39; nearestLabel, 18
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   7.73635    0.03280  28.01270 235.858   <2e-16 ***
## freqC        -0.07756    0.03689 198.56254  -2.102   0.0368 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.067
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

final_retention_plot(
  testXAcc_exp1, #summarized accuracy data
  subset(subjAccFreq_exp1, block=="test_x"), #subject accuracy data
  testXRT_exp1, #summarized RT data
  subset(subjAccFreq_exp1, block=="test_x"), # subject RT data
  plot_path = here::here("plots","exp1_testXCheck.jpg")
  )

Untimed Retention Test

Participants’ performance on the Untimed Retention test at the conclusion of the experiment.

Accuracy

Descriptives
# accuracy
nameCheckAcc_exp1 <-  summary_se_within_cis(subset(subjAccFreq_exp1,block=="name_check"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
nameCheckAcc_exp1 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 39 0.974359 0.9480659 1.000652
lf 39 0.974359 0.9480659 1.000652

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp1,block=="name_check")$accuracy[subset(subjAccFreq_exp1,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp1,block=="name_check")$accuracy[subset(subjAccFreq_exp1,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp1, block == "name_check")$accuracy[subset(subjAccFreq_exp1, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp1, block == "name_check")$accuracy[subset(subjAccFreq_exp1, block == "name_check")$freq == "lf"]
## t = 0, df = 38, p-value = 1
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.03718399  0.03718399
## sample estimates:
## mean of the differences 
##                       0
Logistic mixed-effects model
#logistic mixed-effects model
#maximal random effects structure does not converge, therefore pruning by-item random slope to allow model convergence
#m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp1" & block=="name_check"),family=binomial)
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1|target),data=filter(all_data,version=="exp1" & block=="name_check"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 | target)
##    Data: filter(all_data, version == "exp1" & block == "name_check")
## 
##      AIC      BIC   logLik deviance df.resid 
##     69.9     92.4    -29.0     57.9      306 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.91256  0.00260  0.00487  0.00875  1.13703 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept) 32.82    5.729         
##           freqC       85.09    9.224    -0.11
##  target   (Intercept) 11.88    3.446         
## Number of obs: 312, groups:  subjCode, 39; target, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)   11.173      4.368   2.558   0.0105 *
## freqC         -1.124      3.698  -0.304   0.7611  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.269

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
nameCheckRT_exp1 <-  summary_se_within_cis(subset(subjAccFreq_exp1,block=="name_check"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
nameCheckRT_exp1 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 39 2725.646 2469.744 2981.548
lf 39 3050.471 2794.568 3306.373

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp1,block=="name_check")$correct_rt[subset(subjAccFreq_exp1,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp1,block=="name_check")$correct_rt[subset(subjAccFreq_exp1,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp1, block == "name_check")$correct_rt[subset(subjAccFreq_exp1, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp1, block == "name_check")$correct_rt[subset(subjAccFreq_exp1, block == "name_check")$freq == "lf"]
## t = -1.817, df = 38, p-value = 0.07711
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -686.7248   37.0757
## sample estimates:
## mean of the differences 
##               -324.8245
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data, version=="exp1" & block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp1" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 5262.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7032 -0.5072 -0.2607  0.2267  6.8077 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept)  615775   784.7        
##           freqC        404316   635.9   -0.58
##  target   (Intercept)   34888   186.8        
##           freqC         23498   153.3   -1.00
##  Residual             1670219  1292.4        
## Number of obs: 304, groups:  subjCode, 39; target, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2884.89     152.75   35.37  18.886   <2e-16 ***
## freqC        -295.40     186.49   32.44  -1.584    0.123    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.324
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data,version=="exp1" & block=="name_check"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp1"& block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp1" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 305.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.5345 -0.5745 -0.1300  0.4242  3.1216 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept) 0.051083 0.22601       
##           freqC       0.038302 0.19571  -0.11
##  target   (Intercept) 0.007926 0.08903       
##           freqC       0.003501 0.05917  -1.00
##  Residual             0.116586 0.34145       
## Number of obs: 304, groups:  subjCode, 39; target, 18
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.86426    0.04633 38.47784 169.759   <2e-16 ***
## freqC       -0.08840    0.05362 34.82829  -1.649    0.108    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.178
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  nameCheckAcc_exp1, #summarized accuracy data
  subset(subjAccFreq_exp1,block=="name_check"), #subject accuracy data
  nameCheckRT_exp1, #summarized RT data
  subset(subjAccFreq_exp1,block=="name_check"), # subject RT data
  here::here("plots","exp1_finalNameCheck.jpg")
  )

Experiment 2

Timed Retention Test

Accuracy

Descriptives
#summarize subject accuracy by frequency
subjAccFreq_exp2 <- all_data %>%
  filter(version=="exp2") %>%
  subject_accuracy_by_frequency_by_block()

testXAcc_exp2 <-  summary_se_within_cis(data=subset(subjAccFreq_exp2,block=="test_x"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
testXAcc_exp2 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 44 0.9375000 0.8881997 0.9868003
lf 44 0.8465909 0.7972906 0.8958912

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp2,block=="test_x")$accuracy[subset(subjAccFreq_exp2,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp2,block=="test_x")$accuracy[subset(subjAccFreq_exp2,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp2, block == "test_x")$accuracy[subset(subjAccFreq_exp2, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp2, block == "test_x")$accuracy[subset(subjAccFreq_exp2, block == "test_x")$freq == "lf"]
## t = 2.6296, df = 43, p-value = 0.01181
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.02118799 0.16063019
## sample estimates:
## mean of the differences 
##              0.09090909
Logistic mixed-effects model
#center frequency condition
all_data <- all_data %>%
  mutate(freqC=case_when(
    freq=="hf" ~ 0.5,
    freq=="lf" ~ -0.5,
    TRUE ~ NA_real_))
#logistic mixed-effects model
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp2" & block=="test_x"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp2" & block == "test_x")
## 
##      AIC      BIC   logLik deviance df.resid 
##    245.7    276.6   -114.9    229.7      344 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.1221  0.2257  0.2920  0.2945  0.8284 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev.  Corr 
##  subjCode     (Intercept) 5.370e-01 7.328e-01      
##               freqC       3.251e-01 5.702e-01 -1.00
##  nearestLabel (Intercept) 0.000e+00 0.000e+00      
##               freqC       2.290e-11 4.785e-06  NaN 
## Number of obs: 352, groups:  subjCode, 44; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   2.4217     0.2735   8.856   <2e-16 ***
## freqC         0.7474     0.5259   1.421    0.155    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.020 
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
testXRT_exp2 <-  summary_se_within_cis(subset(subjAccFreq_exp2,block=="test_x"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
testXRT_exp2 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 44 2303.42 2168.863 2437.978
lf 44 2435.66 2301.103 2570.217

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp2,block=="test_x")$correct_rt[subset(subjAccFreq_exp2,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp2,block=="test_x")$correct_rt[subset(subjAccFreq_exp2,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp2, block == "test_x")$correct_rt[subset(subjAccFreq_exp2, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp2, block == "test_x")$correct_rt[subset(subjAccFreq_exp2, block == "test_x")$freq == "lf"]
## t = -1.4015, df = 43, p-value = 0.1683
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -322.53172   58.05318
## sample estimates:
## mean of the differences 
##               -132.2393
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp2" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp2" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 5066.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2275 -0.6005 -0.1610  0.4221  3.4080 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept) 194472   440.99        
##               freqC         1844    42.94   1.00 
##  nearestLabel (Intercept)  57944   240.72        
##               freqC        60537   246.04   -0.15
##  Residual                 491594   701.14        
## Number of obs: 314, groups:  subjCode, 44; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2347.84      97.00   37.87  24.204   <2e-16 ***
## freqC         -99.29     100.47   17.09  -0.988    0.337    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.029
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, version=="exp2" & block=="test_x"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
all_data <- all_data %>%
  mutate(
    log_rt = log(rt)
  )
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp2" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp2" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 194.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.56452 -0.61819 -0.03712  0.53614  2.65520 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev. Corr
##  subjCode     (Intercept) 0.0360105 0.18976      
##               freqC       0.0001192 0.01092  1.00
##  nearestLabel (Intercept) 0.0109596 0.10469      
##               freqC       0.0086081 0.09278  0.06
##  Residual                 0.0800932 0.28301      
## Number of obs: 314, groups:  subjCode, 44; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.69972    0.04145 39.21952  185.76   <2e-16 ***
## freqC       -0.06217    0.03959 16.81498   -1.57    0.135    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.027 
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

final_retention_plot(
  testXAcc_exp2, #summarized accuracy data
  subset(subjAccFreq_exp2, block=="test_x"), #subject accuracy data
  testXRT_exp2, #summarized RT data
  subset(subjAccFreq_exp2, block=="test_x"), # subject RT data
  plot_path = here::here("plots","exp2_testXCheck.jpg")
  )

Untimed Retention Test

Participants’ performance on the Untimed Retention test at the conclusion of the experiment.

Accuracy

Descriptives
# accuracy
nameCheckAcc_exp2 <-  summary_se_within_cis(subset(subjAccFreq_exp2,block=="name_check"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
nameCheckAcc_exp2 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 44 0.9886364 0.9628659 1.0144068
lf 44 0.9488636 0.9230932 0.9746341

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp2,block=="name_check")$accuracy[subset(subjAccFreq_exp2,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp2,block=="name_check")$accuracy[subset(subjAccFreq_exp2,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp2, block == "name_check")$accuracy[subset(subjAccFreq_exp2, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp2, block == "name_check")$accuracy[subset(subjAccFreq_exp2, block == "name_check")$freq == "lf"]
## t = 2.2008, df = 43, p-value = 0.03317
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.003327778 0.076217677
## sample estimates:
## mean of the differences 
##              0.03977273
Logistic mixed-effects model
#logistic mixed-effects model
#maximal random effects structure does not converge, therefore pruning by-item random slope to allow model convergence
#m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp2" & block=="name_check"),family=binomial)
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1|target),data=filter(all_data,version=="exp2" & block=="name_check"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 | target)
##    Data: filter(all_data, version == "exp2" & block == "name_check")
## 
##      AIC      BIC   logLik deviance df.resid 
##    102.3    125.5    -45.2     90.3      346 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.2867  0.0093  0.0259  0.2298  0.5049 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  subjCode (Intercept)  9.825   3.134        
##           freqC       34.991   5.915    1.00
##  target   (Intercept)  0.000   0.000        
## Number of obs: 352, groups:  subjCode, 44; target, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    6.033      1.669   3.615   0.0003 ***
## freqC          6.197      3.342   1.854   0.0637 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.978 
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
nameCheckRT_exp2 <-  summary_se_within_cis(subset(subjAccFreq_exp2,block=="name_check"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
nameCheckRT_exp2 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 44 2683.823 2478.053 2889.592
lf 44 2811.679 2605.910 3017.449

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp2,block=="name_check")$correct_rt[subset(subjAccFreq_exp2,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp2,block=="name_check")$correct_rt[subset(subjAccFreq_exp2,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp2, block == "name_check")$correct_rt[subset(subjAccFreq_exp2, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp2, block == "name_check")$correct_rt[subset(subjAccFreq_exp2, block == "name_check")$freq == "lf"]
## t = -0.88607, df = 43, p-value = 0.3805
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -418.8586  163.1455
## sample estimates:
## mean of the differences 
##               -127.8566
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data, version=="exp2" & block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp2" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 5845.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.3603 -0.5419 -0.2054  0.2161  6.7391 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept)  240332   490.2        
##           freqC         13350   115.5   -0.96
##  target   (Intercept)   82861   287.9        
##           freqC         14478   120.3   -1.00
##  Residual             1526392  1235.5        
## Number of obs: 341, groups:  subjCode, 44; target, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2745.03     122.01   25.80  22.499   <2e-16 ***
## freqC        -118.26     138.37   32.78  -0.855    0.399    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.208
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data,version=="exp2" & block=="name_check"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp2"& block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp2" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 322
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.5220 -0.6449 -0.0773  0.4412  3.8452 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr 
##  subjCode (Intercept) 0.0235178 0.15336       
##           freqC       0.0025201 0.05020  0.50 
##  target   (Intercept) 0.0113343 0.10646       
##           freqC       0.0009646 0.03106  -1.00
##  Residual             0.1243277 0.35260       
## Number of obs: 341, groups:  subjCode, 44; target, 18
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.82576    0.03958 27.72846 197.730   <2e-16 ***
## freqC       -0.02250    0.03973 34.78991  -0.566    0.575    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.079
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  nameCheckAcc_exp2, #summarized accuracy data
  subset(subjAccFreq_exp2,block=="name_check"), #subject accuracy data
  nameCheckRT_exp2, #summarized RT data
  subset(subjAccFreq_exp2,block=="name_check"), # subject RT data
  here::here("plots","exp2_finalNameCheck.jpg")
  )

Experiment 3

Timed Retention Test

Accuracy

Descriptives
#summarize subject accuracy by frequency
subjAccFreq_exp3 <- all_data %>%
  filter(version=="exp3") %>%
  subject_accuracy_by_frequency_by_block()

testXAcc_exp3 <-  summary_se_within_cis(data=subset(subjAccFreq_exp3,block=="test_x"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
testXAcc_exp3 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 55 0.9181818 0.8747771 0.9615865
lf 55 0.8954545 0.8520499 0.9388592

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp3,block=="test_x")$accuracy[subset(subjAccFreq_exp3,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp3,block=="test_x")$accuracy[subset(subjAccFreq_exp3,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp3, block == "test_x")$accuracy[subset(subjAccFreq_exp3, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp3, block == "test_x")$accuracy[subset(subjAccFreq_exp3, block == "test_x")$freq == "lf"]
## t = 0.74231, df = 54, p-value = 0.4611
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.03865624  0.08411078
## sample estimates:
## mean of the differences 
##              0.02272727
Logistic mixed-effects model
#center frequency condition
all_data <- all_data %>%
  mutate(freqC=case_when(
    freq=="hf" ~ 0.5,
    freq=="lf" ~ -0.5,
    TRUE ~ NA_real_))
#logistic mixed-effects model
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp3" & block=="test_x"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp3" & block == "test_x")
## 
##      AIC      BIC   logLik deviance df.resid 
##    283.1    315.8   -133.6    267.1      432 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.9817  0.2124  0.2398  0.2733  0.6901 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept) 0.5855   0.7652        
##               freqC       1.8840   1.3726   -0.29
##  nearestLabel (Intercept) 0.1607   0.4009        
##               freqC       0.0209   0.1446   1.00 
## Number of obs: 440, groups:  subjCode, 55; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   2.7780     0.3709   7.491 6.85e-14 ***
## freqC         0.1226     0.7290   0.168    0.866    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.128 
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
testXRT_exp3 <-  summary_se_within_cis(subset(subjAccFreq_exp3,block=="test_x"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
testXRT_exp3 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 55 2217.089 2113.31 2320.869
lf 55 2413.240 2309.46 2517.019

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp3,block=="test_x")$correct_rt[subset(subjAccFreq_exp3,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp3,block=="test_x")$correct_rt[subset(subjAccFreq_exp3,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp3, block == "test_x")$correct_rt[subset(subjAccFreq_exp3, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp3, block == "test_x")$correct_rt[subset(subjAccFreq_exp3, block == "test_x")$freq == "lf"]
## t = -2.6795, df = 54, p-value = 0.009754
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -342.91657  -49.38352
## sample estimates:
## mean of the differences 
##                 -196.15
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp3" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp3" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 6419.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.5646 -0.6553 -0.2395  0.4485  4.2545 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept) 100298   316.70        
##               freqC         4022    63.42   -1.00
##  nearestLabel (Intercept)  29878   172.85        
##               freqC        26467   162.69   -1.00
##  Residual                 512528   715.91        
## Number of obs: 399, groups:  subjCode, 55; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2308.38      69.56   32.38  33.185   <2e-16 ***
## freqC        -190.18      82.51   26.49  -2.305   0.0292 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.354
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, version=="exp3" & block=="test_x"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
all_data <- all_data %>%
  mutate(
    log_rt = log(rt)
  )
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp3" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp3" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 202.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0444 -0.6756 -0.1125  0.5881  3.1303 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev. Corr 
##  subjCode     (Intercept) 0.0186293 0.13649       
##               freqC       0.0001433 0.01197  -1.00
##  nearestLabel (Intercept) 0.0067541 0.08218       
##               freqC       0.0039773 0.06307  -1.00
##  Residual                 0.0792307 0.28148       
## Number of obs: 399, groups:  subjCode, 55; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.68941    0.03042 32.40680  252.79   <2e-16 ***
## freqC       -0.07984    0.03219 27.14258   -2.48   0.0196 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.340
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

final_retention_plot(
  testXAcc_exp3, #summarized accuracy data
  subset(subjAccFreq_exp3, block=="test_x"), #subject accuracy data
  testXRT_exp3, #summarized RT data
  subset(subjAccFreq_exp3, block=="test_x"), # subject RT data
  plot_path = here::here("plots","exp3_testXCheck.jpg")
  )

Untimed Retention Test

Participants’ performance on the Untimed Retention test at the conclusion of the experiment.

Accuracy

Descriptives
# accuracy
nameCheckAcc_exp3 <-  summary_se_within_cis(subset(subjAccFreq_exp3,block=="name_check"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
nameCheckAcc_exp3 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 55 0.9772727 0.9501878 1.0043577
lf 55 0.9500000 0.9229151 0.9770849

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp3,block=="name_check")$accuracy[subset(subjAccFreq_exp3,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp3,block=="name_check")$accuracy[subset(subjAccFreq_exp3,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp3, block == "name_check")$accuracy[subset(subjAccFreq_exp3, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp3, block == "name_check")$accuracy[subset(subjAccFreq_exp3, block == "name_check")$freq == "lf"]
## t = 1.4275, df = 54, p-value = 0.1592
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.01103116  0.06557662
## sample estimates:
## mean of the differences 
##              0.02727273
Logistic mixed-effects model
#logistic mixed-effects model
#maximal random effects structure does not converge, therefore pruning by-item random slope to allow model convergence
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp3" & block=="name_check"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp3" & block == "name_check")
## 
##      AIC      BIC   logLik deviance df.resid 
##    148.1    180.8    -66.0    132.1      432 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -6.5682  0.1130  0.1521  0.1521  0.6080 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.  Corr 
##  subjCode (Intercept) 9.041e-01 9.509e-01      
##           freqC       3.323e+00 1.823e+00 -1.00
##  target   (Intercept) 3.257e-10 1.805e-05      
##           freqC       3.035e-11 5.509e-06 -1.00
## Number of obs: 440, groups:  subjCode, 55; target, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   3.9711     0.6454   6.153  7.6e-10 ***
## freqC        -0.4182     1.2870  -0.325    0.745    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.753
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
nameCheckRT_exp3 <-  summary_se_within_cis(subset(subjAccFreq_exp3,block=="name_check"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
nameCheckRT_exp3 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 55 2558.601 2414.020 2703.181
lf 55 2504.878 2360.297 2649.459

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp3,block=="name_check")$correct_rt[subset(subjAccFreq_exp3,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp3,block=="name_check")$correct_rt[subset(subjAccFreq_exp3,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp3, block == "name_check")$correct_rt[subset(subjAccFreq_exp3, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp3, block == "name_check")$correct_rt[subset(subjAccFreq_exp3, block == "name_check")$freq == "lf"]
## t = 0.52677, df = 54, p-value = 0.6005
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -150.7455  258.1907
## sample estimates:
## mean of the differences 
##                53.72263
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data, version=="exp3" & block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp3" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 7167
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.8958 -0.5447 -0.2070  0.2569  5.5189 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr
##  subjCode (Intercept)  286941.8  535.67      
##           freqC         41566.0  203.88  1.00
##  target   (Intercept)   45223.6  212.66      
##           freqC           304.2   17.44  1.00
##  Residual             1149083.5 1071.95      
## Number of obs: 424, groups:  subjCode, 55; target, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2539.45     102.78   37.55  24.708   <2e-16 ***
## freqC          46.15     107.99  173.87   0.427     0.67    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.191 
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data,version=="exp3" & block=="name_check"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp3"& block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp3" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 363.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.4911 -0.6197 -0.1114  0.5008  3.7711 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr
##  subjCode (Intercept) 3.718e-02 0.192808     
##           freqC       1.510e-03 0.038855 0.16
##  target   (Intercept) 8.925e-03 0.094474     
##           freqC       6.765e-05 0.008225 1.00
##  Residual             1.097e-01 0.331163     
## Number of obs: 424, groups:  subjCode, 55; target, 18
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.75692    0.03804 40.28916  203.94   <2e-16 ***
## freqC       -0.01112    0.03274 50.99985   -0.34    0.736    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.046 
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  nameCheckAcc_exp3, #summarized accuracy data
  subset(subjAccFreq_exp3,block=="name_check"), #subject accuracy data
  nameCheckRT_exp3, #summarized RT data
  subset(subjAccFreq_exp3,block=="name_check"), # subject RT data
  here::here("plots","exp3_finalNameCheck.jpg")
  )

Experiment 4

Timed Retention Test

Accuracy

Descriptives
#summarize subject accuracy by frequency
subjAccFreq_exp4 <- all_data %>%
  filter(version=="exp4") %>%
  subject_accuracy_by_frequency_by_block()

testXAcc_exp4 <-  summary_se_within_cis(data=subset(subjAccFreq_exp4,block=="test_x"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
testXAcc_exp4 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 43 0.9244186 0.8815756 0.9672616
lf 43 0.8313953 0.7885524 0.8742383

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp4,block=="test_x")$accuracy[subset(subjAccFreq_exp4,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp4,block=="test_x")$accuracy[subset(subjAccFreq_exp4,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp4, block == "test_x")$accuracy[subset(subjAccFreq_exp4, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp4, block == "test_x")$accuracy[subset(subjAccFreq_exp4, block == "test_x")$freq == "lf"]
## t = 3.0984, df = 42, p-value = 0.003464
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.03243413 0.15361238
## sample estimates:
## mean of the differences 
##              0.09302326
Logistic mixed-effects model
#center frequency condition
all_data <- all_data %>%
  mutate(freqC=case_when(
    freq=="hf" ~ 0.5,
    freq=="lf" ~ -0.5,
    TRUE ~ NA_real_))
#logistic mixed-effects model
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp4" & block=="test_x"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp4" & block == "test_x")
## 
##      AIC      BIC   logLik deviance df.resid 
##    250.7    281.4   -117.3    234.7      336 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.0993  0.1455  0.2651  0.3210  1.0176 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept) 1.59224  1.2618        
##               freqC       0.04920  0.2218   1.00 
##  nearestLabel (Intercept) 0.01860  0.1364        
##               freqC       0.08521  0.2919   -1.00
## Number of obs: 344, groups:  subjCode, 43; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   2.6230     0.3800   6.902 5.12e-12 ***
## freqC         1.2202     0.6904   1.767   0.0772 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.418 
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
testXRT_exp4 <-  summary_se_within_cis(subset(subjAccFreq_exp4,block=="test_x"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
testXRT_exp4 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 43 2342.149 2232.695 2451.603
lf 43 2455.125 2345.671 2564.579

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp4,block=="test_x")$correct_rt[subset(subjAccFreq_exp4,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp4,block=="test_x")$correct_rt[subset(subjAccFreq_exp4,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp4, block == "test_x")$correct_rt[subset(subjAccFreq_exp4, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp4, block == "test_x")$correct_rt[subset(subjAccFreq_exp4, block == "test_x")$freq == "lf"]
## t = -1.4729, df = 42, p-value = 0.1482
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -267.76758   41.81485
## sample estimates:
## mean of the differences 
##               -112.9764
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp4" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp4" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 4826.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7104 -0.6638 -0.1748  0.5158  3.3572 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept)  82367   287.00        
##               freqC        10295   101.46   -1.00
##  nearestLabel (Intercept)  76622   276.81        
##               freqC         5262    72.54   -1.00
##  Residual                 456166   675.40        
## Number of obs: 302, groups:  subjCode, 43; nearestLabel, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2406.93      88.96   25.39   27.06   <2e-16 ***
## freqC        -136.25      82.06   75.50   -1.66    0.101    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.284
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, version=="exp4" & block=="test_x"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
all_data <- all_data %>%
  mutate(
    log_rt = log(rt)
  )
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version=="exp4" & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel)
##    Data: filter(all_data, version == "exp4" & block == "test_x" & isRight ==  
##     1)
## 
## REML criterion at convergence: 143.3
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.43079 -0.63901 -0.07709  0.65587  3.04459 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev. Corr 
##  subjCode     (Intercept) 0.0157027 0.12531       
##               freqC       0.0014883 0.03858  -1.00
##  nearestLabel (Intercept) 0.0138069 0.11750       
##               freqC       0.0003146 0.01774  -1.00
##  Residual                 0.0746334 0.27319       
## Number of obs: 302, groups:  subjCode, 43; nearestLabel, 18
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   7.73538    0.03767  26.40433 205.372   <2e-16 ***
## freqC        -0.05709    0.03264 115.14730  -1.749   0.0829 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.221
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

final_retention_plot(
  testXAcc_exp4, #summarized accuracy data
  subset(subjAccFreq_exp4, block=="test_x"), #subject accuracy data
  testXRT_exp4, #summarized RT data
  subset(subjAccFreq_exp4, block=="test_x"), # subject RT data
  plot_path = here::here("plots","exp4_testXCheck.jpg")
  )

Untimed Retention Test

Participants’ performance on the Untimed Retention test at the conclusion of the experiment.

Accuracy

Descriptives
# accuracy
nameCheckAcc_exp4 <-  summary_se_within_cis(subset(subjAccFreq_exp4,block=="name_check"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
nameCheckAcc_exp4 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 43 0.9767442 0.9358987 1.0175897
lf 43 0.9186047 0.8777591 0.9594502

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp4,block=="name_check")$accuracy[subset(subjAccFreq_exp4,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp4,block=="name_check")$accuracy[subset(subjAccFreq_exp4,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp4, block == "name_check")$accuracy[subset(subjAccFreq_exp4, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp4, block == "name_check")$accuracy[subset(subjAccFreq_exp4, block == "name_check")$freq == "lf"]
## t = 2.0312, df = 42, p-value = 0.0486
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.0003752313 0.1159038385
## sample estimates:
## mean of the differences 
##              0.05813953
Logistic mixed-effects model
#logistic mixed-effects model
#maximal random effects structure does not converge, therefore pruning by-item random slope to allow model convergence
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp4" & block=="name_check"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp4" & block == "name_check")
## 
##      AIC      BIC   logLik deviance df.resid 
##    132.6    163.3    -58.3    116.6      336 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.9801  0.0185  0.1087  0.1524  1.1797 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept) 10.963   3.311         
##           freqC       35.478   5.956    -1.00
##  target   (Intercept)  1.503   1.226         
##           freqC        1.014   1.007    -1.00
## Number of obs: 344, groups:  subjCode, 43; target, 18
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    5.938      1.240   4.789 1.68e-06 ***
## freqC         -3.891      2.457  -1.583    0.113    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.829
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
nameCheckRT_exp4 <-  summary_se_within_cis(subset(subjAccFreq_exp4,block=="name_check"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
nameCheckRT_exp4 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 43 2566.972 2386.880 2747.064
lf 43 2690.846 2510.754 2870.938

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp4,block=="name_check")$correct_rt[subset(subjAccFreq_exp4,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp4,block=="name_check")$correct_rt[subset(subjAccFreq_exp4,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp4, block == "name_check")$correct_rt[subset(subjAccFreq_exp4, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp4, block == "name_check")$correct_rt[subset(subjAccFreq_exp4, block == "name_check")$freq == "lf"]
## t = -0.98154, df = 42, p-value = 0.3319
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -378.5626  130.8144
## sample estimates:
## mean of the differences 
##               -123.8741
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items)
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data, version=="exp4" & block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp4" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 5401.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.4965 -0.5869 -0.2261  0.3695  4.3893 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept) 199831   447.02        
##           freqC       157216   396.51   -1.00
##  target   (Intercept)  87013   294.98        
##           freqC         5004    70.74   1.00 
##  Residual             805110   897.28        
## Number of obs: 326, groups:  subjCode, 43; target, 18
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2625.45     110.69   28.69  23.718   <2e-16 ***
## freqC        -134.93     118.42   48.05  -1.139     0.26    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.241
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data,version=="exp4" & block=="name_check"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items)
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data,version=="exp4"& block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target)
##    Data: filter(all_data, version == "exp4" & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 214.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7597 -0.6264 -0.1531  0.5494  2.9340 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept) 0.028769 0.16961       
##           freqC       0.011481 0.10715  -1.00
##  target   (Intercept) 0.011628 0.10783       
##           freqC       0.007415 0.08611  1.00 
##  Residual             0.086785 0.29459       
## Number of obs: 326, groups:  subjCode, 43; target, 18
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.80151    0.04017 33.56097 194.199   <2e-16 ***
## freqC       -0.02715    0.04219 29.42346  -0.643    0.525    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.053 
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  nameCheckAcc_exp4, #summarized accuracy data
  subset(subjAccFreq_exp4,block=="name_check"), #subject accuracy data
  nameCheckRT_exp4, #summarized RT data
  subset(subjAccFreq_exp4,block=="name_check"), # subject RT data
  here::here("plots","exp4_finalNameCheck.jpg")
  )

Exps 1 and 2

To get an overall sense of participants’ retention of labels across Experiments 1 and 2, we present descriptives and test for frequency effects across Experiments 1 and 2 on both Timed and Untimed Retention Test trials.

Timed Retention Test

Participants’ performance during the Timed Retention test in Experiments 1 and 2, combined.

Accuracy

Descriptives
#summarize subject accuracy by frequency
subjAccFreq_exp12 <- all_data %>%
  filter(version %in% c("exp1","exp2")) %>%
  subject_accuracy_by_frequency_by_block()

testXAcc_exp12 <-  summary_se_within_cis(data=subset(subjAccFreq_exp12,block=="test_x"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
testXAcc_exp12 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 83 0.9277108 0.8930238 0.9623979
lf 83 0.8463855 0.8116985 0.8810726

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp12,block=="test_x")$accuracy[subset(subjAccFreq_exp12,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp12,block=="test_x")$accuracy[subset(subjAccFreq_exp12,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp12, block == "test_x")$accuracy[subset(subjAccFreq_exp12, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp12, block == "test_x")$accuracy[subset(subjAccFreq_exp12, block == "test_x")$freq == "lf"]
## t = 3.298, df = 82, p-value = 0.001442
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.03227037 0.13038023
## sample estimates:
## mean of the differences 
##               0.0813253
Logistic mixed-effects model
#logistic mixed-effects model, including accounting for non-independence of datasets
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel)+(1|version),data=filter(all_data, version %in% c("exp1","exp2") & block=="test_x"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel) +  
##     (1 | version)
##    Data: filter(all_data, version %in% c("exp1", "exp2") & block == "test_x")
## 
##      AIC      BIC   logLik deviance df.resid 
##    472.8    513.3   -227.4    454.8      655 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.6764  0.2685  0.2980  0.3367  0.6716 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev.  Corr 
##  subjCode     (Intercept) 2.214e-01 4.705e-01      
##               freqC       3.405e-01 5.835e-01 -1.00
##  nearestLabel (Intercept) 0.000e+00 0.000e+00      
##               freqC       2.827e-10 1.681e-05  NaN 
##  version      (Intercept) 0.000e+00 0.000e+00      
## Number of obs: 664, groups:  subjCode, 83; nearestLabel, 18; version, 2
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   2.2349     0.1640  13.626   <2e-16 ***
## freqC         0.6617     0.3180   2.081   0.0375 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.071
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Interaction between Experiment

all_data <- all_data %>% mutate(versionC=case_when(
  version=="exp1" ~-0.5,
  version == "exp2"~ 0.5,
  TRUE ~ NA_real_)) 
#logistic mixed-effects model, including accounting for non-independence of datasets
m <- glmer(isRight~freqC*versionC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version %in% c("exp1","exp2") & block=="test_x"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC * versionC + (1 + freqC | subjCode) + (1 + freqC |  
##     nearestLabel)
##    Data: filter(all_data, version %in% c("exp1", "exp2") & block == "test_x")
## 
##      AIC      BIC   logLik deviance df.resid 
##    474.3    519.3   -227.2    454.3      654 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.9730  0.2485  0.3059  0.3369  0.6716 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev. Corr 
##  subjCode     (Intercept) 2.212e-01 0.470289      
##               freqC       3.414e-01 0.584303 -1.00
##  nearestLabel (Intercept) 4.658e-06 0.002158      
##               freqC       2.739e-06 0.001655 0.51 
## Number of obs: 664, groups:  subjCode, 83; nearestLabel, 18
## 
## Fixed effects:
##                Estimate Std. Error z value Pr(>|z|)    
## (Intercept)      2.2352     0.1643  13.608   <2e-16 ***
## freqC            0.6630     0.3185   2.082   0.0374 *  
## versionC         0.1623     0.2862   0.567   0.5707    
## freqC:versionC   0.2976     0.5479   0.543   0.5870    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) freqC  versnC
## freqC       -0.068              
## versionC     0.025  0.049       
## freqC:vrsnC  0.047  0.029  0.165
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## Model failed to converge with max|grad| = 0.00988671 (tol = 0.002, component 1)

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
testXRT_exp12 <-  summary_se_within_cis(subset(subjAccFreq_exp12,block=="test_x"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
testXRT_exp12 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 83 2309.040 2212.651 2405.428
lf 83 2504.957 2408.569 2601.346

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp12,block=="test_x")$correct_rt[subset(subjAccFreq_exp12,block=="test_x")$freq=="hf"],
       subset(subjAccFreq_exp12,block=="test_x")$correct_rt[subset(subjAccFreq_exp12,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp12, block == "test_x")$correct_rt[subset(subjAccFreq_exp12, block == "test_x")$freq == "hf"] and subset(subjAccFreq_exp12, block == "test_x")$correct_rt[subset(subjAccFreq_exp12, block == "test_x")$freq == "lf"]
## t = -2.8591, df = 82, p-value = 0.005385
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -332.23197  -59.60332
## sample estimates:
## mean of the differences 
##               -195.9176
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel)+(1|version),data=filter(all_data, version %in% c("exp1","exp2") & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel) +  
##     (1 | version)
##    Data: filter(all_data, version %in% c("exp1", "exp2") & block == "test_x" &  
##     isRight == 1)
## 
## REML criterion at convergence: 9539.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0278 -0.6239 -0.1948  0.4643  3.4255 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept) 160859.0 401.07        
##               freqC          520.8  22.82   -1.00
##  nearestLabel (Intercept)  42481.4 206.11        
##               freqC        16349.5 127.86   -0.60
##  version      (Intercept)      0.0   0.00        
##  Residual                 538204.7 733.62        
## Number of obs: 589, groups:  subjCode, 83; nearestLabel, 18; version, 2
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2387.72      72.45   35.34  32.958   <2e-16 ***
## freqC        -160.53      68.82   15.80  -2.333   0.0332 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.222
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, version %in% c("exp1","exp2") & block=="test_x"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel)+(1|version),data=filter(all_data, version %in% c("exp1","exp2") & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel) +  
##     (1 | version)
##    Data: filter(all_data, version %in% c("exp1", "exp2") & block == "test_x" &  
##     isRight == 1)
## 
## REML criterion at convergence: 341.3
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.68157 -0.65922 -0.06801  0.59430  2.68948 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev. Corr 
##  subjCode     (Intercept) 2.661e-02 0.163130      
##               freqC       2.022e-05 0.004497 1.00 
##  nearestLabel (Intercept) 7.804e-03 0.088343      
##               freqC       3.215e-03 0.056705 -0.46
##  version      (Intercept) 0.000e+00 0.000000      
##  Residual                 8.328e-02 0.288588      
## Number of obs: 589, groups:  subjCode, 83; nearestLabel, 18; version, 2
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.71692    0.03003 35.02473 256.995   <2e-16 ***
## freqC       -0.07326    0.02778 15.90339  -2.637    0.018 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.163
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Interaction with Experiment.

We also assessed whether these results differed between experiment, both for reaction times and for log-transformed reaction times. We found no evidence for interactions between frequency and experiment.

Untransformed reaction times.

m <- lmer(rt~freqC*versionC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version %in% c("exp1","exp2") & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC * versionC + (1 + freqC | subjCode) + (1 + freqC |  
##     nearestLabel)
##    Data: filter(all_data, version %in% c("exp1", "exp2") & block == "test_x" &  
##     isRight == 1)
## 
## REML criterion at convergence: 9515.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0512 -0.6299 -0.1906  0.4582  3.3650 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev. Corr 
##  subjCode     (Intercept) 162716.4 403.38        
##               freqC          389.5  19.74   -1.00
##  nearestLabel (Intercept)  41676.0 204.15        
##               freqC        16229.5 127.39   -0.57
##  Residual                 538958.6 734.14        
## Number of obs: 589, groups:  subjCode, 83; nearestLabel, 18
## 
## Fixed effects:
##                Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)     2389.42      72.37   35.78  33.017   <2e-16 ***
## freqC           -164.26      69.01   16.01  -2.380   0.0301 *  
## versionC         -61.60     108.75   78.64  -0.566   0.5727    
## freqC:versionC    88.35     124.86  478.35   0.708   0.4796    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) freqC  versnC
## freqC       -0.206              
## versionC    -0.043 -0.001       
## freqC:vrsnC  0.000 -0.079 -0.064
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Log-transformed reaction times.

# log-transformed reaction times
m <- lmer(log_rt~freqC*versionC+(1+freqC|subjCode)+(1+freqC|nearestLabel),data=filter(all_data, version %in% c("exp1","exp2") & block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC * versionC + (1 + freqC | subjCode) + (1 + freqC |  
##     nearestLabel)
##    Data: filter(all_data, version %in% c("exp1", "exp2") & block == "test_x" &  
##     isRight == 1)
## 
## REML criterion at convergence: 349.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6751 -0.6560 -0.0653  0.5897  2.6983 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev. Corr 
##  subjCode     (Intercept) 2.677e-02 0.163600      
##               freqC       2.617e-05 0.005115 1.00 
##  nearestLabel (Intercept) 7.702e-03 0.087762      
##               freqC       3.062e-03 0.055333 -0.46
##  Residual                 8.351e-02 0.288979      
## Number of obs: 589, groups:  subjCode, 83; nearestLabel, 18
## 
## Fixed effects:
##                 Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)      7.71785    0.03000  35.26038 257.297   <2e-16 ***
## freqC           -0.07370    0.02774  16.05620  -2.657   0.0172 *  
## versionC        -0.03190    0.04371  81.31765  -0.730   0.4676    
## freqC:versionC   0.01147    0.04924 491.77627   0.233   0.8159    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) freqC  versnC
## freqC       -0.156              
## versionC    -0.042 -0.004       
## freqC:vrsnC -0.002 -0.078 -0.014
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  testXAcc_exp12, #summarized accuracy data
  subset(subjAccFreq_exp12,block=="test_x"), #subject accuracy data
  testXRT_exp12, #summarized RT data
  subset(subjAccFreq_exp12,block=="test_x"), # subject RT data
  plot_path = here::here("plots","exps12_testXCheck.jpg")
  )

Untimed Retention Test

Participants’ performance on the Untimed Retention test in Experiments 1 and 2, combined.

Accuracy

Descriptives
# accuracy
nameCheckAcc_exp12 <- summary_se_within_cis(subset(subjAccFreq_exp12,block=="name_check"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
nameCheckAcc_exp12 %>%
  kable()
freq N accuracy lowerCI upperCI
hf 83 0.9819277 0.9636380 1.000217
lf 83 0.9608434 0.9425537 0.979133

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq_exp12,block=="name_check")$accuracy[subset(subjAccFreq_exp12,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp12,block=="name_check")$accuracy[subset(subjAccFreq_exp12,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp12, block == "name_check")$accuracy[subset(subjAccFreq_exp12, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp12, block == "name_check")$accuracy[subset(subjAccFreq_exp12, block == "name_check")$freq == "lf"]
## t = 1.6216, df = 82, p-value = 0.1087
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.00478117  0.04694984
## sample estimates:
## mean of the differences 
##              0.02108434
Logistic mixed-effects model
#logistic mixed-effects model, including accounting for non-independence of datasets
#simplified random effects structure due to non-convergence
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1|target)+(1|version),data=filter(all_data, version %in% c("exp1","exp2") & block=="name_check"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 + freqC | subjCode) + (1 | target) + (1 |  
##     version)
##    Data: 
## filter(all_data, version %in% c("exp1", "exp2") & block == "name_check")
## 
##      AIC      BIC   logLik deviance df.resid 
##    168.7    200.2    -77.3    154.7      657 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.31394  0.01093  0.04849  0.04849  0.90695 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  subjCode (Intercept) 14.35    3.788        
##           freqC       47.52    6.893    0.56
##  target   (Intercept)  0.00    0.000        
##  version  (Intercept)  0.00    0.000        
## Number of obs: 664, groups:  subjCode, 83; target, 18; version, 2
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    7.467      1.690   4.418 9.97e-06 ***
## freqC          3.047      3.322   0.917    0.359    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.239
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Interaction between Experiment

all_data <- all_data %>% mutate(versionC=case_when(
  version=="exp1" ~-0.5,
  version == "exp2"~ 0.5,
  TRUE ~ NA_real_)) 
#logistic mixed-effects model, including accounting for non-independence of datasets
#simplified random effects structure due to non-convergence
m <- glmer(isRight~freqC*versionC+(1|subjCode)+(1|target),data=filter(all_data, version %in% c("exp1","exp2") & block=="name_check"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC * versionC + (1 | subjCode) + (1 | target)
##    Data: 
## filter(all_data, version %in% c("exp1", "exp2") & block == "name_check")
## 
##      AIC      BIC   logLik deviance df.resid 
##      170      197      -79      158      658 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -7.0653  0.0598  0.0678  0.1033  0.6636 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  subjCode (Intercept) 4.1516   2.0375  
##  target   (Intercept) 0.2127   0.4612  
## Number of obs: 664, groups:  subjCode, 83; target, 18
## 
## Fixed effects:
##                Estimate Std. Error z value Pr(>|z|)    
## (Intercept)      5.2732     1.0416   5.063 4.14e-07 ***
## freqC            0.8023     0.5702   1.407    0.159    
## versionC        -0.1120     0.8010  -0.140    0.889    
## freqC:versionC   1.7278     1.1402   1.515    0.130    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) freqC  versnC
## freqC        0.127              
## versionC    -0.098  0.220       
## freqC:vrsnC  0.180  0.043  0.219

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
nameCheckRT_exp12 <-  summary_se_within_cis(subset(subjAccFreq_exp12,block=="name_check"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
nameCheckRT_exp12 %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 83 2703.475 2543.926 2863.024
lf 83 2923.882 2764.333 3083.431

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq_exp12,block=="name_check")$correct_rt[subset(subjAccFreq_exp12,block=="name_check")$freq=="hf"],
       subset(subjAccFreq_exp12,block=="name_check")$correct_rt[subset(subjAccFreq_exp12,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq_exp12, block == "name_check")$correct_rt[subset(subjAccFreq_exp12, block == "name_check")$freq == "hf"] and subset(subjAccFreq_exp12, block == "name_check")$correct_rt[subset(subjAccFreq_exp12, block == "name_check")$freq == "lf"]
## t = -1.9432, df = 82, p-value = 0.05542
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -446.044085    5.228519
## sample estimates:
## mean of the differences 
##               -220.4078
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|target)+(1|version),data=filter(all_data,version==c("exp1","exp2")& block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target) +  
##     (1 | version)
##    Data: 
## filter(all_data, version == c("exp1", "exp2") & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 5387.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.5337 -0.6150 -0.2198  0.3763  4.5850 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr
##  subjCode (Intercept)  130623.8  361.42      
##           freqC        266583.1  516.32  0.69
##  target   (Intercept)   26531.3  162.88      
##           freqC           634.1   25.18  1.00
##  version  (Intercept)       0.0    0.00      
##  Residual             1246375.4 1116.41      
## Number of obs: 318, groups:  subjCode, 83; target, 18; version, 2
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2719.91      84.62   20.41  32.141   <2e-16 ***
## freqC          60.56     141.62   73.87   0.428     0.67    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.145 
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, version==c("exp1","exp2")&block=="name_check"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|target)+(1|version),data=filter(all_data, version==c("exp1","exp2")&block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target) +  
##     (1 | version)
##    Data: 
## filter(all_data, version == c("exp1", "exp2") & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 298.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.5342 -0.6292 -0.0837  0.5343  3.1673 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr
##  subjCode (Intercept) 2.068e-02 0.143811     
##           freqC       2.188e-02 0.147930 0.29
##  target   (Intercept) 5.945e-03 0.077104     
##           freqC       3.259e-06 0.001805 1.00
##  version  (Intercept) 0.000e+00 0.000000     
##  Residual             1.194e-01 0.345604     
## Number of obs: 318, groups:  subjCode, 83; target, 18; version, 2
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.82879    0.03129 22.37533 250.216   <2e-16 ***
## freqC        0.01532    0.04397 76.28150   0.348    0.729    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.048 
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Interaction with Experiment.

We also assessed whether these results differed between experiment, both for reaction times and for log-transformed reaction times. We found no evidence for interactions between frequency and experiment.

Untransformed reaction times.

m <- lmer(rt~freqC*versionC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data, version %in% c("exp1","exp2") & block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC * versionC + (1 + freqC | subjCode) + (1 + freqC |  
##     target)
##    Data: 
## filter(all_data, version %in% c("exp1", "exp2") & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 11113.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.6699 -0.5410 -0.1994  0.2167  7.2995 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept)  427004   653.5        
##           freqC        206975   454.9   -0.58
##  target   (Intercept)   48541   220.3        
##           freqC         23402   153.0   -1.00
##  Residual             1600011  1264.9        
## Number of obs: 645, groups:  subjCode, 83; target, 18
## 
## Fixed effects:
##                Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)     2815.63     101.98   43.89  27.609   <2e-16 ***
## freqC           -202.64     118.47   42.09  -1.710   0.0945 .  
## versionC        -135.72     175.95   79.97  -0.771   0.4428    
## freqC:versionC   151.71     226.05   79.84   0.671   0.5041    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) freqC  versnC
## freqC       -0.338              
## versionC    -0.048  0.008       
## freqC:vrsnC  0.007 -0.069 -0.224
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Log-transformed reaction times.

# log-transformed reaction times
m <- lmer(log_rt~freqC*versionC+(1+freqC|subjCode)+(1+freqC|target),data=filter(all_data, version %in% c("exp1","exp2") & block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC * versionC + (1 + freqC | subjCode) + (1 + freqC |  
##     target)
##    Data: 
## filter(all_data, version %in% c("exp1", "exp2") & block == "name_check" &  
##     isRight == 1)
## 
## REML criterion at convergence: 628.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.4721 -0.6235 -0.1018  0.4384  3.9111 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept) 0.037217 0.19292       
##           freqC       0.019270 0.13882  -0.01
##  target   (Intercept) 0.008780 0.09370       
##           freqC       0.003268 0.05717  -1.00
##  Residual             0.121211 0.34815       
## Number of obs: 645, groups:  subjCode, 83; target, 18
## 
## Fixed effects:
##                Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)     7.84564    0.03363 38.47247 233.258   <2e-16 ***
## freqC          -0.05672    0.03460 38.38422  -1.639    0.109    
## versionC       -0.03797    0.05089 81.39505  -0.746    0.458    
## freqC:versionC  0.06520    0.06386 82.79562   1.021    0.310    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) freqC  versnC
## freqC       -0.268              
## versionC    -0.041 -0.004       
## freqC:vrsnC -0.003 -0.073 -0.020
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  nameCheckAcc_exp12, #summarized accuracy data
  subset(subjAccFreq_exp12,block=="name_check"), #subject accuracy data
  nameCheckRT_exp12, #summarized RT data
  subset(subjAccFreq_exp12,block=="name_check"), # subject RT data
  here::here("plots","exps12_finalNameCheck.jpg")
  )

All Exps (1-4)

To get an overall sense of participants’ retention of labels across all experiments, we present descriptives and test for frequency effects across all experiments (1-4) on both Timed and Untimed Retention Test trials.

Timed Retention Test

Participants’ performance during the Timed Retention test at the conclusion of the experiment.

Accuracy

Descriptives
#summarize subject accuracy by frequency
subjAccFreq <- all_data %>%
  subject_accuracy_by_frequency_by_block()

testXAcc <-  summary_se_within_cis(data=subset(subjAccFreq,block=="test_x"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
testXAcc %>%
  kable()
freq N accuracy lowerCI upperCI
hf 181 0.9240331 0.9012267 0.9468396
lf 181 0.8577348 0.8349284 0.8805412

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq,block=="test_x")$accuracy[subset(subjAccFreq,block=="test_x")$freq=="hf"],
       subset(subjAccFreq,block=="test_x")$accuracy[subset(subjAccFreq,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq, block == "test_x")$accuracy[subset(subjAccFreq, block == "test_x")$freq == "hf"] and subset(subjAccFreq, block == "test_x")$accuracy[subset(subjAccFreq, block == "test_x")$freq == "lf"]
## t = 4.0561, df = 180, p-value = 7.424e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.03404518 0.09855150
## sample estimates:
## mean of the differences 
##              0.06629834
Logistic mixed-effects model
#logistic mixed-effects model, including accounting for non-independence of datasets
m <- glmer(isRight~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel)+(1|version),data=filter(all_data, block=="test_x"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## isRight ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel) +  
##     (1 | version)
##    Data: filter(all_data, block == "test_x")
## 
##      AIC      BIC   logLik deviance df.resid 
##    984.8   1032.3   -483.4    966.8     1439 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.0359  0.2422  0.2805  0.3255  0.8652 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev.  Corr 
##  subjCode     (Intercept) 5.713e-01 7.558e-01      
##               freqC       1.780e-01 4.219e-01 -1.00
##  nearestLabel (Intercept) 3.348e-02 1.830e-01      
##               freqC       2.465e-02 1.570e-01 1.00 
##  version      (Intercept) 1.291e-09 3.593e-05      
## Number of obs: 1448, groups:  subjCode, 181; nearestLabel, 18; version, 4
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   2.3938     0.1436  16.670   <2e-16 ***
## freqC         0.5393     0.2728   1.977    0.048 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.087 
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
testXRT <-  summary_se_within_cis(subset(subjAccFreq,block=="test_x"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
testXRT %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 181 2288.965 2229.727 2348.202
lf 181 2465.249 2406.011 2524.486

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq,block=="test_x")$correct_rt[subset(subjAccFreq,block=="test_x")$freq=="hf"],
       subset(subjAccFreq,block=="test_x")$correct_rt[subset(subjAccFreq,block=="test_x")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq, block == "test_x")$correct_rt[subset(subjAccFreq, block == "test_x")$freq == "hf"] and subset(subjAccFreq, block == "test_x")$correct_rt[subset(subjAccFreq, block == "test_x")$freq == "lf"]
## t = -4.1522, df = 180, p-value = 5.077e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -260.05827  -92.50969
## sample estimates:
## mean of the differences 
##                -176.284
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel)+(1|version),data=filter(all_data, block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel) +  
##     (1 | version)
##    Data: filter(all_data, block == "test_x" & isRight == 1)
## 
## REML criterion at convergence: 20825.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.9545 -0.6607 -0.2143  0.4747  4.0554 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev.  Corr 
##  subjCode     (Intercept) 1.233e+05 351.08586      
##               freqC       4.016e+03  63.37231 -1.00
##  nearestLabel (Intercept) 3.894e+04 197.32068      
##               freqC       1.108e+04 105.27687 -1.00
##  version      (Intercept) 1.985e-04   0.01409      
##  Residual                 5.186e+05 720.13037      
## Number of obs: 1290, groups:  subjCode, 181; nearestLabel, 18; version, 4
## 
## Fixed effects:
##             Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)  2368.13      57.16   26.95  41.432  < 2e-16 ***
## freqC        -164.15      47.77   31.25  -3.436  0.00169 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.484
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, block=="test_x"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|nearestLabel)+(1|version),data=filter(all_data, block=="test_x"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | nearestLabel) +  
##     (1 | version)
##    Data: filter(all_data, block == "test_x" & isRight == 1)
## 
## REML criterion at convergence: 659.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7897 -0.6742 -0.1069  0.6043  3.0370 
## 
## Random effects:
##  Groups       Name        Variance  Std.Dev.  Corr 
##  subjCode     (Intercept) 2.151e-02 1.467e-01      
##               freqC       2.300e-04 1.517e-02 -1.00
##  nearestLabel (Intercept) 7.546e-03 8.687e-02      
##               freqC       1.312e-03 3.622e-02 -1.00
##  version      (Intercept) 3.050e-11 5.523e-06      
##  Residual                 8.133e-02 2.852e-01      
## Number of obs: 1290, groups:  subjCode, 181; nearestLabel, 18; version, 4
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)  7.71306    0.02459 26.31293 313.707  < 2e-16 ***
## freqC       -0.07157    0.01822 37.35149  -3.929 0.000356 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.432
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  testXAcc, #summarized accuracy data
  subset(subjAccFreq,block=="test_x"), #subject accuracy data
  testXRT, #summarized RT data
  subset(subjAccFreq,block=="test_x"), # subject RT data
  plot_path = here::here("plots","exps1to4_testXCheck.jpg")
  )

Untimed Retention Test

Participants’ performance on the Untimed Retention test at the conclusion of the experiment.

Accuracy

Descriptives
# accuracy
nameCheckAcc <- summary_se_within_cis(subset(subjAccFreq,block=="name_check"), measurevar="accuracy",withinvars=c("freq"),idvar="subjCode")
nameCheckAcc %>%
  kable()
freq N accuracy lowerCI upperCI
hf 181 0.9792818 0.9643028 0.9942608
lf 181 0.9475138 0.9325348 0.9624928

Paired t-test comparison

#paired t-test comparison
t.test(subset(subjAccFreq,block=="name_check")$accuracy[subset(subjAccFreq,block=="name_check")$freq=="hf"],
       subset(subjAccFreq,block=="name_check")$accuracy[subset(subjAccFreq,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq, block == "name_check")$accuracy[subset(subjAccFreq, block == "name_check")$freq == "hf"] and subset(subjAccFreq, block == "name_check")$accuracy[subset(subjAccFreq, block == "name_check")$freq == "lf"]
## t = 2.9592, df = 180, p-value = 0.0035
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.01058445 0.05295146
## sample estimates:
## mean of the differences 
##              0.03176796
Logistic mixed-effects model
#logistic mixed-effects model, including accounting for non-independence of datasets
#simplified random effects structure to allow convergence
m <- glmer(isRight~freqC+(1|subjCode)+(1|target)+(1|version),data=filter(all_data, block=="name_check"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: isRight ~ freqC + (1 | subjCode) + (1 | target) + (1 | version)
##    Data: filter(all_data, block == "name_check")
## 
##      AIC      BIC   logLik deviance df.resid 
##    432.6    459.0   -211.3    422.6     1443 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.6139  0.0712  0.1209  0.1209  0.6991 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  subjCode (Intercept) 2.963    1.721   
##  target   (Intercept) 0.000    0.000   
##  version  (Intercept) 0.000    0.000   
## Number of obs: 1448, groups:  subjCode, 181; target, 18; version, 4
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   4.5256     0.4625   9.785  < 2e-16 ***
## freqC         1.0592     0.3258   3.252  0.00115 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC 0.243 
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Reaction Times

Note: We compute reaction times for correct trials only, since reaction times for incorrect responses are difficult to interpret. However, similar patterns of results (generally slower reaction times for low-frequency words) hold when including all trials.

Descriptives
# reaction times
nameCheckRT <-  summary_se_within_cis(subset(subjAccFreq,block=="name_check"), measurevar="correct_rt",withinvars=c("freq"),idvar="subjCode")
nameCheckRT %>%
  kable()
freq N correct_rt lowerCI upperCI
hf 181 2627.023 2532.442 2721.605
lf 181 2741.198 2646.617 2835.780

Paired t-test comparison

#t-test
t.test(subset(subjAccFreq,block=="name_check")$correct_rt[subset(subjAccFreq,block=="name_check")$freq=="hf"],
       subset(subjAccFreq,block=="name_check")$correct_rt[subset(subjAccFreq,block=="name_check")$freq=="lf"],paired=T)
## 
##  Paired t-test
## 
## data:  subset(subjAccFreq, block == "name_check")$correct_rt[subset(subjAccFreq, block == "name_check")$freq == "hf"] and subset(subjAccFreq, block == "name_check")$correct_rt[subset(subjAccFreq, block == "name_check")$freq == "lf"]
## t = -1.6843, df = 180, p-value = 0.09385
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -247.93366   19.58353
## sample estimates:
## mean of the differences 
##               -114.1751
Linear mixed-effects model

First, we fit a linear mixed-effects model with untransformed reaction times (for correct trials only).

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
m <- lmer(rt~freqC+(1+freqC|subjCode)+(1+freqC|target)+(1|version),data=filter(all_data, block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target) +  
##     (1 | version)
##    Data: filter(all_data, block == "name_check" & isRight == 1)
## 
## REML criterion at convergence: 23814.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0055 -0.5383 -0.2226  0.2696  8.4164 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  subjCode (Intercept)  330196   574.63       
##           freqC        108940   330.06  -0.49
##  target   (Intercept)   47056   216.92       
##           freqC          6217    78.85  -1.00
##  version  (Intercept)    6992    83.62       
##  Residual             1296825  1138.78       
## Number of obs: 1395, groups:  subjCode, 181; target, 18; version, 4
## 
## Fixed effects:
##             Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept) 2692.354     84.669    6.812  31.799 1.16e-08 ***
## freqC       -106.249     68.673   70.457  -1.547    0.126    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.260
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

As is typical in reaction-time data, the distribution of reaction times is skewed (long right tail).

#distribution of reaction times
ggplot(filter(all_data, block=="name_check"&isRight==1),aes(rt))+
  geom_histogram()+
  xlab("Reaction times (ms) - correct trials")

To address possible resulting violations of model assumptions (non-normal residuals), a common modeling decision is to log-transform reaction times (Cox & Box, 1964; but see e.g., Schramm & Rouder, 2019). We also fit the same linear mixed-effects model with log-transformed reaction times, to ensure that any frequency-based differences are robust across transformations of reaction times.

#linear mixed-effects model with maximal random effects structure (subjects and items), including accounting for non-independence of datasets
# log-transformed reaction times
m <- lmer(log_rt~freqC+(1+freqC|subjCode)+(1+freqC|target)+(1|version),data=filter(all_data, block=="name_check"&isRight==1))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log_rt ~ freqC + (1 + freqC | subjCode) + (1 + freqC | target) +  
##     (1 | version)
##    Data: filter(all_data, block == "name_check" & isRight == 1)
## 
## REML criterion at convergence: 1194
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.5506 -0.6295 -0.1389  0.4860  3.9971 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr 
##  subjCode (Intercept) 0.0350943 0.18733       
##           freqC       0.0109196 0.10450  -0.24
##  target   (Intercept) 0.0082936 0.09107       
##           freqC       0.0002920 0.01709  -1.00
##  version  (Intercept) 0.0009141 0.03023       
##  Residual             0.1114986 0.33391       
## Number of obs: 1395, groups:  subjCode, 181; target, 18; version, 4
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   7.81079    0.03113   9.52514 250.948   <2e-16 ***
## freqC        -0.03396    0.02003 102.65007  -1.696    0.093 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##       (Intr)
## freqC -0.187
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Plotting Accuracy and Reaction Times

#plot
final_retention_plot(
  nameCheckAcc, #summarized accuracy data
  subset(subjAccFreq,block=="name_check"), #subject accuracy data
  nameCheckRT, #summarized RT data
  subset(subjAccFreq,block=="name_check"), # subject RT data
  here::here("plots","exps1to4_finalNameCheck.jpg")
  )

Frequency Effect on Word Choice

Experiment 1

Main Model

In our main analysis, we considered participants’ likelihood of choosing the word for the nearest compass direction, dependent on whether that compass direction was a high- or a low-frequency word, while controlling for the distance from the nearest learned compass direction. We focused specifically on low-frequency/high-frequency trials, in which a compass direction was tested in between a low-frequency and a high-frequency trained direction.

As a conservative test, we retained only trials in which participants chose one of the two principal direction words within 45° of the stimulus direction (94.41% of all low-frequency/high-frequency trials).

#just trials with a left or right angle choice
#model
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2453.4   2514.6  -1216.7   2433.4     3348 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.9254  0.0982  0.2040  0.4370  2.2482 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.240227 0.49013             
##              hfTrial             1.211711 1.10078  -0.26      
##              angleDiffFromMatchC 0.001383 0.03719  -0.98  0.06
##  targetLabel (Intercept)         0.020018 0.14149             
## Number of obs: 3358, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.34236    0.12216  19.174  < 2e-16 ***
## hfTrial              0.70564    0.20946   3.369 0.000755 ***
## angleDiffFromMatchC -0.22760    0.01347 -16.892  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial     -0.145       
## anglDffFrMC -0.778  0.039
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:10,]
##                          2.5 %     97.5 %
## (Intercept)          2.1029300  2.5817911
## hfTrial              0.2951182  1.1161689
## angleDiffFromMatchC -0.2540037 -0.2011891
#calculate shift in x-axis units (degrees of angle)
shift_x <- -summary(m)$coefficients[2,1]/summary(m)$coefficients[3,1]
#low 95% CI
shift_x_lower <- -confint(m,method="Wald")[8:10,][2,1]/summary(m)$coefficients[3,1]
#high 95% CI
shift_x_upper <- -confint(m,method="Wald")[8:10,][2,2]/summary(m)$coefficients[3,1]

## Main model has a singular fit warning - since this fit does not appear to impact fit, we retained the more complex random effects structure.
## However, we also fit a simplified model with the random slope for (the less theoretically important predictor) angleDiffFromMatchC removed, to ensure that the results are similar across different random effects structures and to alleviate concerns about a the boundary fit.
## This model yields very similar results (uncomment model below to view)
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

This effect corresponded to an estimated 3.1° shift (95% CI = [1.3°, 4.9°]) in participants’ decision boundary for high-frequency words as compared to low-frequency words.

Explanation: The shift in decision boundary is computed from the parameter estimates (beta coefficients) of the logistic mixed-effects model estimating the difference between frequency condition, controlling for distance from the nearest compass direction (the main analysis in the paper). To compute the shift in decision boundary, we answer the following question: what shift in angle distance (from the nearest compass direction) corresponds to moving from the low-frequency condition (coded as -0.5) to the high-frequency condition (coded as 0.5), based on the model predictions? Model predictions are based on the fixed effects of the model, which are determined by the following formula (predictions are in logit/ log-odds space in logistic regression):

\[logit = b_0+b_1*condition+b_2*distance\]

In particular, we are asking what adjustment c to distance allows the prediction for the low-frequency condition (condition=-0.5) to be equal to the prediction for the high frequency condition (condition=0.5). This means that the decision boundary shift c can be determined by solving the following equation: \[b_0+b_1*0.5+b_2*(distance+c) = b_0+b_1*(-0.5)+b_2*distance\] This equation can be simplified to: \[c = -\frac{b_1}{b_2}\]

Robustness Checks

Controlling for final retention accuracy of labels on each trial

To ensure that the frequency effect is not an artifact of participants’ being slightly more likely to forget the low-frequency labels, we first re-fit the model while controlling for participants’ accuracy during the Untimed Retention Test for the two (nearby) compass directions involved in each trial.

#controlling for accuracy for nearby labels
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels+(1+hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1), family=binomial, glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## matchChoice ~ hfTrial + angleDiffFromMatchC + finalAccuracyNearbyLabels +  
##     (1 + hfTrial + angleDiffFromMatchC + finalAccuracyNearbyLabels |  
##         subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2461.2   2553.0  -1215.6   2431.2     3343 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -9.3204  0.0982  0.2044  0.4364  2.2383 
## 
## Random effects:
##  Groups      Name                      Variance Std.Dev. Corr             
##  subjCode    (Intercept)               0.210633 0.45895                   
##              hfTrial                   1.219664 1.10438  -0.83            
##              angleDiffFromMatchC       0.001256 0.03544   0.49  0.08      
##              finalAccuracyNearbyLabels 0.637278 0.79830  -0.81  0.35 -0.91
##  targetLabel (Intercept)               0.017727 0.13314                   
## Number of obs: 3358, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                1.97635    0.94416   2.093 0.036329 *  
## hfTrial                    0.71757    0.21023   3.413 0.000642 ***
## angleDiffFromMatchC       -0.22721    0.01337 -16.997  < 2e-16 ***
## finalAccuracyNearbyLabels  0.36827    0.95035   0.388 0.698380    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.054              
## anglDffFrMC -0.054  0.047       
## fnlAccrcyNL -0.991  0.038 -0.046
## optimizer (bobyqa) convergence code: 1 (bobyqa -- maximum number of function evaluations exceeded)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[12:15,]
##                                2.5 %     97.5 %
## (Intercept)                0.1258202  3.8268763
## hfTrial                    0.3055331  1.1296137
## angleDiffFromMatchC       -0.2534079 -0.2010068
## finalAccuracyNearbyLabels -1.4943857  2.2309223
## maximal model yields a singular fit
## model with simpler random-effects structure (removing non-theoretically important random slope for angleDiffFromMatchC and finalAccuracyNearbyLabels) yields similar results for frequency effect without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Including only participants with perfect recall for all compass directions at the end of the experiment

To further ensure that the frequency effect is not an artifact of participants’ being slightly more likely to forget the low-frequency labels, we next re-fit the same model using a stricter inclusion criterion, including only participants who recalled all items correctly during the Untimed Retetion test.

final_accuracy <- all_data %>%
  filter(version=="exp1") %>%
  filter(trialType=="finalName") %>%
  group_by(subjCode,trialType) %>%
  summarize(N=n(),accuracy=mean(isRight)) %>%
  ungroup()

#select only participants with perfect recall on the final test block
perfect_final_accuracy_subjects <- as.character(filter(final_accuracy,accuracy==1)$subjCode)

m=glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1&subjCode %in% perfect_final_accuracy_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & listChoice == 1 & subjCode %in%  
##     perfect_final_accuracy_subjects)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2108.7   2168.6  -1044.3   2088.7     2946 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.7064  0.0947  0.1974  0.4321  2.1530 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.187489 0.43300             
##              hfTrial             0.785634 0.88636  -0.17      
##              angleDiffFromMatchC 0.001241 0.03523  -0.96 -0.11
##  targetLabel (Intercept)         0.074566 0.27307             
## Number of obs: 2956, groups:  subjCode, 34; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.46765    0.13898  17.755  < 2e-16 ***
## hfTrial              0.54033    0.19591   2.758  0.00582 ** 
## angleDiffFromMatchC -0.23838    0.01465 -16.268  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial     -0.085       
## anglDffFrMC -0.722 -0.001
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:10,]
##                          2.5 %     97.5 %
## (Intercept)          2.1952530  2.7400423
## hfTrial              0.1563494  0.9243204
## angleDiffFromMatchC -0.2671023 -0.2096603
## maximal model yields a singular fit
## model with simpler random-effects structure (random slope for angleDiffFromMatchC removed) yields similar results without singular fit
# m=glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1&subjCode %in% perfect_final_accuracy_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Controlling for compass direction character length

The words given to each of the compass directions varied in character length (and therefore perhaps in how easy they are to produce/ type). Beyond randomly assigning compass directions and counterbalancing their roles across participants, we also fit all models with by-item random effects to ensure that the effect of frequency generalizes across items. In the following model, we also explicitly control for character length to ensure that the effects hold even after accounting for character length of the nearest/ target compass direction.

m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+nearestLabel_length+(1+hfTrial+angleDiffFromMatchC+nearestLabel_length|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + nearestLabel_length +  
##     (1 + hfTrial + angleDiffFromMatchC + nearestLabel_length |  
##         subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2444.1   2535.9  -1207.1   2414.1     3343 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.0225  0.0931  0.2010  0.4242  2.3324 
## 
## Random effects:
##  Groups      Name                Variance  Std.Dev.  Corr             
##  subjCode    (Intercept)         2.899e+00 1.703e+00                  
##              hfTrial             1.359e+00 1.166e+00 -0.04            
##              angleDiffFromMatchC 1.458e-03 3.819e-02  0.22  0.00      
##              nearestLabel_length 1.869e-01 4.323e-01 -0.96 -0.03 -0.46
##  targetLabel (Intercept)         8.176e-09 9.042e-05                  
## Number of obs: 3358, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.57496    0.39227   6.564 5.23e-11 ***
## hfTrial              0.68557    0.21902   3.130  0.00175 ** 
## angleDiffFromMatchC -0.23066    0.01371 -16.829  < 2e-16 ***
## nearestLabel_length -0.04607    0.09452  -0.487  0.62595    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.040              
## anglDffFrMC -0.096  0.021       
## nrstLbl_lng -0.955 -0.005 -0.144
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[12:15,]
##                          2.5 %     97.5 %
## (Intercept)          1.8061343  3.3437887
## hfTrial              0.2563054  1.1148333
## angleDiffFromMatchC -0.2575182 -0.2037935
## nearestLabel_length -0.2313387  0.1391890
## maximal model yields a singular fit
## model with simpler random-effects structure (random slopes for angleDiffFromMatchC and nearestLabel_length removed) yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+nearestLabel_length+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Controlling for number of training blocks

Since participants were required to produce all 8 compass directions perfectly during a Word Recall block in order to advance to the Treasure Hunt Phase (otherwise returning to the Word Learning Phase for further training), participants varied in the duration of their training. The extent to which participants were trained on the compass directions may influence the degree to which participants exhibited an effect of frequency on lexical selection. In the main logistic mixed-effects analyses demonstrating the effect of word frequency on lexical selection, we also fit a model controlling for differences in training duration by including the number of training blocks as a fixed effect.

m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+num_pairlearn_blocks+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + num_pairlearn_blocks +  
##     (1 + hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2455.4   2522.7  -1216.7   2433.4     3347 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.9335  0.0982  0.2041  0.4372  2.2454 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.239875 0.48977             
##              hfTrial             1.212121 1.10096  -0.26      
##              angleDiffFromMatchC 0.001383 0.03718  -0.98  0.06
##  targetLabel (Intercept)         0.019839 0.14085             
## Number of obs: 3358, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)           2.356778   0.202841  11.619  < 2e-16 ***
## hfTrial               0.705767   0.209484   3.369 0.000754 ***
## angleDiffFromMatchC  -0.227600   0.013474 -16.892  < 2e-16 ***
## num_pairlearn_blocks -0.003137   0.035225  -0.089 0.929045    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.080              
## anglDffFrMC -0.471  0.040       
## nm_prlrn_bl -0.799 -0.008  0.004
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:11,]
##                            2.5 %      97.5 %
## (Intercept)           1.95921785  2.75433905
## hfTrial               0.29518598  1.11634837
## angleDiffFromMatchC  -0.25400799 -0.20119249
## num_pairlearn_blocks -0.07217659  0.06590322
## maximal model yields a singular fit
## model with simpler random-effects structure (random slope for angleDiffFromMatchC removed) yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+num_pairlearn_blocks+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Checking for an interaction with distance

We also investigated whether distance interacted with frequency condition in predicting lexical selection. We find no evidence of an interaction between frequency and distance.

#full interaction model
#does not converge (boundary fit)
#m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial*angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
#simplified random effects structure preserving critical interaction random effect (qualitatively similar results to more complex models)
m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial:angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## matchChoice ~ hfTrial * angleDiffFromMatchC + (1 + hfTrial:angleDiffFromMatchC |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2477.5   2526.5  -1230.8   2461.5     3350 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -11.2560   0.0964   0.2240   0.4624   2.6402 
## 
## Random effects:
##  Groups      Name                        Variance Std.Dev. Corr 
##  subjCode    (Intercept)                 0.09213  0.3035        
##              hfTrial:angleDiffFromMatchC 0.01640  0.1280   -0.67
##  targetLabel (Intercept)                 0.02173  0.1474        
## Number of obs: 3358, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  2.21327    0.09930  22.288  < 2e-16 ***
## hfTrial                      0.84854    0.15822   5.363 8.19e-08 ***
## angleDiffFromMatchC         -0.21592    0.01152 -18.735  < 2e-16 ***
## hfTrial:angleDiffFromMatchC -0.02118    0.03049  -0.694    0.487    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.093              
## anglDffFrMC -0.597  0.140       
## hfTrl:nDFMC -0.132 -0.535 -0.125

Reaction Time Analysis

Descriptives

We investigated participants’ speed in responding on trials in which they chose the nearest word (thereby maximizing message alignment - analogous to RT on “correct” trials).

# splitting reaction time by word frequency on trials during the Treasure Hunt Phase
summarized_rt <- all_data %>%
  filter(version=="exp1") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency"))%>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt)
hfTrial N rt se lower_ci upper_ci
low-frequency 831 2663.290 43.89452 2577.133 2749.448
high-frequency 1920 2208.123 24.63067 2159.817 2256.429
summarized_rt_block <- all_data %>%
  filter(version=="exp1") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("block","hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency")) %>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt_block)
block hfTrial N rt se lower_ci upper_ci
test_a low-frequency 298 2697.804 60.73265 2578.283 2817.325
test_a high-frequency 1244 2171.240 24.96053 2122.271 2220.210
test_b low-frequency 533 2643.994 44.40167 2556.770 2731.218
test_b high-frequency 676 2275.995 33.75532 2209.717 2342.273

Linear mixed-effects model

We fit a linear mixed-effect model predicting participants’ reaction times from Word Frequency (centered; High = -0.5 vs. Low = -0.5) and Distance from Nearest Principal Direction with the same random effects structure as above.

#RT effect on trials in which nearest word is chosen
m=lmer(rt~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## rt ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial + angleDiffFromMatchC |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 44593.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.5725 -0.6756 -0.2324  0.4728  6.2020 
## 
## Random effects:
##  Groups      Name                Variance  Std.Dev. Corr       
##  subjCode    (Intercept)         103153.79 321.176             
##              hfTrial              93233.81 305.342  -0.68      
##              angleDiffFromMatchC     20.38   4.514   0.12  0.29
##  targetLabel (Intercept)          24843.59 157.618             
##  Residual                        611630.85 782.068             
## Number of obs: 2751, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)         2455.289     65.679   45.584   37.38  < 2e-16 ***
## hfTrial             -405.370     61.330   39.900   -6.61 6.66e-08 ***
## angleDiffFromMatchC   10.071      2.665   33.770    3.78  0.00061 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial     -0.483       
## anglDffFrMC  0.017  0.182
#Anova(m,type="III",test="F")
confint(m,method="Wald")
##                           2.5 %     97.5 %
## .sig01                       NA         NA
## .sig02                       NA         NA
## .sig03                       NA         NA
## .sig04                       NA         NA
## .sig05                       NA         NA
## .sig06                       NA         NA
## .sig07                       NA         NA
## .sigma                       NA         NA
## (Intercept)         2326.560214 2584.01705
## hfTrial             -525.574789 -285.16436
## angleDiffFromMatchC    4.848783   15.29387
#no interaction with block
#include highest order interaction terms as random slopes
m=lmer(rt~(hfTrial+angleDiffFromMatchC)*blockC+(1+hfTrial:blockC+angleDiffFromMatchC:blockC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ (hfTrial + angleDiffFromMatchC) * blockC + (1 + hfTrial:blockC +  
##     angleDiffFromMatchC:blockC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 44581.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.3139 -0.6736 -0.2381  0.4750  6.0297 
## 
## Random effects:
##  Groups      Name                       Variance Std.Dev. Corr       
##  subjCode    (Intercept)                127481   357.04              
##              hfTrial:blockC              50071   223.76    0.96      
##              blockC:angleDiffFromMatchC   1268    35.61   -0.74 -0.53
##  targetLabel (Intercept)                 27225   165.00              
##  Residual                               621439   788.31              
## Number of obs: 2751, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                            Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)                2480.092     75.690   50.258  32.766  < 2e-16 ***
## hfTrial                    -410.046     37.331 2469.048 -10.984  < 2e-16 ***
## angleDiffFromMatchC          19.388      4.838 2698.072   4.007 6.31e-05 ***
## blockC                     -166.527     60.974 2692.766  -2.731  0.00635 ** 
## hfTrial:blockC              145.642     77.728   99.610   1.874  0.06390 .  
## angleDiffFromMatchC:blockC   -8.396     11.276   40.714  -0.745  0.46078    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC blockC hfTr:C
## hfTrial     -0.074                            
## anglDffFrMC -0.064  0.003                     
## blockC       0.057  0.150 -0.824              
## hfTrl:blckC  0.394 -0.085 -0.020 -0.180       
## anglDfFMC:C -0.569 -0.016  0.104 -0.132 -0.124
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
#Anova(m,type="III",test="F")

Plot

Plot the effect of training frequency on word/ compass direction choice.

#refit model without centering angle for simpler plotting (coefficients essentially equivalent)
m <- glmer(matchChoice~hfTrial+angleDiffFromMatch+(1+hfTrial+angleDiffFromMatch|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))

#create predicted data
pX <- expand.grid(angleDiffFromMatch=seq(0,22.5,by=0.1),hfTrial=c(-0.5,0.5))
predictions <- predictSE(m,pX,re.form=NA, type="response")
pX$fit <- predictions$fit
pX$se.fit <- predictions$se.fit

p_freq1 <- plot_frequency_effect(
  experiment_data=filter(all_data, version=="exp1"),
  predicted_data=pX,
  plot_option="plot2",
  plot_path = here::here("plots","exp1_frequencyEffect.jpg")
  )
p_freq1

Experiment 2

Main Model

As in Experiment 1, we considered participants’ likelihood of choosing the word for the nearest compass direction, dependent on whether that compass direction was a high- or a low-frequency word, while controlling for the distance from the nearest learned compass direction. We focused specifically on low-frequency/high-frequency trials, in which a compass direction was tested in between a low-frequency and a high-frequency trained direction.

As a conservative test, we retained only trials in which participants chose one of the two principal direction words within 45° of the stimulus direction (93.78% of all low-frequency/high-frequency trials).

#just trials with a left or right angle choice
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1961.2   2019.4   -970.6   1941.2     2477 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.5877  0.0733  0.2173  0.4400  3.2164 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.19173  0.43787             
##              hfTrial             3.47024  1.86286   0.16      
##              angleDiffFromMatchC 0.00165  0.04062  -1.00 -0.16
##  targetLabel (Intercept)         0.08061  0.28392             
## Number of obs: 2487, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          1.98412    0.13135  15.105  < 2e-16 ***
## hfTrial              1.35682    0.31086   4.365 1.27e-05 ***
## angleDiffFromMatchC -0.18780    0.01394 -13.476  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial      0.129       
## anglDffFrMC -0.637 -0.075
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:10,]
##                          2.5 %     97.5 %
## (Intercept)          1.7266685  2.2415632
## hfTrial              0.7475493  1.9660902
## angleDiffFromMatchC -0.2151160 -0.1604871
#calculate shift in x-axis units (degrees of angle)
shift_x <- -summary(m)$coefficients[2,1]/summary(m)$coefficients[3,1]
#low 95% CI
shift_x_lower <- -confint(m,method="Wald")[8:10,][2,1]/summary(m)$coefficients[3,1]
#high 95% CI
shift_x_upper <- -confint(m,method="Wald")[8:10,][2,2]/summary(m)$coefficients[3,1]


## maximal model yields a singular fit
## model with simpler random-effects structure (random slope for angleDiffFromMatchC removed) yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

This effect corresponded to an estimated 7.22° shift (95% CI = [3.98°, 10.47°]) in participants’ decision boundary for high-frequency words as compared to low-frequency words.

Robustness Checks

Controlling for final retention accuracy of labels on each trial

To ensure that the frequency effect is not an artifact of participants’ being slightly more likely to forget the low-frequency labels, we first re-fit the model while controlling for participants’ accuracy during the Untimed Retention Test for the two (nearby) compass directions involved in each trial.

#controlling for accuracy for nearby labels
m=glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels+(1+hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## matchChoice ~ hfTrial + angleDiffFromMatchC + finalAccuracyNearbyLabels +  
##     (1 + hfTrial + angleDiffFromMatchC + finalAccuracyNearbyLabels |  
##         subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1962.7   2050.0   -966.4   1932.7     2472 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.8718  0.0705  0.2146  0.4369  3.0736 
## 
## Random effects:
##  Groups      Name                      Variance Std.Dev. Corr             
##  subjCode    (Intercept)               1.031796 1.01577                   
##              hfTrial                   3.454956 1.85875  -0.07            
##              angleDiffFromMatchC       0.001705 0.04129  -0.05 -0.22      
##              finalAccuracyNearbyLabels 1.349523 1.16169  -0.92  0.15 -0.36
##  targetLabel (Intercept)               0.078372 0.27995                   
## Number of obs: 2487, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.57997    0.74877   0.775   0.4386    
## hfTrial                    1.35959    0.31051   4.379 1.19e-05 ***
## angleDiffFromMatchC       -0.19049    0.01415 -13.467  < 2e-16 ***
## finalAccuracyNearbyLabels  1.46629    0.75850   1.933   0.0532 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial      0.001              
## anglDffFrMC -0.035 -0.098       
## fnlAccrcyNL -0.984  0.029 -0.082
## optimizer (bobyqa) convergence code: 1 (bobyqa -- maximum number of function evaluations exceeded)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[12:15,]
##                                 2.5 %     97.5 %
## (Intercept)               -0.88760238  2.0475392
## hfTrial                    0.75099370  1.9681829
## angleDiffFromMatchC       -0.21821706 -0.1627696
## finalAccuracyNearbyLabels -0.02033322  2.9529131
## maximal model yields a singular fit
## model with simpler random-effects structure (removing non-theoretically important random slope for angleDiffFromMatchC) yields similar results for frequency effect without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels+(1+hfTrial+finalAccuracyNearbyLabels|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Including only participants with perfect recall for all compass directions at the end of the experiment

To further ensure that the frequency effect is not an artifact of participants’ being slightly more likely to forget the low-frequency labels, we next re-fit the same model using a stricter inclusion criterion, including only participants who recalled all items correctly during the Untimed Retetion test.

final_accuracy <- all_data %>%
  filter(version=="exp2") %>%
  filter(trialType=="finalName") %>%
  group_by(subjCode,trialType) %>%
  summarize(N=n(),accuracy=mean(isRight)) %>%
  ungroup()

#select only participants with perfect recall on the final test block
perfect_final_accuracy_subjects <- as.character(filter(final_accuracy,accuracy==1)$subjCode)

m=glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1&subjCode %in% perfect_final_accuracy_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & listChoice == 1 & subjCode %in%  
##     perfect_final_accuracy_subjects)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1611.8   1667.8   -795.9   1591.8     1990 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.9569  0.0908  0.2327  0.4591  2.0653 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.18320  0.42802             
##              hfTrial             1.85778  1.36301   0.26      
##              angleDiffFromMatchC 0.00146  0.03822  -0.97 -0.01
##  targetLabel (Intercept)         0.05249  0.22910             
## Number of obs: 2000, groups:  subjCode, 35; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          1.99128    0.13653  14.585  < 2e-16 ***
## hfTrial              1.19493    0.27050   4.417 9.99e-06 ***
## angleDiffFromMatchC -0.18848    0.01542 -12.227  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial      0.182       
## anglDffFrMC -0.686 -0.005
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:10,]
##                          2.5 %     97.5 %
## (Intercept)          1.7236917  2.2588695
## hfTrial              0.6647553  1.7251108
## angleDiffFromMatchC -0.2186979 -0.1582714
## maximal model yields a singular fit
## model with simpler random-effects structure (random slope for angleDiffFromMatchC removed) yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1& subjCode %in% perfect_final_accuracy_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Controlling for compass direction character length

The words given to each of the compass directions varied in character length (and therefore perhaps in how easy they are to produce/ type). Beyond randomly assigning compass directions and counterbalancing their roles across participants, we also fit all models with by-item random effects to ensure that the effect of frequency generalizes across items. In the following model, we also explicitly control for character length to ensure that the effects hold even after accounting for character length of the nearest/ target compass direction.

m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+nearestLabel_length+(1+hfTrial+angleDiffFromMatchC+nearestLabel_length|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + nearestLabel_length +  
##     (1 + hfTrial + angleDiffFromMatchC + nearestLabel_length |  
##         subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1941.9   2029.2   -955.9   1911.9     2472 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -6.2232  0.0650  0.1983  0.4176  2.7407 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr             
##  subjCode    (Intercept)         7.669523 2.76939                   
##              hfTrial             4.252683 2.06220  -0.06            
##              angleDiffFromMatchC 0.002073 0.04553  -0.40 -0.03      
##              nearestLabel_length 0.338722 0.58200  -0.99  0.09  0.27
##  targetLabel (Intercept)         0.065589 0.25610                   
## Number of obs: 2487, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          1.35294    0.61775   2.190   0.0285 *  
## hfTrial              1.38449    0.34422   4.022 5.77e-05 ***
## angleDiffFromMatchC -0.19457    0.01496 -13.005  < 2e-16 ***
## nearestLabel_length  0.16554    0.13646   1.213   0.2251    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.027              
## anglDffFrMC -0.213 -0.033       
## nrstLbl_lng -0.975  0.060  0.069
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[12:15,]
##                          2.5 %     97.5 %
## (Intercept)          0.1421755  2.5636972
## hfTrial              0.7098325  2.0591494
## angleDiffFromMatchC -0.2238872 -0.1652437
## nearestLabel_length -0.1019137  0.4330036
## maximal model yields a singular fit
## model with simpler random-effects structure (random slope for angleDiffFromMatchC removed) yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+nearestLabel_length+(1+hfTrial+nearestLabel_length|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Controlling for number of training blocks

Since participants were required to produce all 8 compass directions perfectly during a Word Recall block in order to advance to the Treasure Hunt Phase (otherwise returning to the Word Learning Phase for further training), participants varied in the duration of their training. The extent to which participants were trained on the compass directions may influence the degree to which participants exhibited an effect of frequency on lexical selection. In the main logistic mixed-effects analyses demonstrating the effect of word frequency on lexical selection, we also fit a model controlling for differences in training duration by including the number of training blocks as a fixed effect.

m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+num_pairlearn_blocks+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + num_pairlearn_blocks +  
##     (1 + hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1961.2   2025.2   -969.6   1939.2     2476 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.7185  0.0745  0.2188  0.4388  3.2439 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.164230 0.4053              
##              hfTrial             3.397112 1.8431    0.21      
##              angleDiffFromMatchC 0.001529 0.0391   -1.00 -0.18
##  targetLabel (Intercept)         0.074289 0.2726              
## Number of obs: 2487, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)           2.14303    0.16957  12.638  < 2e-16 ***
## hfTrial               1.35767    0.30802   4.408 1.04e-05 ***
## angleDiffFromMatchC  -0.18700    0.01385 -13.505  < 2e-16 ***
## num_pairlearn_blocks -0.03944    0.02708  -1.456    0.145    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial      0.118              
## anglDffFrMC -0.464 -0.078       
## nm_prlrn_bl -0.660 -0.009 -0.022
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:11,]
##                            2.5 %      97.5 %
## (Intercept)           1.81068581  2.47537104
## hfTrial               0.75395528  1.96137685
## angleDiffFromMatchC  -0.21413470 -0.15985738
## num_pairlearn_blocks -0.09252334  0.01364381
## maximal model yields a singular fit
## model with simpler random-effects structure yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+num_pairlearn_blocks+(1|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Checking for an interaction with distance

We also investigated whether distance interacted with frequency condition in predicting lexical selection. We find no evidence of an interaction between frequency and distance.

#full interaction model
#does not converge (boundary fit)
# m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial*angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)
#simplified random effects structure preserving critical interaction random effect (qualitatively similar results to more complex models)
m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial+hfTrial:angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial * angleDiffFromMatchC + (1 + hfTrial +  
##     hfTrial:angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1967.5   2031.5   -972.7   1945.5     2476 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -6.8213  0.0848  0.2182  0.4422  3.2858 
## 
## Random effects:
##  Groups      Name                        Variance Std.Dev. Corr       
##  subjCode    (Intercept)                 0.045087 0.21234             
##              hfTrial                     3.344382 1.82877   0.41      
##              hfTrial:angleDiffFromMatchC 0.002523 0.05023  -0.59  0.23
##  targetLabel (Intercept)                 0.079293 0.28159             
## Number of obs: 2487, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                              Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  1.911227   0.118181  16.172  < 2e-16 ***
## hfTrial                      1.392498   0.324233   4.295 1.75e-05 ***
## angleDiffFromMatchC         -0.177539   0.012916 -13.746  < 2e-16 ***
## hfTrial:angleDiffFromMatchC -0.009004   0.025030  -0.360    0.719    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial      0.129              
## anglDffFrMC -0.523  0.033       
## hfTrl:nDFMC -0.002 -0.253 -0.071

Reaction Time Analysis

Descriptives

We investigated participants’ speed in responding on trials in which they chose the nearest word (thereby maximizing message alignment - analogous to RT on “correct” trials).

# splitting reaction time by word frequency on trials during the Treasure Hunt Phase
summarized_rt <- all_data %>%
  filter(version=="exp2") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency"))%>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt)
hfTrial N rt se lower_ci upper_ci
low-frequency 566 2501.262 52.85624 2397.443 2605.081
high-frequency 1380 2277.813 29.61640 2219.715 2335.911
summarized_rt_block <- all_data %>%
  filter(version=="exp2") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("block","hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency")) %>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt_block)
block hfTrial N rt se lower_ci upper_ci
ambig low-frequency 379 2503.217 49.55543 2405.778 2600.655
ambig high-frequency 468 2266.878 40.43001 2187.431 2346.325
clear low-frequency 57 2649.258 177.80921 2293.063 3005.452
clear high-frequency 317 2369.977 48.91000 2273.747 2466.208
clear2 low-frequency 130 2430.672 69.56201 2293.042 2568.303
clear2 high-frequency 595 2237.312 33.62974 2171.265 2303.360

Linear mixed-effects model

We fit a linear mixed-effect model predicting participants’ reaction times from Word Frequency (centered; High = -0.5 vs. Low = -0.5) and Distance from Nearest Principal Direction with the same random effects structure as above.

#RT effect on trials in which nearest word is chosen
#maximal model does not converge, so remove least important
m=lmer(rt~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## rt ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial + angleDiffFromMatchC |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 31602.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2649 -0.6685 -0.2096  0.4536  7.0173 
## 
## Random effects:
##  Groups      Name                Variance  Std.Dev. Corr       
##  subjCode    (Intercept)          89443.05 299.070             
##              hfTrial             113307.75 336.612  -0.23      
##              angleDiffFromMatchC     26.23   5.122  -0.35  0.99
##  targetLabel (Intercept)          50706.75 225.182             
##  Residual                        617467.62 785.791             
## Number of obs: 1946, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)         2393.714     73.151   34.758  32.723  < 2e-16 ***
## hfTrial             -220.322     66.130   33.184  -3.332  0.00213 ** 
## angleDiffFromMatchC    9.134      3.172  195.478   2.879  0.00443 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial     -0.192       
## anglDffFrMC -0.060  0.329
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
#Anova(m,type="III",test="F")
confint(m,method="Wald")
##                           2.5 %    97.5 %
## .sig01                       NA        NA
## .sig02                       NA        NA
## .sig03                       NA        NA
## .sig04                       NA        NA
## .sig05                       NA        NA
## .sig06                       NA        NA
## .sig07                       NA        NA
## .sigma                       NA        NA
## (Intercept)         2250.340632 2537.0875
## hfTrial             -349.934974  -90.7097
## angleDiffFromMatchC    2.915708   15.3515
#no interaction with block
#include highest order interaction terms as random slopes
m=lmer(rt~(hfTrial+angleDiffFromMatchC)*blockC+(1+hfTrial:blockC+angleDiffFromMatchC:blockC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" &matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ (hfTrial + angleDiffFromMatchC) * blockC + (1 + hfTrial:blockC +  
##     angleDiffFromMatchC:blockC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 31635.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.9934 -0.6857 -0.2335  0.4428  7.5736 
## 
## Random effects:
##  Groups      Name                       Variance Std.Dev. Corr       
##  subjCode    (Intercept)                     0     0.00              
##              hfTrial:blockC              15956   126.32     NaN      
##              blockC:angleDiffFromMatchC   6114    78.19     NaN -1.00
##  targetLabel (Intercept)                 43649   208.92              
##  Residual                               656276   810.11              
## Number of obs: 1946, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                            Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)                2358.958     62.461   30.070  37.767  < 2e-16 ***
## hfTrial                    -243.789     43.779 1901.554  -5.569 2.93e-08 ***
## angleDiffFromMatchC          27.023      5.854 1894.700   4.616 4.18e-06 ***
## blockC                     -271.935     75.009 1889.876  -3.625 0.000296 ***
## hfTrial:blockC              -39.313     88.859  391.633  -0.442 0.658432    
## angleDiffFromMatchC:blockC    7.007     16.727   97.483   0.419 0.676210    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC blockC hfTr:C
## hfTrial     -0.141                            
## anglDffFrMC -0.060 -0.044                     
## blockC       0.035  0.224 -0.815              
## hfTrl:blckC  0.126 -0.126 -0.018 -0.226       
## anglDfFMC:C -0.347 -0.010  0.060 -0.070 -0.179
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
#Anova(m,type="III",test="F")

Plot

Plot the effect of training frequency on word/ compass direction choice.

#refit model without centering angle for simpler plotting (coefficients roughly equivalent)
m <- glmer(matchChoice~hfTrial+angleDiffFromMatch+(1+hfTrial+angleDiffFromMatch|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))

pX <- expand.grid(angleDiffFromMatch=seq(0,22.5,by=0.1),hfTrial=c(-0.5,0.5))

predictions <- predictSE(m,pX,re.form=NA, type="response")
pX$fit <- predictions$fit
pX$se.fit <- predictions$se.fit

p_freq2 <- plot_frequency_effect(
  experiment_data=filter(all_data, version=="exp2"),
  predicted_data=pX,
  plot_option="plot2",
  plot_path = here::here("plots","exp2_frequencyEffect.jpg")
  )
p_freq2

Experiment 3

Main Model

As in Experiments 1 & 2, we considered participants’ likelihood of choosing the word for the nearest compass direction, dependent on whether that compass direction was a high- or a low-frequency word, while controlling for the distance from the nearest learned compass direction. We focused specifically on low-frequency/high-frequency trials, in which a compass direction was tested in between a low-frequency and a high-frequency trained direction.

As a conservative test, we retained only trials in which participants chose one of the two principal direction words within 45° of the stimulus direction (95.17% of all low-frequency/high-frequency trials).

#just trials with a left or right angle choice
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2244.4   2304.9  -1112.2   2224.4     3143 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -9.3832  0.0842  0.1958  0.3990  2.9865 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.194531 0.44106             
##              hfTrial             4.020275 2.00506   0.00      
##              angleDiffFromMatchC 0.001765 0.04201  -0.99  0.13
##  targetLabel (Intercept)         0.124656 0.35307             
## Number of obs: 3153, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.29961    0.14009  16.415   <2e-16 ***
## hfTrial              1.17395    0.30174   3.891    1e-04 ***
## angleDiffFromMatchC -0.19687    0.01387 -14.195   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial      0.060       
## anglDffFrMC -0.619  0.040
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:10,]
##                          2.5 %    97.5 %
## (Intercept)          2.0250385  2.574175
## hfTrial              0.5825552  1.765340
## angleDiffFromMatchC -0.2240507 -0.169686
#calculate shift in x-axis units (degrees of angle)
shift_x <- -summary(m)$coefficients[2,1]/summary(m)$coefficients[3,1]
#low 95% CI
shift_x_lower <- -confint(m,method="Wald")[8:10,][2,1]/summary(m)$coefficients[3,1]
#high 95% CI
shift_x_upper <- -confint(m,method="Wald")[8:10,][2,2]/summary(m)$coefficients[3,1]

## maximal model yields a singular fit
## model with simpler random-effects structure (random slope for angleDiffFromMatchC removed) yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

This effect corresponded to an estimated 5.96° shift (95% CI = [2.96°, 8.97°]) in participants’ decision boundary for high-frequency words as compared to low-frequency words.

Robustness Checks

Controlling for final retention accuracy of labels on each trial

To ensure that the frequency effect is not an artifact of participants’ being slightly more likely to forget the low-frequency labels, we first re-fit the model while controlling for participants’ accuracy during the Untimed Retention Test for the two (nearby) compass directions involved in each trial.

#controlling for accuracy for nearby labels
#maximal model does not converge (degenerate Hessian) and has implausible standard errors
# m=glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels+(1+hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))

# refitting a simplified model with theoretically less important random slope removed (angleDiffFromMatchC)
m=glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels+(1+hfTrial+finalAccuracyNearbyLabels|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## matchChoice ~ hfTrial + angleDiffFromMatchC + finalAccuracyNearbyLabels +  
##     (1 + hfTrial + finalAccuracyNearbyLabels | subjCode) + (1 |  
##     targetLabel)
##    Data: subset(all_data, version == "exp3" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2227.5   2294.2  -1102.8   2205.5     3142 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -15.0671   0.0839   0.1980   0.3960   3.0173 
## 
## Random effects:
##  Groups      Name                      Variance Std.Dev. Corr       
##  subjCode    (Intercept)               2.9021   1.7036              
##              hfTrial                   3.9854   1.9964   -0.05      
##              finalAccuracyNearbyLabels 2.9534   1.7185   -1.00  0.08
##  targetLabel (Intercept)               0.1125   0.3353              
## Number of obs: 3153, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.52886    0.68368   0.774  0.43920    
## hfTrial                    1.20953    0.29876   4.048 5.16e-05 ***
## angleDiffFromMatchC       -0.19019    0.01146 -16.600  < 2e-16 ***
## finalAccuracyNearbyLabels  1.78806    0.68874   2.596  0.00943 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.030              
## anglDffFrMC -0.040  0.015       
## fnlAccrcyNL -0.985  0.050 -0.044
confint(m,method="Wald")[8:11,]
##                                2.5 %     97.5 %
## (Intercept)               -0.8111206  1.8688399
## hfTrial                    0.6239687  1.7950959
## angleDiffFromMatchC       -0.2126442 -0.1677336
## finalAccuracyNearbyLabels  0.4381420  3.1379716

Including only participants with perfect recall for all compass directions at the end of the experiment

To further ensure that the frequency effect is not an artifact of participants’ being slightly more likely to forget the low-frequency labels, we next re-fit the same model using a stricter inclusion criterion, including only participants who recalled all items correctly during the Untimed Retetion test.

final_accuracy <- all_data %>%
  filter(version=="exp3") %>%
  filter(trialType=="finalName") %>%
  group_by(subjCode,trialType) %>%
  summarize(N=n(),accuracy=mean(isRight)) %>%
  ungroup()

#select only participants with perfect recall on the final test block
perfect_final_accuracy_subjects <- as.character(filter(final_accuracy,accuracy==1)$subjCode)

m=glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1&subjCode %in% perfect_final_accuracy_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & listChoice == 1 & subjCode %in%  
##     perfect_final_accuracy_subjects)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1723.0   1781.0   -851.5   1703.0     2420 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -11.7263   0.0863   0.2002   0.4030   2.8142 
## 
## Random effects:
##  Groups      Name                Variance  Std.Dev. Corr       
##  subjCode    (Intercept)         0.0920585 0.30341             
##              hfTrial             3.7867560 1.94596   0.12      
##              angleDiffFromMatchC 0.0008041 0.02836  -0.97  0.14
##  targetLabel (Intercept)         0.0809354 0.28449             
## Number of obs: 2430, groups:  subjCode, 42; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.33787    0.12473  18.743  < 2e-16 ***
## hfTrial              0.98028    0.32847   2.984  0.00284 ** 
## angleDiffFromMatchC -0.19877    0.01388 -14.317  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial      0.060       
## anglDffFrMC -0.605  0.071
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:10,]
##                          2.5 %     97.5 %
## (Intercept)          2.0934018  2.5823363
## hfTrial              0.3364831  1.6240771
## angleDiffFromMatchC -0.2259792 -0.1715561
## maximal model yields a singular fit
## model with simpler random-effects structure (random slopes removed to allow convergence) yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1&subjCode %in% perfect_final_accuracy_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Controlling for compass direction character length

The words given to each of the compass directions varied in character length (and therefore perhaps in how easy they are to produce/ type). Beyond randomly assigning compass directions and counterbalancing their roles across participants, we also fit all models with by-item random effects to ensure that the effect of frequency generalizes across items. In the following model, we also explicitly control for character length to ensure that the effects hold even after accounting for character length of the nearest/ target compass direction.

# Full model has convergence issues (Unlike other models, standard errors appear to be dramatically underestimated, presumably due to singular fit issue)
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+nearestLabel_length+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))

#Simplified model removing by-participant random slope for angleDiffFromMatchC (i.e. slope not relevant to the effect of interest; results are consistent, with more plausible standard errors)
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+nearestLabel_length+(1+hfTrial+nearestLabel_length|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + nearestLabel_length +  
##     (1 + hfTrial + nearestLabel_length | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2233.7   2300.4  -1105.9   2211.7     3142 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -14.7983   0.0843   0.1970   0.3892   2.7868 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         5.3084   2.3040              
##              hfTrial             4.0622   2.0155    0.10      
##              nearestLabel_length 0.2928   0.5411   -1.00 -0.10
##  targetLabel (Intercept)         0.1397   0.3738              
## Number of obs: 3153, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.11935    0.61523   3.445 0.000571 ***
## hfTrial              1.19683    0.30234   3.959 7.54e-05 ***
## angleDiffFromMatchC -0.19112    0.01146 -16.679  < 2e-16 ***
## nearestLabel_length  0.03821    0.14283   0.267 0.789096    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial      0.057              
## anglDffFrMC -0.104  0.012       
## nrstLbl_lng -0.979 -0.048  0.012
confint(m,method="Wald")[8:11,]
##                          2.5 %     97.5 %
## (Intercept)          0.9135225  3.3251808
## hfTrial              0.6042486  1.7894092
## angleDiffFromMatchC -0.2135752 -0.1686596
## nearestLabel_length -0.2417426  0.3181540

Controlling for number of training blocks

Participants varied in the duration of their training. The extent to which participants were trained on the compass directions may influence the degree to which participants exhibited an effect of frequency on lexical selection. In the main logistic mixed-effects analyses demonstrating the effect of word frequency on lexical selection, we also fit a model controlling for differences in training duration by including the number of training blocks as a fixed effect.

m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+num_pairlearn_blocks+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + num_pairlearn_blocks +  
##     (1 + hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2246.3   2313.0  -1112.2   2224.3     3142 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -9.3731  0.0841  0.1961  0.3981  2.9868 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.192781 0.43907             
##              hfTrial             4.022200 2.00554   0.00      
##              angleDiffFromMatchC 0.001754 0.04189  -0.99  0.13
##  targetLabel (Intercept)         0.124508 0.35286             
## Number of obs: 3153, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)           2.280471   0.223309  10.212  < 2e-16 ***
## hfTrial               1.172908   0.301945   3.885 0.000103 ***
## angleDiffFromMatchC  -0.196813   0.013868 -14.192  < 2e-16 ***
## num_pairlearn_blocks  0.004113   0.037467   0.110 0.912591    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial      0.061              
## anglDffFrMC -0.414  0.039       
## nm_prlrn_bl -0.779 -0.031  0.035
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[8:11,]
##                            2.5 %      97.5 %
## (Intercept)           1.84279347  2.71814858
## hfTrial               0.58110739  1.76470856
## angleDiffFromMatchC  -0.22399362 -0.16963263
## num_pairlearn_blocks -0.06932202  0.07754774
## maximal model yields a singular fit
## model with simpler random-effects structure yields similar results without singular fit
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+num_pairlearn_blocks+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Checking for an interaction with distance

We also investigated whether distance interacted with frequency condition in predicting lexical selection. We find no evidence of an interaction between frequency and distance.

#full interaction model
#does not converge (boundary fit)
# m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial*angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)
#simplified random effects structure preserving critical interaction random effect (qualitatively similar results to more complex models)
m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial:angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## matchChoice ~ hfTrial * angleDiffFromMatchC + (1 + hfTrial:angleDiffFromMatchC |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2365.1   2413.5  -1174.5   2349.1     3145 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -11.5804   0.1324   0.2476   0.4225   2.6049 
## 
## Random effects:
##  Groups      Name                        Variance Std.Dev. Corr 
##  subjCode    (Intercept)                 0.02756  0.1660        
##              hfTrial:angleDiffFromMatchC 0.03395  0.1843   -0.14
##  targetLabel (Intercept)                 0.10878  0.3298        
## Number of obs: 3153, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  2.06008    0.11011  18.709  < 2e-16 ***
## hfTrial                      0.98023    0.14283   6.863 6.75e-12 ***
## angleDiffFromMatchC         -0.17556    0.01088 -16.131  < 2e-16 ***
## hfTrial:angleDiffFromMatchC  0.02497    0.03330   0.750    0.453    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.081              
## anglDffFrMC -0.428  0.204       
## hfTrl:nDFMC  0.084 -0.421 -0.120

Reaction Time Analysis

Descriptives

We investigated participants’ speed in responding on trials in which they chose the nearest word (thereby maximizing message alignment - analogous to RT on “correct” trials).

# splitting reaction time by word frequency on trials during the Treasure Hunt Phase
summarized_rt <- all_data %>%
  filter(version=="exp3") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency"))%>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt)
hfTrial N rt se lower_ci upper_ci
low-frequency 793 2573.057 43.09428 2488.464 2657.649
high-frequency 1794 2289.222 26.38723 2237.469 2340.975
summarized_rt_block <- all_data %>%
  filter(version=="exp3") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("block","hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency")) %>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt_block)
block hfTrial N rt se lower_ci upper_ci
ambig low-frequency 540 2602.433 40.06542 2523.729 2681.136
ambig high-frequency 622 2342.769 36.58428 2270.925 2414.613
clear low-frequency 73 2537.279 112.83457 2312.348 2762.211
clear high-frequency 392 2339.341 42.38928 2256.002 2422.681
clear2 low-frequency 180 2499.439 71.30080 2358.740 2640.137
clear2 high-frequency 780 2221.334 29.79703 2162.842 2279.826

Linear mixed-effects model

We fit a linear mixed-effect model predicting participants’ reaction times from Word Frequency (centered; High = -0.5 vs. Low = -0.5) and Distance from Nearest Principal Direction with the same random effects structure as above.

#RT effect on trials in which nearest word is chosen
#maximal model does not converge, so remove least important
m=lmer(rt~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## rt ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial + angleDiffFromMatchC |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 42024.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0537 -0.6855 -0.2333  0.4570  4.8537 
## 
## Random effects:
##  Groups      Name                Variance  Std.Dev. Corr       
##  subjCode    (Intercept)          93218.84 305.318             
##              hfTrial              46825.74 216.393  -0.08      
##              angleDiffFromMatchC     43.11   6.566  -0.07 -0.50
##  targetLabel (Intercept)          39541.65 198.851             
##  Residual                        624252.97 790.097             
## Number of obs: 2587, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)         2445.809     65.002   39.731  37.627  < 2e-16 ***
## hfTrial             -257.780     46.520   54.659  -5.541 8.89e-07 ***
## angleDiffFromMatchC    7.877      2.823   54.151   2.790  0.00725 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial     -0.119       
## anglDffFrMC -0.024  0.080
#Anova(m,type="III",test="F")
confint(m,method="Wald")
##                           2.5 %     97.5 %
## .sig01                       NA         NA
## .sig02                       NA         NA
## .sig03                       NA         NA
## .sig04                       NA         NA
## .sig05                       NA         NA
## .sig06                       NA         NA
## .sig07                       NA         NA
## .sigma                       NA         NA
## (Intercept)         2318.407202 2573.21135
## hfTrial             -348.956753 -166.60251
## angleDiffFromMatchC    2.344349   13.40975
#no interaction with block
#include highest order interaction terms as random slopes
m=lmer(rt~(hfTrial+angleDiffFromMatchC)*blockC+(1+hfTrial:blockC+angleDiffFromMatchC:blockC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" &matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ (hfTrial + angleDiffFromMatchC) * blockC + (1 + hfTrial:blockC +  
##     angleDiffFromMatchC:blockC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 42006.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.9036 -0.6989 -0.2239  0.4879  4.8386 
## 
## Random effects:
##  Groups      Name                       Variance  Std.Dev. Corr       
##  subjCode    (Intercept)                110439.57 332.324             
##              hfTrial:blockC               2268.67  47.631   1.00      
##              blockC:angleDiffFromMatchC     71.29   8.443  -1.00 -1.00
##  targetLabel (Intercept)                 36415.13 190.827             
##  Residual                               636182.35 797.610             
## Number of obs: 2587, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                            Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)                2478.781     71.104   55.898  34.861  < 2e-16 ***
## hfTrial                    -245.381     37.263 2528.945  -6.585 5.51e-11 ***
## angleDiffFromMatchC           2.658      4.989 2525.788   0.533    0.594    
## blockC                       74.617     63.637 2519.854   1.173    0.241    
## hfTrial:blockC                8.089     73.530 1473.217   0.110    0.912    
## angleDiffFromMatchC:blockC  -13.521     10.055 1113.355  -1.345    0.179    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC blockC hfTr:C
## hfTrial     -0.098                            
## anglDffFrMC -0.026 -0.033                     
## blockC       0.005  0.226 -0.817              
## hfTrl:blckC  0.154 -0.143 -0.021 -0.214       
## anglDfFMC:C -0.431 -0.026  0.039 -0.055 -0.043
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
#Anova(m,type="III",test="F")

Plot

Plot the effect of training frequency on word/ compass direction choice.

#refit model without centering angle for simpler plotting,simplified random effects structure due to non-convergence (coefficients roughly equivalent, slight differences on second decimal point)
m <- glmer(matchChoice~hfTrial+angleDiffFromMatch+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))

pX <- expand.grid(angleDiffFromMatch=seq(0,22.5,by=0.1),hfTrial=c(-0.5,0.5))

predictions <- predictSE(m,pX,re.form=NA, type="response")
pX$fit <- predictions$fit
pX$se.fit <- predictions$se.fit

p_freq3 <- plot_frequency_effect(
  experiment_data=filter(all_data,version=="exp3"),
  predicted_data=pX,
  plot_option="plot2",
  plot_path = here::here("plots","exp3_frequencyEffect.jpg")
  )
p_freq3

Experiment 4

Main Model

As in Experiments 1-3, we considered participants’ likelihood of choosing the word for the nearest compass direction, dependent on whether that compass direction was a high- or a low-frequency word, while controlling for the distance from the nearest learned compass direction. We focused specifically on low-frequency/high-frequency trials, in which a compass direction was tested in between a low-frequency and a high-frequency trained direction.

As a conservative test, we retained only trials in which participants chose one of the two principal direction words within 45° of the stimulus direction (93% of all low-frequency/high-frequency trials).

# full model yields a convergence warning ((degenerate Hessian) - 
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

#simplified model removing random slope for angleDiffFromMatchC yields consistent results (and no convergence warning)
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1794.8   1835.3   -890.4   1780.8     2411 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -6.1425  0.0918  0.2128  0.4097  1.9726 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev. Corr
##  subjCode    (Intercept) 0.08136  0.2852       
##              hfTrial     3.27343  1.8093   0.12
##  targetLabel (Intercept) 0.16378  0.4047       
## Number of obs: 2418, groups:  subjCode, 43; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.26443    0.14252  15.888   <2e-16 ***
## hfTrial              0.77240    0.30826   2.506   0.0122 *  
## angleDiffFromMatchC -0.20290    0.01269 -15.993   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial      0.051       
## anglDffFrMC -0.454  0.017
#confidence interval
confint(m,method="Wald")[5:7,]
##                          2.5 %     97.5 %
## (Intercept)          1.9850871  2.5437706
## hfTrial              0.1682141  1.3765806
## angleDiffFromMatchC -0.2277620 -0.1780325
#calculate shift in x-axis units (degrees of angle)
shift_x <- -summary(m)$coefficients[2,1]/summary(m)$coefficients[3,1]
#low 95% CI
shift_x_lower <- -confint(m,method="Wald")[5:7,][2,1]/summary(m)$coefficients[3,1]
#high 95% CI
shift_x_upper <- -confint(m,method="Wald")[5:7,][2,2]/summary(m)$coefficients[3,1]

This effect corresponded to an estimated 3.81° shift (95% CI = [0.83°, 6.78°]) in participants’ decision boundary for high-frequency words as compared to low-frequency words.

Robustness Checks

Controlling for final retention accuracy of labels on each trial

To ensure that the frequency effect is not an artifact of participants’ being slightly more likely to forget the low-frequency labels, we first re-fit the model while controlling for participants’ accuracy during the Untimed Retention Test for the two (nearby) compass directions involved in each trial.

#controlling for accuracy for nearby labels
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels+(1+hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## matchChoice ~ hfTrial + angleDiffFromMatchC + finalAccuracyNearbyLabels +  
##     (1 + hfTrial + angleDiffFromMatchC + finalAccuracyNearbyLabels |  
##         subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1801.7   1888.5   -885.8   1771.7     2403 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -7.1348  0.0957  0.2100  0.4058  2.0548 
## 
## Random effects:
##  Groups      Name                      Variance Std.Dev. Corr             
##  subjCode    (Intercept)               0.00000  0.00000                   
##              hfTrial                   3.30423  1.81775    NaN            
##              angleDiffFromMatchC       0.00174  0.04171    NaN  0.31      
##              finalAccuracyNearbyLabels 0.13984  0.37395    NaN  0.05 -0.52
##  targetLabel (Intercept)               0.13987  0.37400                   
## Number of obs: 2418, groups:  subjCode, 43; targetLabel, 18
## 
## Fixed effects:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                1.12025    0.42743   2.621  0.00877 ** 
## hfTrial                    0.77964    0.31095   2.507  0.01217 *  
## angleDiffFromMatchC       -0.20524    0.01512 -13.576  < 2e-16 ***
## finalAccuracyNearbyLabels  1.23331    0.44153   2.793  0.00522 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.020              
## anglDffFrMC -0.095  0.125       
## fnlAccrcyNL -0.941  0.036 -0.088
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
confint(m,method="Wald")[12:15,]
##                                2.5 %     97.5 %
## (Intercept)                0.2825023  1.9579906
## hfTrial                    0.1701761  1.3890973
## angleDiffFromMatchC       -0.2348646 -0.1756064
## finalAccuracyNearbyLabels  0.3679288  2.0986984
# full model yields a singular fit - simplified model removing random slopes for angleDiffFromMatchC and finalAccuracyNearbyLabels yields consistent results (and no singular fit warning)
# m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+finalAccuracyNearbyLabels + (1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)

Including only participants with perfect recall for all compass directions at the end of the experiment

We next re-fit the same model using a stricter inclusion criterion, including only participants who recalled all items correctly during the Untimed Retetion test. Here, unlike in the previous three experiments, we found that the effect of frequency did not hold after removing 10 participants who did not have perfect accuracy on the Untimed Retention test.

final_accuracy <- all_data %>%
  filter(version=="exp4") %>%
  filter(trialType=="finalName") %>%
  group_by(subjCode,trialType) %>%
  summarize(N=n(),accuracy=mean(isRight)) %>%
  ungroup()

#select only participants with perfect recall on the final test block
perfect_final_accuracy_subjects <- as.character(filter(final_accuracy,accuracy==1)$subjCode)

#Fit model
m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1&subjCode %in% perfect_final_accuracy_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & listChoice == 1 & subjCode %in%  
##     perfect_final_accuracy_subjects)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1370.8   1426.0   -675.4   1350.8     1839 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -7.8518  0.0964  0.2087  0.4125  1.8651 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.126882 0.35621             
##              hfTrial             2.413463 1.55353  -0.12      
##              angleDiffFromMatchC 0.001321 0.03635  -0.75 -0.01
##  targetLabel (Intercept)         0.034931 0.18690             
## Number of obs: 1849, groups:  subjCode, 33; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.40085    0.14550  16.500   <2e-16 ***
## hfTrial              0.42380    0.31291   1.354    0.176    
## angleDiffFromMatchC -0.22675    0.01765 -12.849   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial     -0.043       
## anglDffFrMC -0.721  0.008
confint(m,method="Wald")[8:10,]
##                          2.5 %     97.5 %
## (Intercept)          2.1156626  2.6860314
## hfTrial             -0.1894847  1.0370902
## angleDiffFromMatchC -0.2613393 -0.1921644

Selecting only participants with perfect recall on the final Word Learning block

Unlike Exps 1-3, participants in Exp 4 saw a fixed number of learning trials. Therefore, not all participants reached perfect accuracy by the end of the training phase. We therefore re-ran the main model including only participants with perfect recall on the final Word Learning block (i.e., participants who entered the test phase/ “Treasure Hunt” having scored perfectly on all compass directions).

subj_acc_name_block <- all_data %>%
  filter(version=="exp4") %>%
  filter(trialType=="name"&block=="init"&!(is.na(nameBlockNum))) %>%
  group_by(subjCode,nameBlockNum) %>%
  summarize(N=n(),accuracy=mean(isRight)) %>%
  ungroup()

#select only participants with perfect recall on the final Word Learning block
perfect_learning_subjects <- as.character(filter(subj_acc_name_block,nameBlockNum==5&accuracy==1)$subjCode)

m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1&subjCode %in% perfect_learning_subjects),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial +  
##     angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & listChoice == 1 & subjCode %in%  
##     perfect_learning_subjects)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1218.7   1272.6   -599.4   1198.7     1613 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -6.7350  0.0970  0.2075  0.4154  1.7457 
## 
## Random effects:
##  Groups      Name                Variance  Std.Dev. Corr       
##  subjCode    (Intercept)         0.1065159 0.3264              
##              hfTrial             3.0559436 1.7481   -0.04      
##              angleDiffFromMatchC 0.0009061 0.0301   -0.54  0.55
##  targetLabel (Intercept)         0.2031212 0.4507              
## Number of obs: 1623, groups:  subjCode, 29; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.28376    0.17533  13.025   <2e-16 ***
## hfTrial              0.73460    0.36701   2.002   0.0453 *  
## angleDiffFromMatchC -0.19956    0.01724 -11.574   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial      0.003       
## anglDffFrMC -0.530  0.174
confint(m,method="Wald")[8:10,]
##                           2.5 %     97.5 %
## (Intercept)          1.94011677  2.6274015
## hfTrial              0.01528571  1.4539201
## angleDiffFromMatchC -0.23335657 -0.1657692

Controlling for compass direction character length

The words given to each of the compass directions varied in character length (and therefore perhaps in how easy they are to produce/ type). Beyond randomly assigning compass directions and counterbalancing their roles across participants, we also fit all models with by-item random effects to ensure that the effect of frequency generalizes across items. In the following model, we also explicitly control for character length to ensure that the effects hold even after accounting for character length of the nearest/ target compass direction.

m <- glmer(matchChoice~hfTrial+angleDiffFromMatchC+nearestLabel_length+(1+hfTrial+angleDiffFromMatchC+nearestLabel_length|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial + angleDiffFromMatchC + nearestLabel_length +  
##     (1 + hfTrial + angleDiffFromMatchC + nearestLabel_length |  
##         subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1777.5   1864.3   -873.7   1747.5     2403 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -6.2867  0.0808  0.1917  0.3867  1.9896 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr             
##  subjCode    (Intercept)         9.275998 3.04565                   
##              hfTrial             4.279920 2.06880   0.24            
##              angleDiffFromMatchC 0.001115 0.03339   0.12  0.59      
##              nearestLabel_length 0.513307 0.71645  -0.99 -0.26 -0.20
##  targetLabel (Intercept)         0.211573 0.45997                   
## Number of obs: 2418, groups:  subjCode, 43; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          2.22324    0.79270   2.805  0.00504 ** 
## hfTrial              0.80548    0.35238   2.286  0.02227 *  
## angleDiffFromMatchC -0.21190    0.01528 -13.869  < 2e-16 ***
## nearestLabel_length  0.04229    0.18352   0.230  0.81775    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial      0.143              
## anglDffFrMC -0.080  0.180       
## nrstLbl_lng -0.978 -0.150 -0.031
confint(m,method="Wald")[12:15,]
##                          2.5 %     97.5 %
## (Intercept)          0.6695770  3.7769124
## hfTrial              0.1148197  1.4961369
## angleDiffFromMatchC -0.2418455 -0.1819543
## nearestLabel_length -0.3174086  0.4019904

Checking for an interaction with distance

We also investigated whether distance interacted with frequency condition in predicting lexical selection. We find no evidence of an interaction between frequency and distance.

#full interaction model
#does not converge (boundary fit)
# m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial*angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
# summary(m)
#simplified random effects structure preserving critical interaction random effect (qualitatively similar results to more complex models, though here some more non-converging complex models show a significant interaction w/ a similar effect magnitude)
m <- glmer(matchChoice~hfTrial*angleDiffFromMatchC+(1+hfTrial:angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## matchChoice ~ hfTrial * angleDiffFromMatchC + (1 + hfTrial:angleDiffFromMatchC |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1874.0   1920.3   -929.0   1858.0     2410 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -17.3981   0.1189   0.2530   0.4655   1.5535 
## 
## Random effects:
##  Groups      Name                        Variance Std.Dev. Corr 
##  subjCode    (Intercept)                 0.04325  0.2080        
##              hfTrial:angleDiffFromMatchC 0.02413  0.1553   -0.23
##  targetLabel (Intercept)                 0.08691  0.2948        
## Number of obs: 2418, groups:  subjCode, 43; targetLabel, 18
## 
## Fixed effects:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  2.04593    0.11436  17.891  < 2e-16 ***
## hfTrial                      0.92300    0.16220   5.691 1.27e-08 ***
## angleDiffFromMatchC         -0.18400    0.01206 -15.261  < 2e-16 ***
## hfTrial:angleDiffFromMatchC -0.04767    0.03389  -1.406     0.16    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC
## hfTrial     -0.022              
## anglDffFrMC -0.491  0.068       
## hfTrl:nDFMC  0.001 -0.476 -0.071

Reaction Time Analysis

Descriptives

We investigated participants’ speed in responding on trials in which they chose the nearest word (thereby maximizing message alignment - analogous to RT on “correct” trials).

# splitting reaction time by word frequency on trials during the Treasure Hunt Phase
summarized_rt <- all_data %>%
  filter(version=="exp4") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency"))%>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt)
hfTrial N rt se lower_ci upper_ci
low-frequency 620 2564.746 47.84946 2470.779 2658.713
high-frequency 1352 2261.943 28.85828 2205.331 2318.555
summarized_rt_block <- all_data %>%
  filter(version=="exp4") %>%
  filter(matchChoice==1) %>%
  summarySEwithin(measurevar="rt",withinvars=c("block","hfTrial"),idvar="subjCode") %>%
  mutate(lower_ci = rt - ci,
         upper_ci = rt + ci) %>%
  mutate(hfTrial=ifelse(hfTrial==-0.5,"low-frequency","high-frequency")) %>%
  select(-sd,-ci,-rt_norm)
kable(summarized_rt_block)
block hfTrial N rt se lower_ci upper_ci
ambig low-frequency 403 2598.801 47.14588 2506.117 2691.484
ambig high-frequency 464 2334.035 38.50208 2258.374 2409.695
clear low-frequency 70 2408.039 102.19852 2204.159 2611.920
clear high-frequency 321 2254.053 48.56140 2158.514 2349.593
clear2 low-frequency 147 2546.006 73.08794 2401.559 2690.453
clear2 high-frequency 567 2207.415 32.85566 2142.881 2271.948

Linear mixed-effects model

We fit a linear mixed-effect model predicting participants’ reaction times from Word Frequency (centered; High = -0.5 vs. Low = -0.5) and Distance from Nearest Principal Direction with the same random effects structure as above.

#RT effect on trials in which nearest word is chosen
#maximal model does not converge, so remove least important
m=lmer(rt~hfTrial+angleDiffFromMatchC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## rt ~ hfTrial + angleDiffFromMatchC + (1 + hfTrial + angleDiffFromMatchC |  
##     subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 31862.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2558 -0.6863 -0.2289  0.4805  3.8042 
## 
## Random effects:
##  Groups      Name                Variance  Std.Dev. Corr       
##  subjCode    (Intercept)          66297.71 257.483             
##              hfTrial              87150.92 295.213  -0.20      
##              angleDiffFromMatchC     91.33   9.556   0.11  0.19
##  targetLabel (Intercept)          31411.01 177.232             
##  Residual                        570807.10 755.518             
## Number of obs: 1972, groups:  subjCode, 43; targetLabel, 18
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)         2422.241     60.775   36.211  39.856  < 2e-16 ***
## hfTrial             -251.043     59.501   36.801  -4.219 0.000153 ***
## angleDiffFromMatchC   17.004      3.305   39.120   5.145 7.85e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril
## hfTrial     -0.179       
## anglDffFrMC  0.022  0.200
#Anova(m,type="III",test="F")
confint(m,method="Wald")
##                          2.5 %     97.5 %
## .sig01                      NA         NA
## .sig02                      NA         NA
## .sig03                      NA         NA
## .sig04                      NA         NA
## .sig05                      NA         NA
## .sig06                      NA         NA
## .sig07                      NA         NA
## .sigma                      NA         NA
## (Intercept)         2303.12474 2541.35701
## hfTrial             -367.66217 -134.42420
## angleDiffFromMatchC   10.52663   23.48047
#no interaction with block
#include highest order interaction terms as random slopes
m=lmer(rt~(hfTrial+angleDiffFromMatchC)*blockC+(1+hfTrial:blockC+angleDiffFromMatchC:blockC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" &matchChoice==1), control=lmerControl(optimizer="bobyqa"))
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: rt ~ (hfTrial + angleDiffFromMatchC) * blockC + (1 + hfTrial:blockC +  
##     angleDiffFromMatchC:blockC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & matchChoice == 1)
## Control: lmerControl(optimizer = "bobyqa")
## 
## REML criterion at convergence: 31840
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2920 -0.6981 -0.2110  0.5000  3.5913 
## 
## Random effects:
##  Groups      Name                       Variance Std.Dev. Corr       
##  subjCode    (Intercept)                 81565.1 285.60              
##              hfTrial:blockC              32407.8 180.02   -0.63      
##              blockC:angleDiffFromMatchC    228.5  15.11   -1.00  0.60
##  targetLabel (Intercept)                 29955.4 173.08              
##  Residual                               585226.1 765.00              
## Number of obs: 1972, groups:  subjCode, 43; targetLabel, 18
## 
## Fixed effects:
##                            Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)                2457.107     68.777   49.216  35.726  < 2e-16 ***
## hfTrial                    -269.471     39.695 1926.123  -6.789 1.50e-11 ***
## angleDiffFromMatchC          27.394      5.268 1905.584   5.200 2.21e-07 ***
## blockC                     -169.502     66.411 1915.660  -2.552   0.0108 *  
## hfTrial:blockC               21.769     83.620   47.711   0.260   0.7957    
## angleDiffFromMatchC:blockC  -14.592     10.804  361.932  -1.351   0.1777    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC blockC hfTr:C
## hfTrial     -0.095                            
## anglDffFrMC -0.055 -0.013                     
## blockC       0.046  0.189 -0.804              
## hfTrl:blckC -0.040 -0.087 -0.030 -0.179       
## anglDfFMC:C -0.519 -0.028  0.070 -0.106  0.022
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
#Anova(m,type="III",test="F")

Plot

Plot the effect of training frequency on word/ compass direction choice.

#refit model without centering angle for simpler plotting (coefficients roughly equivalent)
m <- glmer(matchChoice~hfTrial+angleDiffFromMatch+(1+hfTrial|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))

pX <- expand.grid(angleDiffFromMatch=seq(0,22.5,by=0.1),hfTrial=c(-0.5,0.5))

predictions <- predictSE(m,pX,re.form=NA, type="response")
pX$fit <- predictions$fit
pX$se.fit <- predictions$se.fit

p_freq4 <- plot_frequency_effect(
  experiment_data=filter(all_data, version=="exp4"),
  predicted_data=pX,
  plot_option="plot2",
  plot_path = here::here("plots","exp4_frequencyEffect.jpg")
  )
p_freq4

Interactions between Experiment

Exp 1 vs. Exp 2

We observed no interaction between experiment version (Experiment 1 vs Experiment 2) and the frequency effect.

all_data <- all_data %>% mutate(versionC=case_when(
  version=="exp1" ~-0.5,
  version == "exp2"~ 0.5,
  TRUE ~ NA_real_)) 
#logistic mixed-effects model (boundary fit, but does not appear to distort estimates - similar results with pruned random effects structure)
m <- glmer(matchChoice~(hfTrial+angleDiffFromMatchC)*versionC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, listChoice==1& version  %in% c("exp1","exp2")),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ (hfTrial + angleDiffFromMatchC) * versionC + (1 +  
##     hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, listChoice == 1 & version %in% c("exp1", "exp2"))
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   4414.9   4501.7  -2194.5   4388.9     5832 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.7143  0.0903  0.2099  0.4364  3.3303 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.223841 0.47312             
##              hfTrial             2.228161 1.49270  -0.03      
##              angleDiffFromMatchC 0.001501 0.03875  -0.99 -0.14
##  targetLabel (Intercept)         0.019496 0.13963             
## Number of obs: 5845, groups:  subjCode, 83; targetLabel, 18
## 
## Fixed effects:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                   2.158634   0.088161  24.485  < 2e-16 ***
## hfTrial                       1.016805   0.184927   5.498 3.83e-08 ***
## angleDiffFromMatchC          -0.207769   0.009683 -21.458  < 2e-16 ***
## versionC                     -0.436748   0.154029  -2.835  0.00458 ** 
## hfTrial:versionC              0.538850   0.367127   1.468  0.14217    
## angleDiffFromMatchC:versionC  0.044320   0.018222   2.432  0.01500 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC versnC hfTr:C
## hfTrial      0.014                            
## anglDffFrMC -0.724 -0.054                     
## versionC    -0.022  0.022  0.049              
## hfTrl:vrsnC  0.028 -0.022 -0.007 -0.004       
## anglDfFMC:C  0.046 -0.001 -0.002 -0.759 -0.041
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Exp 1 vs. Exp 4

We observed no interaction of the frequency effect with experiment version (Experiment 1 vs. Experiment 4).

all_data <- all_data %>% mutate(versionC=case_when(
  version=="exp1" ~-0.5,
  version == "exp4"~ 0.5,
  TRUE ~ NA_real_)) 
#logistic mixed-effects model (boundary fit, but does not appear to distort estimates - similar results with pruned random effects structure)
m <- glmer(matchChoice~(hfTrial+angleDiffFromMatchC)*versionC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, listChoice==1& version  %in% c("exp1","exp4")),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ (hfTrial + angleDiffFromMatchC) * versionC + (1 +  
##     hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, listChoice == 1 & version %in% c("exp1", "exp4"))
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   4252.9   4339.5  -2113.4   4226.9     5763 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.8067  0.0992  0.2107  0.4219  2.2724 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.18881  0.43452             
##              hfTrial             2.01566  1.41974  -0.21      
##              angleDiffFromMatchC 0.00106  0.03256  -1.00  0.25
##  targetLabel (Intercept)         0.03343  0.18285             
## Number of obs: 5776, groups:  subjCode, 82; targetLabel, 18
## 
## Fixed effects:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                   2.297573   0.091972  24.981  < 2e-16 ***
## hfTrial                       0.705892   0.179485   3.933 8.39e-05 ***
## angleDiffFromMatchC          -0.215209   0.009685 -22.222  < 2e-16 ***
## versionC                     -0.119016   0.152834  -0.779    0.436    
## hfTrial:versionC             -0.048012   0.355960  -0.135    0.893    
## angleDiffFromMatchC:versionC  0.023492   0.018169   1.293    0.196    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC versnC hfTr:C
## hfTrial     -0.090                            
## anglDffFrMC -0.687  0.095                     
## versionC     0.031  0.010 -0.007              
## hfTrl:vrsnC  0.003 -0.003 -0.001 -0.134       
## anglDfFMC:C -0.008 -0.004  0.058 -0.754  0.113
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Exp 2 vs. Exp 4

We observed no interaction of the frequency effect with experiment version (Experiment 2 vs. Experiment 4).

all_data <- all_data %>% mutate(versionC=case_when(
  version=="exp2" ~-0.5,
  version == "exp4"~ 0.5,
  TRUE ~ NA_real_)) 
#logistic mixed-effects model (boundary fit, but does not appear to distort estimates - similar results with pruned random effects structure)
m <- glmer(matchChoice~(hfTrial+angleDiffFromMatchC)*versionC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, listChoice==1& version  %in% c("exp2","exp4")),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ (hfTrial + angleDiffFromMatchC) * versionC + (1 +  
##     hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, listChoice == 1 & version %in% c("exp2", "exp4"))
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   3762.8   3847.2  -1868.4   3736.8     4892 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -7.6520  0.0884  0.2145  0.4297  2.9232 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.161651 0.40206             
##              hfTrial             3.161922 1.77818   0.03      
##              angleDiffFromMatchC 0.001308 0.03616  -0.99  0.10
##  targetLabel (Intercept)         0.042618 0.20644             
## Number of obs: 4905, groups:  subjCode, 87; targetLabel, 18
## 
## Fixed effects:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                   2.111122   0.093164  22.660  < 2e-16 ***
## hfTrial                       1.028906   0.212962   4.831 1.36e-06 ***
## angleDiffFromMatchC          -0.195475   0.009935 -19.675  < 2e-16 ***
## versionC                      0.357056   0.147235   2.425   0.0153 *  
## hfTrial:versionC             -0.590575   0.420220  -1.405   0.1599    
## angleDiffFromMatchC:versionC -0.022598   0.018594  -1.215   0.2242    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC versnC hfTr:C
## hfTrial      0.049                            
## anglDffFrMC -0.636  0.038                     
## versionC     0.058 -0.018 -0.064              
## hfTrl:vrsnC -0.018  0.015  0.011  0.023       
## anglDfFMC:C -0.051  0.003  0.060 -0.724  0.061
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Exp 3 vs. Exp 4

We observed no interaction of the frequency effect with experiment version (Experiment 3 vs. Experiment 4) (i.e., controlling for amount of visual experience did not significantly reduce the magnitude of the effect relative to Experiment 3, which was identical to Experiment 4 except for the initial training with the visual stimuli).

all_data <- all_data %>% mutate(versionC=case_when(
  version=="exp3" ~-0.5,
  version == "exp4"~ 0.5,
  TRUE ~ NA_real_)) 
#logistic mixed-effects model (boundary fit, but does not appear to distort estimates - similar results with pruned random effects structure)
m <- glmer(matchChoice~(hfTrial+angleDiffFromMatchC)*versionC+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, listChoice==1& version  %in% c("exp3","exp4")),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ (hfTrial + angleDiffFromMatchC) * versionC + (1 +  
##     hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, listChoice == 1 & version %in% c("exp3", "exp4"))
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   4033.3   4119.4  -2003.7   4007.3     5558 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -9.8849  0.0893  0.2042  0.4043  3.0938 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.184092 0.42906             
##              hfTrial             3.606443 1.89906  -0.04      
##              angleDiffFromMatchC 0.001339 0.03659  -0.98  0.23
##  targetLabel (Intercept)         0.106721 0.32668             
## Number of obs: 5571, groups:  subjCode, 98; targetLabel, 18
## 
## Fixed effects:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                   2.285863   0.111451  20.510  < 2e-16 ***
## hfTrial                       0.949328   0.215146   4.412 1.02e-05 ***
## angleDiffFromMatchC          -0.201153   0.009851 -20.420  < 2e-16 ***
## versionC                      0.055537   0.147473   0.377    0.706    
## hfTrial:versionC             -0.408433   0.423410  -0.965    0.335    
## angleDiffFromMatchC:versionC -0.014173   0.018279  -0.775    0.438    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC versnC hfTr:C
## hfTrial      0.017                            
## anglDffFrMC -0.544  0.083                     
## versionC     0.081 -0.017 -0.084              
## hfTrl:vrsnC -0.013  0.112  0.013 -0.013       
## anglDfFMC:C -0.060  0.011  0.099 -0.726  0.112
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

All Exps

To check for any overall differences across experiment version, we also tested for an interaction with experiment across the entire dataset (Exps 1-4). There was no significant difference in the magnitude of the frequency effect across experiments.

m <- glmer(matchChoice~(hfTrial+angleDiffFromMatchC)*version+(1+hfTrial+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ (hfTrial + angleDiffFromMatchC) * version + (1 +  
##     hfTrial + angleDiffFromMatchC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   8463.0   8602.5  -4212.5   8425.0    11397 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.7353  0.0929  0.2093  0.4221  3.2215 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr       
##  subjCode    (Intercept)         0.189371 0.43517             
##              hfTrial             2.860519 1.69131  -0.08      
##              angleDiffFromMatchC 0.001372 0.03704  -1.00  0.08
##  targetLabel (Intercept)         0.014823 0.12175             
## Number of obs: 11416, groups:  subjCode, 181; targetLabel, 18
## 
## Fixed effects:
##                                 Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                      2.37105    0.11175  21.217  < 2e-16 ***
## hfTrial                          0.77006    0.29181   2.639  0.00832 ** 
## angleDiffFromMatchC             -0.22845    0.01298 -17.598  < 2e-16 ***
## versionexp2                     -0.43949    0.14817  -2.966  0.00302 ** 
## versionexp3                     -0.12312    0.14412  -0.854  0.39297    
## versionexp4                     -0.09004    0.15337  -0.587  0.55717    
## hfTrial:versionexp2              0.52260    0.40615   1.287  0.19819    
## hfTrial:versionexp3              0.33414    0.38780   0.862  0.38889    
## hfTrial:versionexp4             -0.06336    0.40941  -0.155  0.87701    
## angleDiffFromMatchC:versionexp2  0.04369    0.01805   2.420  0.01552 *  
## angleDiffFromMatchC:versionexp3  0.03666    0.01755   2.089  0.03671 *  
## angleDiffFromMatchC:versionexp4  0.02153    0.01866   1.154  0.24842    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril anDFMC vrsnx2 vrsnx3 vrsnx4 hfTr:2 hfTr:3 hfTr:4
## hfTrial     -0.047                                                        
## anglDffFrMC -0.779  0.047                                                 
## versionexp2 -0.683  0.038  0.566                                          
## versionexp3 -0.700  0.040  0.579  0.536                                   
## versionexp4 -0.659  0.039  0.546  0.501  0.516                            
## hfTrl:vrsn2  0.039 -0.716 -0.038 -0.036 -0.026 -0.026                     
## hfTrl:vrsn3  0.039 -0.749 -0.038 -0.026 -0.037 -0.027  0.541              
## hfTrl:vrsn4  0.036 -0.711 -0.035 -0.025 -0.026 -0.052  0.512  0.537       
## anglDfFMC:2  0.539 -0.036 -0.696 -0.759 -0.420 -0.394  0.050  0.025  0.025
## anglDfFMC:3  0.552 -0.036 -0.713 -0.420 -0.766 -0.405  0.025  0.053  0.025
## anglDfFMC:4  0.522 -0.035 -0.673 -0.395 -0.406 -0.772  0.024  0.025  0.050
##             aDFMC:2 aDFMC:3
## hfTrial                    
## anglDffFrMC                
## versionexp2                
## versionexp3                
## versionexp4                
## hfTrl:vrsn2                
## hfTrl:vrsn3                
## hfTrl:vrsn4                
## anglDfFMC:2                
## anglDfFMC:3  0.516         
## anglDfFMC:4  0.485   0.498 
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular
Anova(m, type="III")
## Analysis of Deviance Table (Type III Wald chisquare tests)
## 
## Response: matchChoice
##                                Chisq Df Pr(>Chisq)    
## (Intercept)                 450.1597  1  < 2.2e-16 ***
## hfTrial                       6.9637  1   0.008318 ** 
## angleDiffFromMatchC         309.6784  1  < 2.2e-16 ***
## version                      10.1840  3   0.017065 *  
## hfTrial:version               2.8851  3   0.409685    
## angleDiffFromMatchC:version   6.9544  3   0.073365 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Interactions between Trial Number and Frequency

To investigate the degree to which participants’ responses changed over the course of the experiment, we conducted an exploratory analysis testing the interaction between frequency (centered) and trial number (centered) in the same modeling framework as the main model reported in the manuscript, including an additional by-subject random slope for trial number (see tabs below for model result for each experiment/ collapsing across experiments). In general, there was some evidence that participants became somewhat less likely to choose the word for the nearest trained compass direction over the course of the Test Phase of the experiment (i.e., the “Treasure Hunt”), as indicated by the simple effect of trial number in the models. However, this general decrease in choosing the nearest compass direction did not differ between frequency conditions, i.e. there was no evidence for a change in the frequency effect across the Test Phase.

#create centered trial number (centered within Test Phase; also create a scaled trial number)
all_data <- all_data %>%
  group_by(version,subjCode,trialType) %>%
  mutate(trialNumberC=trialNumber-mean(trialNumber),
         #scale centered trial number ([-0.5,0.5]) to make model estimation easier/ support model convergence
         trialNumberSC=(trialNumber-mean(trialNumber))/max(trialNumber) 
         )

Exp 1

## Exp 1
m <- glmer(matchChoice~hfTrial*trialNumberSC+angleDiffFromMatchC+(1+hfTrial+trialNumberSC+angleDiffFromMatchC|subjCode)+(1|targetLabel),
           data=subset(all_data, version=="exp1" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial * trialNumberSC + angleDiffFromMatchC +  
##     (1 + hfTrial + trialNumberSC + angleDiffFromMatchC | subjCode) +  
##     (1 | targetLabel)
##    Data: subset(all_data, version == "exp1" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2444.1   2542.0  -1206.1   2412.1     3342 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -9.3286  0.0878  0.1814  0.4431  2.0033 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr             
##  subjCode    (Intercept)         0.273560 0.52303                   
##              hfTrial             1.191640 1.09162  -0.32            
##              trialNumberSC       2.012765 1.41872  -0.38 -0.31      
##              angleDiffFromMatchC 0.001496 0.03868  -0.73  0.47 -0.35
##  targetLabel (Intercept)         0.021506 0.14665                   
## Number of obs: 3358, groups:  subjCode, 39; targetLabel, 18
## 
## Fixed effects:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             2.4091     0.1321  18.234  < 2e-16 ***
## hfTrial                 0.6079     0.2239   2.715  0.00662 ** 
## trialNumberSC          -1.1699     0.3838  -3.048  0.00230 ** 
## angleDiffFromMatchC    -0.2060     0.0158 -13.041  < 2e-16 ***
## hfTrial:trialNumberSC   0.4279     0.5349   0.800  0.42367    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril trlNSC anDFMC
## hfTrial     -0.223                     
## trialNmbrSC -0.215 -0.085              
## anglDffFrMC -0.629  0.189 -0.406       
## hfTrl:trNSC  0.157 -0.362 -0.069 -0.128
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Exp 2

## Exp 2
m <- glmer(matchChoice~hfTrial*trialNumberSC+angleDiffFromMatchC+(1+hfTrial+trialNumberSC+angleDiffFromMatchC|subjCode)+(1|targetLabel),
           data=subset(all_data, version=="exp2" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial * trialNumberSC + angleDiffFromMatchC +  
##     (1 + hfTrial + trialNumberSC + angleDiffFromMatchC | subjCode) +  
##     (1 | targetLabel)
##    Data: subset(all_data, version == "exp2" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1967.8   2060.9   -967.9   1935.8     2471 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.7240  0.0701  0.2165  0.4318  3.4157 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr             
##  subjCode    (Intercept)         0.204874 0.45263                   
##              hfTrial             3.399915 1.84389   0.17            
##              trialNumberSC       0.252068 0.50206   0.65 -0.63      
##              angleDiffFromMatchC 0.001821 0.04267  -1.00 -0.14 -0.68
##  targetLabel (Intercept)         0.082728 0.28762                   
## Number of obs: 2487, groups:  subjCode, 44; targetLabel, 18
## 
## Fixed effects:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            1.98234    0.13354  14.844  < 2e-16 ***
## hfTrial                1.34715    0.30888   4.361 1.29e-05 ***
## trialNumberSC         -0.40607    0.25929  -1.566    0.117    
## angleDiffFromMatchC   -0.18488    0.01440 -12.842  < 2e-16 ***
## hfTrial:trialNumberSC  0.00101    0.49529   0.002    0.998    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril trlNSC anDFMC
## hfTrial      0.137                     
## trialNmbrSC  0.137 -0.156              
## anglDffFrMC -0.640 -0.069 -0.262       
## hfTrl:trNSC  0.019 -0.051  0.058 -0.008
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Exp 3

## Exp 3
#m <- glmer(matchChoice~hfTrial*trialNumberSC+angleDiffFromMatchC+(1+hfTrial+trialNumberSC+angleDiffFromMatchC|subjCode)+(1|targetLabel),data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
#remove less theoretically interesting random slope (angle distance from nearest compass direction) to allow model to converge
m <- glmer(matchChoice~hfTrial*trialNumberSC+angleDiffFromMatchC+(1+hfTrial+trialNumberSC|subjCode)+(1|targetLabel),
           data=subset(all_data, version=="exp3" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial * trialNumberSC + angleDiffFromMatchC +  
##     (1 + hfTrial + trialNumberSC | subjCode) + (1 | targetLabel)
##    Data: subset(all_data, version == "exp3" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   2247.1   2319.8  -1111.6   2223.1     3141 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -12.5213   0.0906   0.2037   0.3974   3.0218 
## 
## Random effects:
##  Groups      Name          Variance Std.Dev. Corr     
##  subjCode    (Intercept)   0.0000   0.0000            
##              hfTrial       3.8812   1.9701    NaN     
##              trialNumberSC 0.6967   0.8347    NaN 0.28
##  targetLabel (Intercept)   0.1180   0.3435            
## Number of obs: 3153, groups:  subjCode, 55; targetLabel, 18
## 
## Fixed effects:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            2.22459    0.11639  19.114  < 2e-16 ***
## hfTrial                1.12975    0.28979   3.899 9.68e-05 ***
## trialNumberSC         -0.55706    0.25972  -2.145    0.032 *  
## angleDiffFromMatchC   -0.18216    0.01153 -15.797  < 2e-16 ***
## hfTrial:trialNumberSC  0.44393    0.48838   0.909    0.363    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril trlNSC anDFMC
## hfTrial      0.018                     
## trialNmbrSC  0.010  0.126              
## anglDffFrMC -0.468  0.023 -0.158       
## hfTrl:trNSC  0.102 -0.049  0.078 -0.070
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Exp 4

## Exp 4
m <- glmer(matchChoice~hfTrial*trialNumberSC+angleDiffFromMatchC+(1+hfTrial+trialNumberSC+angleDiffFromMatchC|subjCode)+(1|targetLabel),
           data=subset(all_data, version=="exp4" & listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial * trialNumberSC + angleDiffFromMatchC +  
##     (1 + hfTrial + trialNumberSC + angleDiffFromMatchC | subjCode) +  
##     (1 | targetLabel)
##    Data: subset(all_data, version == "exp4" & listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1796.2   1888.9   -882.1   1764.2     2402 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -7.4931  0.0922  0.2062  0.4042  1.9618 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr             
##  subjCode    (Intercept)         0.149277 0.38636                   
##              hfTrial             3.320222 1.82215  -0.09            
##              trialNumberSC       0.620491 0.78771   0.99  0.06      
##              angleDiffFromMatchC 0.001805 0.04249  -0.79  0.33 -0.78
##  targetLabel (Intercept)         0.149869 0.38713                   
## Number of obs: 2418, groups:  subjCode, 43; targetLabel, 18
## 
## Fixed effects:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            2.29356    0.14893  15.400   <2e-16 ***
## hfTrial                0.74051    0.31159   2.377   0.0175 *  
## trialNumberSC         -0.68631    0.28899  -2.375   0.0176 *  
## angleDiffFromMatchC   -0.20122    0.01512 -13.311   <2e-16 ***
## hfTrial:trialNumberSC  0.39403    0.55752   0.707   0.4797    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril trlNSC anDFMC
## hfTrial     -0.018                     
## trialNmbrSC  0.186  0.036              
## anglDffFrMC -0.566  0.139 -0.249       
## hfTrl:trNSC  0.079 -0.060  0.038 -0.092
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

All Exps

## all exps
m <- glmer(matchChoice~hfTrial*trialNumberSC+angleDiffFromMatchC+(1+hfTrial+trialNumberSC+angleDiffFromMatchC|subjCode)+(1|targetLabel),
           data=subset(all_data, listChoice==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: matchChoice ~ hfTrial * trialNumberSC + angleDiffFromMatchC +  
##     (1 + hfTrial + trialNumberSC + angleDiffFromMatchC | subjCode) +  
##     (1 | targetLabel)
##    Data: subset(all_data, listChoice == 1)
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   8438.9   8556.4  -4203.4   8406.9    11400 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -9.5504  0.0917  0.2052  0.4222  3.1106 
## 
## Random effects:
##  Groups      Name                Variance Std.Dev. Corr             
##  subjCode    (Intercept)         0.222082 0.47126                   
##              hfTrial             2.984405 1.72754  -0.10            
##              trialNumberSC       0.389292 0.62393   0.50 -0.17      
##              angleDiffFromMatchC 0.001904 0.04364  -1.00  0.13 -0.58
##  targetLabel (Intercept)         0.014107 0.11877                   
## Number of obs: 11416, groups:  subjCode, 181; targetLabel, 18
## 
## Fixed effects:
##                        Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            2.217700   0.064670  34.292  < 2e-16 ***
## hfTrial                0.956478   0.144293   6.629 3.39e-11 ***
## trialNumberSC         -0.628628   0.134513  -4.673 2.96e-06 ***
## angleDiffFromMatchC   -0.195918   0.007308 -26.809  < 2e-16 ***
## hfTrial:trialNumberSC  0.219027   0.255276   0.858    0.391    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) hfTril trlNSC anDFMC
## hfTrial     -0.026                     
## trialNmbrSC  0.095 -0.040              
## anglDffFrMC -0.693  0.057 -0.303       
## hfTrl:trNSC  0.076 -0.113  0.030 -0.074
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see ?isSingular

Session Info

sessionInfo()
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Catalina 10.15.7
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] lmerTest_3.1-3   AICcmodavg_2.3-1 knitr_1.34       car_3.0-11      
##  [5] carData_3.0-4    ggstance_0.3.5   cowplot_1.1.1    sciplot_1.2-0   
##  [9] psych_2.1.9      lme4_1.1-27.1    Matrix_1.3-4     forcats_0.5.1   
## [13] stringr_1.4.0    dplyr_1.0.7      purrr_0.3.4      readr_2.0.1     
## [17] tidyr_1.1.3      tibble_3.1.4     ggplot2_3.3.5    tidyverse_1.3.1 
## [21] plyr_1.8.6       here_1.0.1      
## 
## loaded via a namespace (and not attached):
##  [1] nlme_3.1-152        fs_1.5.0            lubridate_1.7.10   
##  [4] httr_1.4.2          rprojroot_2.0.2     numDeriv_2016.8-1.1
##  [7] tools_4.1.1         backports_1.2.1     bslib_0.3.0        
## [10] utf8_1.2.2          R6_2.5.1            DBI_1.1.1          
## [13] colorspace_2.0-2    raster_3.4-13       sp_1.4-5           
## [16] withr_2.4.2         tidyselect_1.1.1    mnormt_2.0.2       
## [19] curl_4.3.2          compiler_4.1.1      cli_3.0.1          
## [22] rvest_1.0.1         xml2_1.3.2          labeling_0.4.2     
## [25] unmarked_1.1.1      sass_0.4.0          scales_1.1.1       
## [28] digest_0.6.28       foreign_0.8-81      minqa_1.2.4        
## [31] rmarkdown_2.11      rio_0.5.27          pkgconfig_2.0.3    
## [34] htmltools_0.5.2     highr_0.9           dbplyr_2.1.1       
## [37] fastmap_1.1.0       rlang_0.4.11        readxl_1.3.1       
## [40] VGAM_1.1-5          rstudioapi_0.13     farver_2.1.0       
## [43] jquerylib_0.1.4     generics_0.1.0      jsonlite_1.7.2     
## [46] zip_2.2.0           magrittr_2.0.1      Rcpp_1.0.7         
## [49] munsell_0.5.0       fansi_0.5.0         abind_1.4-5        
## [52] lifecycle_1.0.0     stringi_1.7.4       yaml_2.2.1         
## [55] MASS_7.3-54         grid_4.1.1          parallel_4.1.1     
## [58] crayon_1.4.1        lattice_0.20-44     haven_2.4.3        
## [61] splines_4.1.1       hms_1.1.0           tmvnsim_1.0-2      
## [64] pillar_1.6.2        boot_1.3-28         codetools_0.2-18   
## [67] stats4_4.1.1        reprex_2.0.1        glue_1.4.2         
## [70] evaluate_0.14       data.table_1.14.0   modelr_0.1.8       
## [73] vctrs_0.3.8         nloptr_1.2.2.2      tzdb_0.1.2         
## [76] cellranger_1.1.0    gtable_0.3.0        assertthat_0.2.1   
## [79] xfun_0.26           openxlsx_4.2.4      xtable_1.8-4       
## [82] broom_0.7.9         survival_3.2-11     ellipsis_0.3.2