Outcome: expectations become more accurate
df.retest$accuracy <- 100 - df.retest$unsigned_pe_1
mdlA <- lmer(accuracy ~ exam + (1 | cohort_class / pt_id),
data = df.retest)
kable(coef(summary(mdlA)))
| (Intercept) |
87.115872 |
0.5542695 |
3.962007 |
157.172417 |
0 |
| exam |
1.064096 |
0.1255585 |
1962.788681 |
8.474899 |
0 |
ggplot(data = df.retest[which(df.retest$exam < 5),],
aes(x = exam_f, y = accuracy)) +
geom_violin(size = 2, alpha = 0.35, fill = "skyblue3", color = NA) +
geom_boxplot(width = 0.1, fill = "skyblue2", color = "skyblue4", size = 1, alpha = 0.5) +
xlab("Exam") +
ylab("Accuracy") +
ggtitle(NULL) +
geom_ribbon(data= as.data.frame(get_model_data(mdlA, type = "pred"))[which(as.data.frame(get_model_data(mdlA, type = "pred"))$exam.x < 5),], inherit.aes = F, aes(x = exam.x, y = exam.predicted, ymin = exam.conf.low, ymax = exam.conf.high), fill = "skyblue4", alpha = 0.5) +
geom_line(data= as.data.frame(get_model_data(mdlA, type = "pred"))[which(as.data.frame(get_model_data(mdlA, type = "pred"))$exam.x < 5),], inherit.aes = F, aes(x = exam.x, y = exam.predicted), color = "skyblue4", size = 1)

Process: prediction errors drive updates to expectations
mdlA <- lmer(next_update_1 ~ pe_1 + delta_grade + (1 | cohort_class / pt_id),
data = df.retest)
kable(coef(summary(mdlA)))
| (Intercept) |
-0.3281408 |
0.3519797 |
1.210108 |
-0.9322719 |
0.499515 |
| pe_1 |
0.7099652 |
0.0233570 |
1228.633727 |
30.3962810 |
0.000000 |
| delta_grade |
0.7295535 |
0.0176037 |
836.005548 |
41.4431114 |
0.000000 |
plot_model(mdlA, type = "pred", terms = "pe_1")

Valence asymmetry
Positive PEs drive larger updates to expectations than negative PEs
md <- lmer(next_update_1 ~ unsigned_pe_1_flip*pe_1_sign_f_NAzero + delta_grade + (1 | cohort_class / pt_id), data = df.retest)
kable(coef(summary(md)))
| (Intercept) |
-1.6268363 |
0.7855602 |
9.09896 |
-2.0709251 |
0.0679262 |
| unsigned_pe_1_flip |
0.5954569 |
0.0505578 |
1494.94575 |
11.7777358 |
0.0000000 |
| pe_1_sign_f_NAzero1 |
-0.4231694 |
0.9223949 |
1488.62315 |
-0.4587725 |
0.6464645 |
| delta_grade |
0.7260725 |
0.0178186 |
920.04470 |
40.7479214 |
0.0000000 |
| unsigned_pe_1_flip:pe_1_sign_f_NAzero1 |
0.2933645 |
0.0719261 |
1489.93036 |
4.0786948 |
0.0000477 |
# updating rates larger for positive PEs
plot_model(md, type = "pred", terms = c("unsigned_pe_1_flip","pe_1_sign_f_NAzero"))

Updates following positive PEs
md_pos <- lmer(next_update_1 ~ unsigned_pe_1 + delta_grade + (1 | cohort_class / pt_id), data = df.retest[which(df.retest$pe_1_sign_f_NAzero == "1"),])
kable(coef(summary(md_pos)))
| (Intercept) |
-1.9985969 |
0.6557891 |
562.6910 |
-3.047621 |
0.0024149 |
| unsigned_pe_1 |
0.9113961 |
0.0516356 |
768.9985 |
17.650530 |
0.0000000 |
| delta_grade |
0.8257130 |
0.0252274 |
692.5488 |
32.730754 |
0.0000000 |
Positive updating rate: 0.91
Updates following negative PEs
md_neg <- lmer(next_update_1 ~ unsigned_pe_1 + delta_grade + (1 | cohort_class / pt_id), data = df.retest[which(df.retest$pe_1_sign_f_NAzero == "-1"),])
kable(coef(summary(md_neg)))
| (Intercept) |
-1.7513690 |
0.9217399 |
3.916158 |
-1.900068 |
0.1317536 |
| unsigned_pe_1 |
-0.5273256 |
0.0521641 |
726.404995 |
-10.108980 |
0.0000000 |
| delta_grade |
0.6361892 |
0.0247787 |
601.680753 |
25.674792 |
0.0000000 |
Negative updating rate: 0.52