Participants’ frequency of experience during the Exposure and
Sampling Phases predicted test accuracy.
Overall Frequency and its Relationship to Test
First, we asked whether the combined frequency of children’s exposure
to each object-label association during the Exposure Phase and the
Sampling Phase would predict their later test accuracy. We fit a
logistic mixed-effects model predicting children’s trial-by-trial
accuracy on a given item from the total frequency with which they
experienced that item during the Exposure Phase and the Sampling Phase
combined (total frequency), experiment block, and their interaction. We
included random intercepts for participants, items, and yoked pairings.
Overall, children were more accurate on items they experienced more
frequently during training.
## total frequency
#significant interaction with block
m <- glmer(is_right ~total_frequency*stim_set_c+(1|subject)+(1|target_image)+(1|yoked_id),data=exp2_test_d_choice_type,family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ total_frequency * stim_set_c + (1 | subject) + (1 |
## target_image) + (1 | yoked_id)
## Data: exp2_test_d_choice_type
##
## AIC BIC logLik -2*log(L) df.resid
## 3559.4 3602.9 -1772.7 3545.4 3689
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6502 0.2689 0.3712 0.5124 1.3356
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 0.801563 0.89530
## yoked_id (Intercept) 0.014315 0.11965
## target_image (Intercept) 0.003251 0.05702
## Number of obs: 3696, groups: subject, 231; yoked_id, 77; target_image, 8
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.30959 0.11358 11.530 < 2e-16 ***
## total_frequency 0.08315 0.02401 3.464 0.000533 ***
## stim_set_c 0.02907 0.18234 0.159 0.873339
## total_frequency:stim_set_c -0.09092 0.04797 -1.895 0.058072 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) ttl_fr stm_s_
## totl_frqncy -0.699
## stim_set_c -0.046 0.070
## ttl_frqn:__ 0.052 -0.106 -0.881
confint(m, method="Wald")
## 2.5 % 97.5 %
## .sig01 NA NA
## .sig02 NA NA
## .sig03 NA NA
## (Intercept) 1.0869725 1.532217173
## total_frequency 0.0360982 0.130201904
## stim_set_c -0.3283046 0.386440097
## total_frequency:stim_set_c -0.1849467 0.003109393
model_estimates_total_frequency_exp2_or <- m %>%
tidy(effects="fixed",exponentiate=TRUE, conf.int=TRUE)
model_estimates_total_frequency_exp2_or
## # A tibble: 4 × 8
## effect term estimate std.error statistic p.value conf.low conf.high
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 fixed (Intercept) 3.70 0.421 11.5 9.35e-31 2.97 4.63
## 2 fixed total_frequen… 1.09 0.0261 3.46 5.33e- 4 1.04 1.14
## 3 fixed stim_set_c 1.03 0.188 0.159 8.73e- 1 0.720 1.47
## 4 fixed total_frequen… 0.913 0.0438 -1.90 5.81e- 2 0.831 1.00
Below is a quick plot visualizing this effect.
#item-level
# total frequency
ggplot(exp2_test_d_choice_type,aes(total_frequency,is_right,color=condition))+
geom_beeswarm(aes(group=total_frequency), cex=0.02,alpha=0.5)+
geom_smooth(method="lm")+
scale_y_continuous(breaks=c(0,0.2,0.4,0.6,0.8,1), limits=c(-0.1,1.1))+
facet_wrap(~stim_set)

There was a marginal interaction between total frequency and
experiment block, driven by the fact that the total frequency effect was
robust in Block 1 but not in Block 2.
Block 1
Results for the logistic mixed-effects model, recentered on Block 1
to estimate the Block 1 total frequency effect.
#Block 1
m <- glmer(is_right ~total_frequency*stim_set1+(1|subject)+(1|target_image)+(1|yoked_id),data=exp2_test_d_choice_type,family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ total_frequency * stim_set1 + (1 | subject) + (1 |
## target_image) + (1 | yoked_id)
## Data: exp2_test_d_choice_type
##
## AIC BIC logLik -2*log(L) df.resid
## 3559.4 3602.9 -1772.7 3545.4 3689
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6502 0.2689 0.3712 0.5124 1.3356
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 0.801571 0.89530
## yoked_id (Intercept) 0.014313 0.11964
## target_image (Intercept) 0.003251 0.05702
## Number of obs: 3696, groups: subject, 231; yoked_id, 77; target_image, 8
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.29505 0.14887 8.699 < 2e-16 ***
## total_frequency 0.12861 0.03568 3.604 0.000313 ***
## stim_set1 0.02908 0.18234 0.159 0.873291
## total_frequency:stim_set1 -0.09092 0.04797 -1.895 0.058066 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) ttl_fr stm_s1
## totl_frqncy -0.777
## stim_set1 -0.647 0.640
## ttl_frqn:_1 0.580 -0.743 -0.881
confint(m, method="Wald")
## 2.5 % 97.5 %
## .sig01 NA NA
## .sig02 NA NA
## .sig03 NA NA
## (Intercept) 1.00326917 1.586835795
## total_frequency 0.05867038 0.198551493
## stim_set1 -0.32829389 0.386451647
## total_frequency:stim_set1 -0.18494924 0.003106915
model_estimates_total_frequency_block1_exp2_or <- m %>%
tidy(effects="fixed",exponentiate=TRUE, conf.int=TRUE)
model_estimates_total_frequency_block1_exp2_or
## # A tibble: 4 × 8
## effect term estimate std.error statistic p.value conf.low conf.high
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 fixed (Intercept) 3.65 0.544 8.70 3.34e-18 2.73 4.89
## 2 fixed total_frequen… 1.14 0.0406 3.60 3.13e- 4 1.06 1.22
## 3 fixed stim_set1 1.03 0.188 0.159 8.73e- 1 0.720 1.47
## 4 fixed total_frequen… 0.913 0.0438 -1.90 5.81e- 2 0.831 1.00
Block 2
Results for the logistic mixed-effects model, recentered on Block 2
to estimate the Block 2 total frequency effect.
#Block 2
m <- glmer(is_right ~total_frequency*stim_set2+(1|subject)+(1|target_image)+(1|yoked_id),data=exp2_test_d_choice_type,family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ total_frequency * stim_set2 + (1 | subject) + (1 |
## target_image) + (1 | yoked_id)
## Data: exp2_test_d_choice_type
##
## AIC BIC logLik -2*log(L) df.resid
## 3559.4 3602.9 -1772.7 3545.4 3689
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6502 0.2689 0.3712 0.5124 1.3356
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 0.801576 0.89531
## yoked_id (Intercept) 0.014309 0.11962
## target_image (Intercept) 0.003251 0.05702
## Number of obs: 3696, groups: subject, 231; yoked_id, 77; target_image, 8
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.32413 0.14235 9.302 <2e-16 ***
## total_frequency 0.03769 0.03209 1.174 0.2402
## stim_set2 0.02908 0.18234 0.159 0.8733
## total_frequency:stim_set2 -0.09092 0.04797 -1.895 0.0581 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) ttl_fr stm_s2
## totl_frqncy -0.774
## stim_set2 0.604 -0.606
## ttl_frqn:_2 -0.523 0.668 -0.881
confint(m, method="Wald")
## 2.5 % 97.5 %
## .sig01 NA NA
## .sig02 NA NA
## .sig03 NA NA
## (Intercept) 1.04512905 1.603137922
## total_frequency -0.02521255 0.100593596
## stim_set2 -0.32829382 0.386458311
## total_frequency:stim_set2 -0.18494902 0.003108606
model_estimates_total_frequency_block2_exp2_or <- m %>%
tidy(effects="fixed",exponentiate=TRUE, conf.int=TRUE)
model_estimates_total_frequency_block2_exp2_or
## # A tibble: 4 × 8
## effect term estimate std.error statistic p.value conf.low conf.high
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 fixed (Intercept) 3.76 0.535 9.30 1.38e-20 2.84 4.97
## 2 fixed total_frequen… 1.04 0.0333 1.17 2.40e- 1 0.975 1.11
## 3 fixed stim_set2 1.03 0.188 0.159 8.73e- 1 0.720 1.47
## 4 fixed total_frequen… 0.913 0.0438 -1.90 5.81e- 2 0.831 1.00
Exposure and Sampling Frequency and its Relationship to Test
Next, we aimed to tease apart the specific effect of frequency within
the Exposure Phase and frequency within the Sampling Phase on test
accuracy. We fit a logistic mixed-effects model predicting
trial-by-trial test accuracy from the interaction between Exposure Phase
frequency and experiment block (centered), and the interaction between
Sampling Phase frequency and experiment block, as well as all
lower-order effects. We included random intercepts for participants,
items, and yoked pairings. Both exposure frequency and sampling
frequency predicted accuracy at test while controlling for each
other.
#exposure frequency and choices
#check interaction with block
m <- glmer(is_right ~(exposure_frequency+choice_num)*stim_set_c+(1|subject)+(1|target_image)+(1|yoked_id),data=exp2_test_d_choice_type,family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ (exposure_frequency + choice_num) * stim_set_c + (1 |
## subject) + (1 | target_image) + (1 | yoked_id)
## Data: exp2_test_d_choice_type
## Control: glmerControl(optimizer = "bobyqa")
##
## AIC BIC logLik -2*log(L) df.resid
## 3562.9 3618.8 -1772.4 3544.9 3687
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.5864 0.2673 0.3703 0.5122 1.3669
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 0.802214 0.89566
## yoked_id (Intercept) 0.014546 0.12061
## target_image (Intercept) 0.003859 0.06212
## Number of obs: 3696, groups: subject, 231; yoked_id, 77; target_image, 8
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.25947 0.13280 9.484 < 2e-16 ***
## exposure_frequency 0.07985 0.02439 3.274 0.00106 **
## choice_num 0.12132 0.05752 2.109 0.03493 *
## stim_set_c 0.02812 0.22888 0.123 0.90222
## exposure_frequency:stim_set_c -0.09093 0.04874 -1.866 0.06211 .
## choice_num:stim_set_c -0.09047 0.11545 -0.784 0.43324
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) expsr_ chc_nm stm_s_ ex_:__
## expsr_frqnc -0.492
## choice_num -0.717 0.243
## stim_set_c -0.060 0.045 0.072
## expsr_fr:__ 0.033 -0.104 -0.026 -0.578
## chc_nm:st__ 0.064 -0.028 -0.095 -0.842 0.240
confint(m, method="Wald")
## 2.5 % 97.5 %
## .sig01 NA NA
## .sig02 NA NA
## .sig03 NA NA
## (Intercept) 0.999187922 1.519749121
## exposure_frequency 0.032051963 0.127655174
## choice_num 0.008585142 0.234056546
## stim_set_c -0.420467617 0.476707228
## exposure_frequency:stim_set_c -0.186461033 0.004603961
## choice_num:stim_set_c -0.316752789 0.135805395
#vif(m) #use this command to double-check variance inflation
model_estimates_frequencies_exp2_or <- m %>%
tidy(effects="fixed",exponentiate=TRUE, conf.int=TRUE)
model_estimates_frequencies_exp2_or
## # A tibble: 6 × 8
## effect term estimate std.error statistic p.value conf.low conf.high
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 fixed (Intercept) 3.52 0.468 9.48 2.45e-21 2.72 4.57
## 2 fixed exposure_freq… 1.08 0.0264 3.27 1.06e- 3 1.03 1.14
## 3 fixed choice_num 1.13 0.0649 2.11 3.49e- 2 1.01 1.26
## 4 fixed stim_set_c 1.03 0.235 0.123 9.02e- 1 0.657 1.61
## 5 fixed exposure_freq… 0.913 0.0445 -1.87 6.21e- 2 0.830 1.00
## 6 fixed choice_num:st… 0.913 0.105 -0.784 4.33e- 1 0.729 1.15
Below are two quick plots visualizing these effects.
#sampling choices
ggplot(exp2_test_d_choice_type,aes(choice_num,is_right,color=condition))+
geom_smooth(method="lm")+
scale_y_continuous(breaks=c(0,0.2,0.4,0.6,0.8,1), limits=c(-0.1,1.1))+
facet_wrap(~stim_set)

#exposure frequency
ggplot(exp2_test_d_choice_type,aes(exposure_frequency,is_right,color=condition))+
geom_smooth(method="lm")+
scale_y_continuous(breaks=c(0,0.2,0.4,0.6,0.8,1), limits=c(-0.1,1.1))+
facet_wrap(~stim_set)

Effects for Block 1 by Condition
Given that we observed condition effects only in Block 1, we
investigated the effects of exposure and sampling frequency specifically
in Block 1 for each condition separately. The effect of exposure
frequency was largely robust across each condition. However, sampling
frequency only predicted test accuracy in the Active condition, not in
either of the Yoked Passive conditions.
#Block 1
#active condition only
m <- glmer(is_right ~exposure_frequency+choice_num+(1|subject)+(1|target_image),data=filter(exp2_test_d_choice_type,stim_set==1 & condition=="active"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ exposure_frequency + choice_num + (1 | subject) +
## (1 | target_image)
## Data: filter(exp2_test_d_choice_type, stim_set == 1 & condition ==
## "active")
##
## AIC BIC logLik -2*log(L) df.resid
## 504.0 526.1 -247.0 494.0 611
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.7324 0.2226 0.2783 0.4070 1.1667
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 1.27716 1.1301
## target_image (Intercept) 0.08226 0.2868
## Number of obs: 616, groups: subject, 77; target_image, 8
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.35353 0.39159 3.457 0.000547 ***
## exposure_frequency 0.13988 0.07378 1.896 0.057978 .
## choice_num 0.37273 0.17523 2.127 0.033414 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) expsr_
## expsr_frqnc -0.545
## choice_num -0.718 0.367
confint(m, method="Wald")
## 2.5 % 97.5 %
## .sig01 NA NA
## .sig02 NA NA
## (Intercept) 0.586033916 2.1210348
## exposure_frequency -0.004729698 0.2844931
## choice_num 0.029281837 0.7161774
model_estimates_frequencies_active_exp2_or <- m %>%
tidy(effects="fixed",exponentiate=TRUE, conf.int=TRUE)
model_estimates_frequencies_active_exp2_or
## # A tibble: 3 × 8
## effect term estimate std.error statistic p.value conf.low conf.high
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 fixed (Intercept) 3.87 1.52 3.46 5.47e-4 1.80 8.34
## 2 fixed exposure_frequ… 1.15 0.0849 1.90 5.80e-2 0.995 1.33
## 3 fixed choice_num 1.45 0.254 2.13 3.34e-2 1.03 2.05
coefs_active <- data.frame(
condition="Active",
N=summary(m)$ngrps[1],
predictor=row.names(summary(m)$coefficients),
beta=summary(m)$coefficients[,1],
se=summary(m)$coefficients[,2],
z=summary(m)$coefficients[,3],
p=summary(m)$coefficients[,4]
)
#passive mismatched condition only
m <- glmer(is_right ~exposure_frequency+choice_num+(1|subject)+(1|target_image),data=filter(exp2_test_d_choice_type,stim_set==1 & condition=="passive_mismatched"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ exposure_frequency + choice_num + (1 | subject) +
## (1 | target_image)
## Data: filter(exp2_test_d_choice_type, stim_set == 1 & condition ==
## "passive_mismatched")
##
## AIC BIC logLik -2*log(L) df.resid
## 618.1 640.2 -304.0 608.1 611
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.0098 0.2425 0.3275 0.5125 1.2538
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 1.251 1.118
## target_image (Intercept) 0.000 0.000
## Number of obs: 616, groups: subject, 77; target_image, 8
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.23734 0.29154 4.244 2.19e-05 ***
## exposure_frequency 0.11919 0.05896 2.022 0.0432 *
## choice_num 0.08790 0.14309 0.614 0.5390
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) expsr_
## expsr_frqnc -0.377
## choice_num -0.731 0.023
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
confint(m, method="Wald")
## 2.5 % 97.5 %
## .sig01 NA NA
## .sig02 NA NA
## (Intercept) 0.665927094 1.8087613
## exposure_frequency 0.003636973 0.2347471
## choice_num -0.192546379 0.3683438
model_estimates_frequencies_passive_mis_exp2_or <- m %>%
tidy(effects="fixed",exponentiate=TRUE, conf.int=TRUE)
model_estimates_frequencies_passive_mis_exp2_or
## # A tibble: 3 × 8
## effect term estimate std.error statistic p.value conf.low conf.high
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 fixed (Intercept) 3.45 1.00 4.24 2.19e-5 1.95 6.10
## 2 fixed exposure_frequ… 1.13 0.0664 2.02 4.32e-2 1.00 1.26
## 3 fixed choice_num 1.09 0.156 0.614 5.39e-1 0.825 1.45
coefs_passive_mis <- data.frame(
condition="Yoked Passive\nMismatch",
N=summary(m)$ngrps[1],
predictor=row.names(summary(m)$coefficients),
beta=summary(m)$coefficients[,1],
se=summary(m)$coefficients[,2],
z=summary(m)$coefficients[,3],
p=summary(m)$coefficients[,4]
)
#passive condition
m <- glmer(is_right ~exposure_frequency+choice_num+(1|subject)+(1|target_image),data=filter(exp2_test_d_choice_type,stim_set==1 & condition=="passive"),family=binomial)
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ exposure_frequency + choice_num + (1 | subject) +
## (1 | target_image)
## Data: filter(exp2_test_d_choice_type, stim_set == 1 & condition ==
## "passive")
##
## AIC BIC logLik -2*log(L) df.resid
## 565.5 587.6 -277.8 555.5 611
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.2542 0.2475 0.3220 0.4477 1.4918
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 1.06620 1.0326
## target_image (Intercept) 0.02276 0.1509
## Number of obs: 616, groups: subject, 77; target_image, 8
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.30987 0.35529 3.687 0.000227 ***
## exposure_frequency 0.16041 0.06947 2.309 0.020931 *
## choice_num 0.13837 0.15853 0.873 0.382745
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) expsr_
## expsr_frqnc -0.561
## choice_num -0.781 0.372
confint(m, method="Wald")
## 2.5 % 97.5 %
## .sig01 NA NA
## .sig02 NA NA
## (Intercept) 0.61351571 2.0062207
## exposure_frequency 0.02426188 0.2965668
## choice_num -0.17233824 0.4490807
model_estimates_frequencies_passive_exp2_or <- m %>%
tidy(effects="fixed",exponentiate=TRUE, conf.int=TRUE)
model_estimates_frequencies_passive_exp2_or
## # A tibble: 3 × 8
## effect term estimate std.error statistic p.value conf.low conf.high
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 fixed (Intercept) 3.71 1.32 3.69 2.27e-4 1.85 7.44
## 2 fixed exposure_frequ… 1.17 0.0816 2.31 2.09e-2 1.02 1.35
## 3 fixed choice_num 1.15 0.182 0.873 3.83e-1 0.842 1.57
coefs_passive <- data.frame(
condition="Yoked Passive",
N=summary(m)$ngrps[1],
predictor=row.names(summary(m)$coefficients),
beta=summary(m)$coefficients[,1],
se=summary(m)$coefficients[,2],
z=summary(m)$coefficients[,3],
p=summary(m)$coefficients[,4]
)
#combine
coefs <- bind_rows(coefs_active,coefs_passive_mis,coefs_passive) %>%
mutate(ci = qt(0.975, N-1)*se,
lower_ci = beta-ci,
upper_ci=beta+ci)
coefs$predictor=factor(coefs$predictor,levels=c("(Intercept)","choice_num","exposure_frequency","Yoked Passive\nMismatch"))
coefs$condition=factor(coefs$condition, levels=c("Active","Yoked Passive","Yoked Passive\nMismatch"))
ggplot(filter(coefs, predictor %in% c("choice_num","exposure_frequency")),aes(predictor,beta, color=condition))+
geom_point(size=5)+
geom_errorbar(aes(ymin=lower_ci,ymax=upper_ci),width=0)+
geom_hline(yintercept=0, linetype="dashed")+
facet_wrap(~condition)+
coord_flip()+
scale_x_discrete(
breaks=c("exposure_frequency","choice_num"),
labels=c("Frequency\nExposure Phase","Frequency\nSampling Phase")
)+
ylab("Model Beta Coefficient")+
xlab("Predictor Variable")+
scale_color_brewer(palette="Set1")+
theme(axis.title = element_text(size=20),
axis.text.y=element_text(size=16),
strip.text=element_text(size=16),
legend.position="none")

ggsave(here(figure_path,"predicting_test_accuracy_from_exposure_block1.png"),width=9,height=6)
Interaction with Condition
Note that the pattern of effects across condition above should be
interpreted with caution, given that we did not observe a significant
interaction between exposure frequency and condition or sampling
frequency and condition.
#note no interaction
#had to remove the by-item random intercept due to non-convergence
m <- glmer(is_right ~(exposure_frequency+choice_num)*condition+(1|subject),data=filter(exp2_test_d_choice_type,stim_set==1),family=binomial,glmerControl(optimizer="bobyqa"))
summary(m)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: is_right ~ (exposure_frequency + choice_num) * condition + (1 |
## subject)
## Data: filter(exp2_test_d_choice_type, stim_set == 1)
## Control: glmerControl(optimizer = "bobyqa")
##
## AIC BIC logLik -2*log(L) df.resid
## 1678.8 1734.1 -829.4 1658.8 1838
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.7935 0.2288 0.3157 0.4355 1.5721
##
## Random effects:
## Groups Name Variance Std.Dev.
## subject (Intercept) 1.171 1.082
## Number of obs: 1848, groups: subject, 231
##
## Fixed effects:
## Estimate Std. Error z value
## (Intercept) 1.328914 0.364066 3.650
## exposure_frequency 0.136381 0.072816 1.873
## choice_num 0.353392 0.170286 2.075
## conditionpassive -0.007028 0.502551 -0.014
## conditionpassive_mismatched -0.103568 0.465546 -0.222
## exposure_frequency:conditionpassive 0.024301 0.100369 0.242
## exposure_frequency:conditionpassive_mismatched -0.017980 0.093922 -0.191
## choice_num:conditionpassive -0.211566 0.232440 -0.910
## choice_num:conditionpassive_mismatched -0.266153 0.222969 -1.194
## Pr(>|z|)
## (Intercept) 0.000262 ***
## exposure_frequency 0.061075 .
## choice_num 0.037961 *
## conditionpassive 0.988843
## conditionpassive_mismatched 0.823952
## exposure_frequency:conditionpassive 0.808688
## exposure_frequency:conditionpassive_mismatched 0.848187
## choice_num:conditionpassive 0.362719
## choice_num:conditionpassive_mismatched 0.232603
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) expsr_ chc_nm cndtnp cndtn_ exps_: exp_:_ chc_n:
## expsr_frqnc -0.598
## choice_num -0.786 0.366
## conditnpssv -0.716 0.437 0.573
## cndtnpssv_m -0.773 0.472 0.619 0.559
## expsr_frqn: 0.438 -0.724 -0.264 -0.603 -0.342
## expsr_frq:_ 0.467 -0.774 -0.283 -0.339 -0.518 0.561
## chc_nm:cndt 0.579 -0.267 -0.731 -0.802 -0.454 0.369 0.207
## chc_nm:cnd_ 0.602 -0.279 -0.763 -0.438 -0.771 0.202 0.225 0.558
Anova(m,type="III")
## Analysis of Deviance Table (Type III Wald chisquare tests)
##
## Response: is_right
## Chisq Df Pr(>Chisq)
## (Intercept) 13.3240 1 0.000262 ***
## exposure_frequency 3.5079 1 0.061075 .
## choice_num 4.3068 1 0.037961 *
## condition 0.0672 2 0.966939
## exposure_frequency:condition 0.2150 2 0.898062
## choice_num:condition 1.5111 2 0.469759
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1