1. Testing Competing Model Specifications

1.1 Distribution of updating response variable



Model formula:

## next_update_short ~ pe_2 + exam_f + (1 | class/id)

Comparison:

  • Gaussian outcome distribution
  • Asymmetric double exponential (asymmetric Laplace) distribution



1.1.1 Posterior predictive check: Gaussian response distribution



1.1.2 Posterior predictive check: Asymmetric Laplace response distribution



1.1.3 Comparing response distributions (LOO / WAIC)

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_delta_laplace 0.000 0.000 -6268.070 37.787 14.613 0.223 12536.14 75.575
md_update_delta_gaussian -74.936 17.965 -6343.006 41.093 9.355 0.758 12686.01 82.186

NOTE: Asymmetric Laplace distribution yields optimal fit for prediction update outcome variable.



1.2 Including grade covariate in updating model

##                             elpd_diff se_diff   elpd_loo  se_elpd_loo p_loo    
## md_update_delta_grade           0.000     0.000 -5864.865    36.201     323.737
## md_update_delta_gradePE_int    -3.299     3.114 -5868.163    36.285     317.769
## md_update_delta_noGrade      -403.245    31.873 -6268.109    37.694      14.169
##                             se_p_loo  looic     se_looic 
## md_update_delta_grade          13.219 11729.729    72.401
## md_update_delta_gradePE_int    13.207 11736.327    72.571
## md_update_delta_noGrade         0.226 12536.218    75.388

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_delta_grade 0.000 0.000 -5846.952 36.376 305.825 12.891 11693.90 72.751
md_update_delta_gradePE_int -4.398 2.971 -5851.350 36.430 300.956 12.861 11702.70 72.860
md_update_delta_noGrade -421.122 32.100 -6268.074 37.693 14.133 0.225 12536.15 75.387

NOTE: Without affect in model, Grade covariate improves model fit. Interaction between Grade x PE yields slightly poorer fit, but WAIC difference is not interpretable.



1.3 Random effects structure

1.3.1 Random effects levels

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
Raneff.id.class.cohort 0.000 0.000 -5822.739 35.866 326.093 12.725 11645.48 71.731
Raneff.id.class -22.574 10.607 -5845.313 36.244 303.438 12.897 11690.63 72.488
Raneff.id -38.892 11.367 -5861.632 36.375 294.413 12.552 11723.26 72.750

NOTE: Maximal nested random effects structure (Cohort / Class / ID) yields optimal model fit.



1.3.2 Random effects slopes

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_grade_id_class_cohort_re_pe_grade_GRADEINT 0.000 0.000 -5506.731 35.036 255.796 7.881 11013.46 70.071
md_grade_id_class_cohort_re_pe_grade -58.603 8.661 -5565.335 34.352 334.582 8.917 11130.67 68.704
md_grade_id_class_cohort_re_pe -284.469 19.346 -5791.200 35.763 370.089 13.988 11582.40 71.525
md_grade_id_class_cohort_re_pe_GRADEINT -292.579 19.076 -5799.311 35.685 357.094 13.539 11598.62 71.371
Raneff.id.class.cohort -316.008 20.101 -5822.739 35.866 326.093 12.725 11645.48 71.731
md_id_class_cohort_re_pe -691.544 35.246 -6198.275 37.760 167.023 5.152 12396.55 75.521

NOTE: Including random slopes for each predictor (1 + pe_2 + grade | Cohort / Class / ID) yields optimal model fit. With maximal random effects, prediction updating is best explained by the Grade x PE interaction.



1.4 Nonlinear PE effects

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_grade_id_class_cohort_re_pe_grade_GRADEINT 0.000 0.000 -5506.731 35.036 255.796 7.881 11013.46 70.071
md_update_delta_grade.id.class.nlPExGrade -77.675 11.726 -5584.406 35.531 337.161 12.020 11168.81 71.061
md_update_delta_grade.id.class.nlPE.rePE_grade -81.649 11.852 -5588.381 35.209 354.969 11.616 11176.76 70.419
md_update_delta_grade.id.class.nlPE_noGrade -681.186 34.822 -6187.918 37.687 163.231 5.137 12375.83 75.373

NOTE: Model with linear Grade x PE interaction fits the data better than models with nonlinear PE effects.



1.5 Excluding high-grade observations

Parameter estimates

NOTE: Here, Updating ~ PE parameter estimates are displayed for models excluding grades above 90%, 80%, and outside the 25th and 75th percentiles for grades, respectively. Point estimates for Updating ~ PE effect increase with exclusion of grades above 80% and 90%, though credible intervals widen with the exclusion of these observations.



Model comparison: grades < 90%

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_updating_truncated_grades_90_wGradeInt 0.000 0.000 -4824.476 30.610 286.377 11.341 9648.951 61.219
md_updating_truncated_grades_90_wGrade -0.029 1.406 -4824.504 30.692 288.626 11.502 9649.009 61.384
md_updating_truncated_grades_90 -317.471 27.205 -5141.947 31.796 24.879 0.440 10283.893 63.592

NOTE: When excluding observations with exam grades above 90%, a model with a linear Grade x PE interaction still fits the data best, but does not differ appreciably in WAIC relative to a model with only Grade and PE main effects.



Model comparison: grades < 80%

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_updating_truncated_grades_80_wGrade 0.000 0.00 -3514.616 25.437 251.363 10.076 7029.232 50.875
md_updating_truncated_grades_80_wGradeInt -7.794 1.55 -3522.410 25.390 251.154 10.014 7044.820 50.780
md_updating_truncated_grades_80 -244.814 21.87 -3759.430 26.084 30.618 0.539 7518.861 52.168

NOTE: When excluding observations with exam grades above 80%, the model with a linear Grade x PE interaction no longer fits the data best. Instead, a model with Grade and PE main effects yields a superior model fit. While AICs do not differ substantially between the interactive and main effects model, the elpd_diff between both models is interpretable and favors the main effect model. Thus, it appears that the Grade x PE interaction improves model fit for high-grade observations where subjects reach a ceiling in grade prediction updates.



1.6 Updating without “bad” prediction data

Here, subjects who reported exam grade expectations of 50 for both their first and second predictions for any exam are excluded prior to model fitting. This represents the most stringent exclusion criteria to remove so-called “bad prediction” subjects. Below, updating models are refit following the application of this maximally stringent exclusion criterion to see A) if best-fitting models shift with this subset of participants, and B) if parameter estimates for the Updating ~ PE effect change appreciably.



Prediction 1 data

NOTE: 5.93% of Prediction 1 data is considered “bad data” by this standard.



Prediction 2 data

NOTE: 7.25% of Prediction 1 data is considered “bad data” by this standard.



Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
updating_rm_bad_preds_gradeInt.brm 0.000 0.000 -4918.892 33.820 291.174 8.329 9837.785 67.640
updating_rm_bad_preds_grade.brm -72.901 6.887 -4991.794 33.798 324.452 10.525 9983.587 67.595
updating_rm_bad_preds.brm -584.054 32.689 -5502.946 36.918 140.381 4.591 11005.893 73.837

NOTE: 10.88% of subjects are excluded after applying the maximally stringent exclusion criterion. Regardless of whether these so-called “bad prediction” subjects are included or excluded, a model with a linear PE x Grade interaction fits the data best.



1.6.1 Conditional effects with and without bad prediction data

All prediction data

Removing “bad prediction” observations

NOTE: Grade x PE interaction is significantly different from zero in models both including and excluding “bad prediction” subjects. Credible intervals change appreciably after removing “bad prediction” subjects such that certainty in effects.



2. Dense Sampling Affect as Moderator of Updating Effect

2.1 Testing Negative Affect x PE Interaction

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_na5h_int 0.000 0.000 -6141.510 37.039 19.790 0.405 12283.02 74.077
md_update_DL_na5h_noInt -2.057 3.173 -6143.566 37.184 17.778 0.359 12287.13 74.369

NOTE: In a model without grade covariate or random slopes, including the PE * NA interaction improves model fit, but not appreciably. WAIC estimates overlap, and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 1.181 8.680 -11.749 34.574 1.011 245 64
pe_2 0.307 0.033 0.233 0.372 1.006 325 56
NA_score_5h_mean_bc 0.170 0.022 0.109 0.211 1.010 249 45
exam_f -0.573 0.329 -1.346 0.035 1.012 238 62
pe_2:NA_score_5h_mean_bc 0.004 0.001 0.001 0.007 1.004 980 1224

NOTE: Interaction effect is relatively weak, but shows that NA primarily differentiates updating following higher, positive PEs. Higher mean NA during the dense sampling period predicts a steeper updating effect.



Negative Affect x PE interaction excluding high grades

Summary: Grades below 90%
setwd("//datastore01.psy.miami.edu/Groups/AHeller_Lab/Undergrad/WVillano/BRMS_updating/MKD_models")
md_update_DL_na5h_int_g90 <- brm(next_update_short ~ pe_2*NA_score_5h_mean_bc + exam_f + (1 | cohort / class / id), 
                             data = df.new[which(df.new$grade <= 90),],
                             family = asym_laplace,
                             chains = 2,
                             cores = 4, 
                             file = "brm_update_DL_na5h_int_g90")
md_update_DL_na5h_int_g90$loo <- loo(md_update_DL_na5h_int_g90)
md_update_DL_na5h_int_g90 <- add_criterion(md_update_DL_na5h_int_g90, criterion = "waic")

kable(summary(md_update_DL_na5h_int_g90)$fixed, digits = 3)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 4.281 6.832 -8.721 18.779 1.006 145 60
pe_2 0.451 0.040 0.372 0.523 1.003 569 1188
NA_score_5h_mean_bc 0.163 0.024 0.118 0.209 1.000 882 1368
exam_f -0.664 0.361 -1.337 0.062 1.001 1327 1131
pe_2:NA_score_5h_mean_bc 0.001 0.002 -0.002 0.005 1.000 1528 1518
Summary: Grades below 80%
setwd("//datastore01.psy.miami.edu/Groups/AHeller_Lab/Undergrad/WVillano/BRMS_updating/MKD_models")
md_update_DL_na5h_int_g80 <- brm(next_update_short ~ pe_2*NA_score_5h_mean_bc + exam_f + (1 | cohort / class / id), 
                             data = df.new[which(df.new$grade <= 80),],
                             family = asym_laplace,
                             chains = 2,
                             cores = 4, 
                             file = "brm_update_DL_na5h_int_g80")
md_update_DL_na5h_int_g80$loo <- loo(md_update_DL_na5h_int_g80)
md_update_DL_na5h_int_g80 <- add_criterion(md_update_DL_na5h_int_g80, criterion = "waic")

kable(summary(md_update_DL_na5h_int_g80)$fixed, digits = 3)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 5.885 6.572 -7.341 19.901 1.002 1134 1145
pe_2 0.526 0.054 0.418 0.632 1.003 1898 1176
NA_score_5h_mean_bc 0.118 0.033 0.054 0.187 1.004 2498 1287
exam_f -0.641 0.554 -1.697 0.479 1.001 2567 1634
pe_2:NA_score_5h_mean_bc 0.001 0.002 -0.003 0.006 1.001 2165 1236
Comparison: PE x NA estimates

NOTE: PE x NA parameter estimate is only significantly different from zero when all grades are included.



Negative Affect x PE adding Grade

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
NA * PE + Grade + RE(PE + Grade) 0.000 0.000 -5572.478 34.959 339.613 11.602 11144.96 69.918
NA * PE + Grade + RE(PE) -207.461 16.521 -5779.939 35.757 354.045 13.388 11559.88 71.514
NA * PE + Grade -224.797 17.334 -5797.275 35.789 318.582 12.373 11594.55 71.578
NA * PE * Grade + RE(PE + Grade) -280.211 18.617 -5852.688 34.700 108.145 5.416 11705.38 69.400
NA * PE * Grade -287.956 18.942 -5860.434 34.389 51.864 2.055 11720.87 68.778
NA * PE * Grade + RE(PE) -306.790 19.961 -5879.268 35.480 107.064 6.117 11758.54 70.960

NOTE: Model with PE x NA interaction and random slopes for PE and Grade fits the data best.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 49.694 8.308 32.568 64.291 1.314 6 30
pe_2 0.341 0.557 -1.067 1.140 1.120 12 26
NA_score_5h_mean_bc 0.006 0.014 -0.018 0.032 1.316 6 62
grade -0.529 0.107 -0.724 -0.272 1.086 14 29
exam_f 0.107 0.161 -0.217 0.468 1.123 19 34
pe_2:NA_score_5h_mean_bc 0.003 0.001 0.001 0.005 1.220 7 81

NOTE: PE x NA interaction is weak but significantly different from zero.



2.2 Positive Affect x PE Interaction

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_pa5h_int 0.000 0.000 -6189.882 38.411 18.876 0.403 12379.76 76.822
md_update_DL_pa5h_noInt -0.084 2.136 -6189.966 38.493 17.243 0.369 12379.93 76.985

NOTE: In a model without grade covariate or random slopes, including the PE * PA interaction improves model fit, but not appreciably. WAIC estimates overlap, and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.983 5.877 -12.858 10.944 1.001 789 780
pe_2 0.195 0.036 0.123 0.264 1.001 1326 1235
PA_score_5h_mean_bc -0.133 0.026 -0.182 -0.084 1.002 1673 1524
exam_f -0.460 0.318 -1.107 0.137 1.002 2691 1370
pe_2:PA_score_5h_mean_bc -0.003 0.002 -0.007 0.001 1.001 2418 1573

NOTE: While including the PE * PA interaction improves model fit, the interaction is not significantly different from zero. Nonetheless, the interaction effect is plotted above.



Positive Affect x PE interaction excluding high grades

Summary: Grades below 90%
setwd("//datastore01.psy.miami.edu/Groups/AHeller_Lab/Undergrad/WVillano/BRMS_updating/MKD_models")
md_update_DL_pa5h_int_g90 <- brm(next_update_short ~ pe_2*PA_score_5h_mean_bc + exam_f + (1 | cohort / class / id), 
                             data = df.new[which(df.new$grade <= 90),],
                             family = asym_laplace,
                             chains = 2,
                             cores = 4, 
                             file = "brm_update_DL_pa5h_int_g90")
md_update_DL_pa5h_int_g90$loo <- loo(md_update_DL_pa5h_int_g90)
md_update_DL_pa5h_int_g90 <- add_criterion(md_update_DL_pa5h_int_g90, criterion = "waic")

kable(summary(md_update_DL_pa5h_int_g90)$fixed, digits = 3)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 3.570 6.135 -8.968 16.081 1.003 666 865
pe_2 0.462 0.037 0.390 0.535 1.001 1489 1463
PA_score_5h_mean_bc -0.177 0.027 -0.230 -0.120 1.000 1850 995
exam_f -0.886 0.394 -1.633 -0.097 1.001 2093 1202
pe_2:PA_score_5h_mean_bc -0.001 0.002 -0.005 0.003 1.000 2202 1531
Summary: Grades below 80%
setwd("//datastore01.psy.miami.edu/Groups/AHeller_Lab/Undergrad/WVillano/BRMS_updating/MKD_models")
md_update_DL_pa5h_int_g80 <- brm(next_update_short ~ pe_2*PA_score_5h_mean_bc + exam_f + (1 | cohort / class / id), 
                             data = df.new[which(df.new$grade <= 80),],
                             family = asym_laplace,
                             chains = 2,
                             cores = 4, 
                             file = "brm_update_DL_pa5h_int_g80")
md_update_DL_pa5h_int_g80$loo <- loo(md_update_DL_pa5h_int_g80)
md_update_DL_pa5h_int_g80 <- add_criterion(md_update_DL_pa5h_int_g80, criterion = "waic")

kable(summary(md_update_DL_pa5h_int_g80)$fixed, digits = 3)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 6.044 6.738 -7.348 20.122 1.002 923 873
pe_2 0.528 0.053 0.425 0.627 1.000 2090 1641
PA_score_5h_mean_bc -0.101 0.037 -0.173 -0.029 1.002 2221 1358
exam_f -0.622 0.525 -1.624 0.437 1.001 2875 1300
pe_2:PA_score_5h_mean_bc 0.000 0.003 -0.006 0.006 1.000 2060 1535
Comparison: PE x PA estimates

NOTE: Parameter estimates for PE x PA interaction are not significantly different from zero regardless of which grades are excluded. However, point estimate for interaction effect is highest for grades < 80%.



2.3 High vs. low arousal affect items

2.3.1 Low arousal Negative Affect x PE Interaction

Tired
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_tired5h_noInt 0.000 0.000 -6199.771 38.746 13.704 0.360 12399.54 77.491
md_update_DL_tired5h_int -1.003 0.649 -6200.774 38.675 14.906 0.373 12401.55 77.349

NOTE: In updating model with tired emotion item, model with only main effects of PE and tired fits the data best. WAICs overlap, but elpd_diff is moderately interpretable and indicates that main effect model yields optimal fit.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -1.778 5.648 -12.245 10.393 1.002 756 930
pe_2 0.089 0.033 0.031 0.159 1.001 1105 1504
Tired_5h_mean_bc 0.032 0.017 0.001 0.068 1.001 1397 1062
exam_f -0.322 0.264 -0.837 0.165 1.000 1822 1608

NOTE: Effect of PE on Updating, conditioned on tired scores from the dense sampling period shows that updating is primarily occurring in the negative direction after negative PEs.



Sad
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_sad5h_int 0.000 0.000 -6147.893 36.907 19.925 0.388 12295.79 73.814
md_update_DL_sad5h_noInt -3.391 3.531 -6151.284 37.073 18.975 0.358 12302.57 74.145

NOTE: In updating model with sad emotion item, model with PE x tired interaction fits the data best, though WAICs overlap and elpd_diff is not entirely interpretable given the wide margin of error.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.644 5.621 -11.995 11.232 1.005 570 558
pe_2 0.296 0.034 0.228 0.365 1.001 1581 1438
Sad_5h_mean_bc 0.142 0.015 0.112 0.173 1.000 1549 1507
exam_f -0.595 0.315 -1.256 0.014 1.004 2007 1017
pe_2:Sad_5h_mean_bc 0.003 0.001 0.001 0.006 1.002 2047 1667

NOTE: Interaction between PE x sad is significantly different from zero and indicates that increased sad scores during the dense sampling period are associated with steeper updating slopes. Sad scores seem to differentiate updating effects most substantially after higher, more positive PEs.



2.3.2 High arousal Negative Affect x PE Interaction

Irritable
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_irritable5h_int 0.00 0.000 -6164.877 36.905 20.141 0.405 12329.75 73.811
md_update_DL_irritable5h_noInt -4.57 4.283 -6169.447 36.986 19.464 0.368 12338.90 73.971

NOTE: In updating model with irritable emotion item, model with PE x irritable interaction fits the data best, though WAICs overlap and elpd_diff may not be reliable to interpret.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.518 5.376 -11.049 10.831 1.002 880 889
pe_2 0.235 0.033 0.172 0.300 1.001 1942 1663
Irritable_5h_mean_bc 0.101 0.018 0.069 0.137 1.004 1635 1267
exam_f -0.677 0.317 -1.292 -0.055 1.000 2309 1440
pe_2:Irritable_5h_mean_bc 0.005 0.001 0.002 0.007 1.005 2171 1459

NOTE: Interaction between PE x Irritable is significantly different from zero and indicates that increased irritable scores during the dense sampling period are associated with steeper updating slopes. Irritable scores seem to differentiate updating effects most substantially after higher, more positive PEs.



Stressed
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_stress5h_noInt 0.000 0.000 -6158.761 37.232 16.554 0.306 12317.52 74.463
md_update_DL_stress5h_int -1.877 1.368 -6160.638 37.123 19.725 0.382 12321.28 74.247

NOTE: In updating model with stressed emotion item, model with only main effects of PE and stressed fits the data best, though WAICs overlap and elpd_diff may not be reliable to interpret.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 1.273 5.412 -9.737 12.269 1.004 773 827
pe_2 0.299 0.031 0.237 0.358 1.001 1751 1233
Stressed_5h_mean_bc 0.134 0.016 0.102 0.165 1.000 1706 1537
exam_f -0.849 0.314 -1.493 -0.246 0.999 2642 1336

NOTE: Effect of PE on Updating, conditioned on stressed scores from the dense sampling period shows a symmetrical updating effect over positive and negative PEs of similar magnitude.



Anxious
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_anx5h_noInt 0.00 0.000 -6157.911 37.389 17.328 0.349 12315.82 74.778
md_update_DL_anx5h_int -0.64 2.534 -6158.551 37.336 20.385 0.407 12317.10 74.673

NOTE: In updating model with anxious emotion item, model with only main effects of PE and anxious fits the data best, though WAICs overlap, and elpd_diff is not interpretable given the wide margin of error.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.683 6.010 -11.719 13.505 1.000 471 717
pe_2 0.280 0.029 0.222 0.338 1.000 1413 1422
Anxious_5h_mean_bc 0.132 0.017 0.100 0.164 0.999 1306 1358
exam_f -0.814 0.311 -1.451 -0.243 1.003 1627 1245

NOTE: Effect of PE on Updating, conditioned on anxious scores from the dense sampling period shows a symmetrical updating effect over positive and negative PEs of similar magnitude.



2.3.3 Low arousal Positive Affect x PE Interaction

Relaxed
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_relaxed5h_int 0.000 0.000 -6164.434 37.109 21.493 0.403 12328.87 74.217
md_update_DL_relaxed5h_noInt -2.334 3.509 -6166.768 37.093 20.051 0.371 12333.54 74.185

NOTE: In updating model with relaxed emotion item, model with PE x relaxed interaction fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.636 5.513 -11.071 11.409 1.012 614 704
pe_2 0.284 0.031 0.225 0.342 1.000 2085 1300
Relaxed_5h_mean_bc -0.110 0.019 -0.148 -0.073 0.999 1930 1593
exam_f -0.857 0.341 -1.528 -0.182 1.001 1811 1150
pe_2:Relaxed_5h_mean_bc -0.004 0.002 -0.007 -0.001 1.000 2379 1416

NOTE: Interaction between PE x Relaxed is significantly different from zero and indicates that lower relaxed scores during the dense sampling period are associated with steeper updating slopes. Relaxed scores seem to differentiate updating effects most substantially after higher, more positive PEs.



Content
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_content5h_int 0.000 0.000 -6136.147 36.919 19.634 0.389 12272.29 73.839
md_update_DL_content5h_noInt -0.117 2.091 -6136.264 37.000 17.817 0.361 12272.53 74.000

NOTE: In updating model with content emotion item, model with PE x content fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.267 5.656 -12.499 11.185 1.001 567 674
pe_2 0.357 0.035 0.288 0.425 1.000 1657 1283
Content_5h_mean_bc -0.171 0.017 -0.206 -0.137 1.000 1591 1374
exam_f -0.588 0.317 -1.231 0.036 1.000 2177 1300
pe_2:Content_5h_mean_bc -0.002 0.001 -0.005 0.000 1.000 2430 1419

NOTE: Parameter estimate for PE x content interaction is not significantly different from zero, but the interaction effect is plotted above nonetheless.



2.3.4 Ambiguous arousal Positive Affect x PE Interaction

Happy
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_happy5h_int 0.000 0.000 -6145.467 36.839 21.224 0.453 12290.93 73.679
md_update_DL_happy5h_noInt -0.139 2.674 -6145.606 36.944 18.743 0.399 12291.21 73.888

NOTE: In updating model with happy emotion item, model with PE x happy interaction fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.617 5.846 -10.830 13.368 1.004 499 561
pe_2 0.345 0.033 0.282 0.408 1.000 1463 1348
Happy_5h_mean_bc -0.155 0.018 -0.189 -0.121 1.000 1273 1374
exam_f -0.687 0.300 -1.271 -0.082 1.000 1794 1134
pe_2:Happy_5h_mean_bc -0.003 0.001 -0.005 0.000 1.001 1804 1317

NOTE: PE x Happy interaction estimate is not significantly different from zero.



2.3.5 High arousal Positive Affect x PE Interaction

Excited
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_DL_excited5h_int 0.000 0.000 -6169.744 36.899 23.296 0.458 12339.49 73.798
md_update_DL_excited5h_noInt -0.311 2.196 -6170.055 37.011 21.811 0.426 12340.11 74.021

NOTE: In updating model with excited emotion item, model with PE x excited interaction effect fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.693 5.311 -9.764 12.072 1.003 909 897
pe_2 0.297 0.037 0.226 0.368 0.999 1663 1450
Excited_5h_mean_bc -0.109 0.021 -0.150 -0.067 1.001 1647 1381
exam_f -0.843 0.319 -1.453 -0.234 1.000 2768 1293
pe_2:Excited_5h_mean_bc -0.003 0.001 -0.006 0.000 1.002 2555 1520

NOTE: Parameter estimate for PE x Excited interaction is not significantly different from zero.



3. Anticipation Affect as Moderator of Updating Effect

3.1 Testing Negative Affect x PE Interaction

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_na5h_int 0.000 0.000 -5677.465 35.511 20.697 0.359 11354.93 71.021
md_update_AL_na5h_noInt -1.014 1.924 -5678.479 35.569 20.641 0.351 11356.96 71.137

NOTE: In a model without grade covariate or random slopes, including the PE * Anticipation NA interaction improves model fit, but not appreciably. WAIC estimates overlap, and elpd_diff may not be reliable to interpret.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -3.371 5.953 -15.859 8.701 1 692 731
pe_2 0.068 0.078 -0.079 0.220 1 2551 1640
anticipation_NA_mean 0.085 0.017 0.054 0.118 1 2602 1371
exam_f -0.875 0.327 -1.519 -0.235 1 2664 1457
pe_2:anticipation_NA_mean 0.002 0.001 0.000 0.005 1 2300 1424

NOTE: Interaction effect is relatively weak, but is significantly different from zero. The plotted interaction effect shows that anticipation NA primarily differentiates updating following higher, positive PEs. Higher mean anticipation NA predicts a steeper updating effect.



3.1.1 Negative Affect x PE interaction excluding high grades

Summary: Grades below 90%
setwd("//datastore01.psy.miami.edu/Groups/AHeller_Lab/Undergrad/WVillano/BRMS_updating/MKD_models")
md_update_AL_na5h_int_g90 <- brm(next_update_short ~ pe_2*anticipation_NA_mean + exam_f + (1 | cohort / class / id), 
                             data = df.new[which(df.new$grade <= 90),],
                             family = asym_laplace,
                             chains = 2,
                             cores = 4, 
                             file = "brm_update_AL_na5h_int_g90", 
                             threads = threading(2, grainsize = 315),
                             backend = "cmdstanr")
md_update_AL_na5h_int_g90$loo <- loo(md_update_AL_na5h_int_g90)
md_update_AL_na5h_int_g90 <- add_criterion(md_update_AL_na5h_int_g90, criterion = "waic")

kable(summary(md_update_AL_na5h_int_g90)$fixed, digits = 3)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.303 6.454 -12.528 13.528 1.001 669 904
pe_2 0.169 0.087 0.004 0.351 1.002 1886 1110
anticipation_NA_mean 0.096 0.019 0.059 0.133 1.001 2299 1332
exam_f -0.926 0.399 -1.720 -0.134 1.001 1983 1279
pe_2:anticipation_NA_mean 0.003 0.002 0.000 0.006 1.004 1909 1307
Summary: Grades below 80%
setwd("//datastore01.psy.miami.edu/Groups/AHeller_Lab/Undergrad/WVillano/BRMS_updating/MKD_models")
md_update_AL_na5h_int_g80 <- brm(next_update_short ~ pe_2*anticipation_NA_mean + exam_f + (1 | cohort / class / id), 
                             data = df.new[which(df.new$grade <= 80),],
                             family = asym_laplace,
                             chains = 2,
                             cores = 4, 
                             file = "brm_update_AL_na5h_int_g80", 
                             threads = threading(2, grainsize = 315),
                             backend = "cmdstanr")
md_update_AL_na5h_int_g80$loo <- loo(md_update_AL_na5h_int_g80)
md_update_AL_na5h_int_g80 <- add_criterion(md_update_AL_na5h_int_g80, criterion = "waic")

kable(summary(md_update_AL_na5h_int_g80)$fixed, digits = 3)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 1.595 6.885 -12.549 15.139 1.004 781 747
pe_2 0.236 0.117 0.016 0.468 1.001 1536 1489
anticipation_NA_mean 0.105 0.025 0.054 0.154 1.000 1706 1507
exam_f -0.559 0.606 -1.712 0.653 0.999 2047 1527
pe_2:anticipation_NA_mean 0.003 0.002 0.000 0.007 1.001 1591 1657
Comparison: PE x NA estimates

NOTE: PE x Anticipation NA parameter estimate is most reliably different from zero when all grades are included.



3.1.2 Negative Affect x PE adding Grade

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
NA * PE + Grade + RE(PE + Grade) 0.000 0.000 -5128.628 32.999 326.275 9.549 10257.26 65.998
NA * PE + Grade + RE(PE) -192.173 13.858 -5320.801 34.076 334.738 13.324 10641.60 68.152
NA * PE + Grade -215.006 15.093 -5343.634 34.197 307.094 12.715 10687.27 68.395
NA * PE * Grade + RE(PE + Grade) -338.263 19.778 -5466.891 33.398 79.482 5.866 10933.78 66.796
NA * PE * Grade + RE(PE) -359.112 18.651 -5487.740 33.177 85.747 4.610 10975.48 66.354
NA * PE * Grade -495.376 21.560 -5624.004 32.882 129.423 3.551 11248.01 65.764

NOTE: Model with PE x Anticipation NA interaction, grade covariate, and random slopes for PE and Grade fits the data best.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 49.339 8.487 32.967 67.078 1.042 46 115
pe_2 0.445 0.251 -0.119 0.926 1.023 74 75
anticipation_NA_mean 0.006 0.013 -0.019 0.033 1.142 11 141
grade -0.578 0.104 -0.792 -0.395 1.022 70 155
exam_f -0.017 0.206 -0.378 0.427 1.060 55 174
pe_2:anticipation_NA_mean 0.002 0.001 0.000 0.004 1.027 68 431

NOTE: PE x NA interaction is weak but significantly different from zero. Greater NA during the anticipation period predicts steeper prediction updating effects.



3.2 Positive Affect x PE Interaction

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_pa5h_noInt 0.000 0.000 -5686.421 35.502 18.668 0.336 11372.84 71.004
md_update_AL_pa5h_int -1.071 1.539 -5687.492 35.422 20.838 0.385 11374.98 70.844

NOTE: In a model without grade covariate or random slopes, a model with only main effects of PE and Anticipation PA fits the data best, though WAIC estimates overlap and elpd_diff is not reliable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 3.899 5.886 -6.712 16.092 1.003 576 744
pe_2 0.170 0.032 0.108 0.235 1.000 2055 1210
exam_f -0.862 0.353 -1.558 -0.147 1.000 1978 1408
anticipation_PA_mean -0.069 0.020 -0.108 -0.028 1.002 2056 1437

NOTE: Main effect of PE conditioned on Anticipation PA shows a symmetrical updating effect.



3.3 High vs. low arousal affect items

3.3.1 Low arousal Negative Affect x PE Interaction

Tired
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_tired5h_noInt 0.000 0.00 -5687.996 35.485 19.130 0.347 11375.99 70.969
md_update_AL_tired5h_int -1.165 0.19 -5689.161 35.458 20.317 0.396 11378.32 70.916

NOTE: In updating model with Anticipation tired emotion item, model with only main effects of PE and Anticipation tired fits the data best. WAICs overlap, but elpd_diff is interpretable and indicates that main effect model yields optimal fit.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.436 5.591 -11.988 10.732 1.001 794 654
pe_2 0.172 0.031 0.110 0.234 1.000 2625 1310
anticipation_Tired_mean_bc 0.055 0.019 0.019 0.091 1.000 2631 1235
exam_f -0.810 0.367 -1.524 -0.110 1.002 2602 1127

NOTE: Effect of PE on Updating, conditioned on Anticipation tired scores shows a symmetrical updating effect.



Sad
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_sad5h_int 0.000 0.00 -5660.704 35.338 21.403 0.397 11321.41 70.675
md_update_AL_sad5h_noInt -2.833 2.97 -5663.537 35.415 21.674 0.372 11327.07 70.830

NOTE: In updating model with Anticipation sad emotion item, model with PE x Anticipation sad interaction fits the data best, though WAICs overlap and elpd_diff is not reliably interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.339 5.629 -11.398 10.670 1.005 666 747
pe_2 0.258 0.035 0.191 0.327 1.001 2273 1320
anticipation_Sad_mean_bc 0.149 0.018 0.113 0.184 1.003 2158 1659
exam_f -0.679 0.367 -1.373 0.033 1.000 2347 1553
pe_2:anticipation_Sad_mean_bc 0.003 0.001 0.001 0.006 1.003 1936 1234

NOTE: Interaction between PE x Anticipation sad is significantly different from zero and indicates that increased Anticipation sad scores are associated with steeper updating slopes. Anticipation Sad scores seem to differentiate updating effects most substantially after higher, more positive PEs.



3.3.2 High arousal Negative Affect x PE Interaction

Irritable
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_irritable5h_noInt 0.000 0.000 -5675.638 35.380 18.783 0.357 11351.28 70.760
md_update_AL_irritable5h_int -1.121 1.933 -5676.759 35.279 21.596 0.457 11353.52 70.559

NOTE: In updating model with Anticipation irritable emotion item, model with only main effects of PE and Anticipation irritable fits the data best, though WAICs overlap and elpd_diff may not be reliable



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.694 5.485 -11.150 10.427 1.000 965 747
pe_2 0.225 0.031 0.161 0.291 1.003 2310 1291
anticipation_Irritable_mean_bc 0.119 0.021 0.078 0.159 1.002 2292 1425
exam_f -0.546 0.347 -1.189 0.132 0.999 2850 1056

NOTE: Main effect of PE, conditioned on Anticipation irritable scores shows a symmetrical updating effect.



Stressed
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_stress5h_noInt 0.000 0.000 -5667.069 35.584 18.813 0.367 11334.14 71.168
md_update_AL_stress5h_int -1.519 0.282 -5668.587 35.543 20.899 0.413 11337.17 71.085

NOTE: In updating model with Anticipation stressed emotion item, model with only main effects of PE and Anticipation stressed fits the data best. While WAICs overlap, elpd_diff is interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 1.757 5.178 -9.172 11.836 1.001 616 827
pe_2 0.263 0.032 0.201 0.325 1.004 1362 1339
anticipation_Stressed_mean_bc 0.142 0.019 0.103 0.179 1.003 1358 1233
exam_f -0.963 0.342 -1.619 -0.269 1.000 2057 1426

NOTE: Effect of PE on Updating, conditioned on Anticipation stressed scores from the shows a symmetrical updating effect over positive and negative PEs of similar magnitude.



Anxious
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_anx5h_int 0.000 0.000 -5669.311 35.657 20.367 0.392 11338.62 71.313
md_update_AL_anx5h_noInt -0.448 1.855 -5669.759 35.686 19.783 0.362 11339.52 71.373

NOTE: In updating model with Anticipation anxious emotion item, model with PE x Anticipation anxious fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 1.586 5.300 -10.191 13.039 1.003 771 695
pe_2 0.239 0.031 0.181 0.298 0.999 2275 1233
anticipation_Anxious_mean_bc 0.125 0.020 0.084 0.163 1.001 2073 1601
exam_f -0.931 0.346 -1.614 -0.275 1.000 2412 1404
pe_2:anticipation_Anxious_mean_bc 0.002 0.002 -0.001 0.005 1.000 2472 1734

NOTE: Parameter estimate for PE x Anticipation anxious interaction effect is not significantly different from zero.



3.3.3 Low arousal Positive Affect x PE Interaction

Relaxed
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_relaxed5h_int 0.000 0.000 -5674.765 35.541 19.930 0.401 11349.53 71.082
md_update_AL_relaxed5h_noInt -0.099 1.809 -5674.865 35.491 18.788 0.350 11349.73 70.982

NOTE: In updating model with Anticipation relaxed emotion item, model with PE x Anticipation relaxed interaction fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 1.273 5.927 -11.163 13.001 1.003 841 885
pe_2 0.237 0.031 0.179 0.297 1.003 2278 1394
anticipation_Relaxed_mean_bc -0.119 0.022 -0.161 -0.075 1.003 2176 1392
exam_f -0.863 0.360 -1.561 -0.170 1.000 2807 1305
pe_2:anticipation_Relaxed_mean_bc -0.002 0.002 -0.006 0.001 1.003 2578 1494

NOTE: Interaction between PE x Anticipation Relaxed is not significantly different from zero.



Content
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_content5h_int 0.000 0.000 -5654.898 35.285 20.813 0.416 11309.80 70.570
md_update_AL_content5h_noInt -0.105 1.742 -5655.003 35.302 19.856 0.370 11310.01 70.604

NOTE: In updating model with Anticipation content emotion item, model with PE x Anticipation content interaction fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.525 5.436 -11.129 12.064 1.002 825 824
pe_2 0.297 0.034 0.226 0.364 1.002 2070 1375
anticipation_Content_mean_bc -0.166 0.020 -0.205 -0.129 1.001 1829 1241
exam_f -0.587 0.360 -1.298 0.082 1.001 2673 1411
pe_2:anticipation_Content_mean_bc -0.002 0.001 -0.005 0.001 1.005 2149 1307

NOTE: Parameter estimate for PE x Anticipation content interaction is not significantly different from zero.



3.3.4 Ambiguous arousal Positive Affect x PE Interaction

Happy
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_happy5h_noInt 0.000 0.000 -5660.538 35.437 19.171 0.399 11321.08 70.874
md_update_AL_happy5h_int -0.098 1.382 -5660.637 35.415 19.979 0.419 11321.27 70.831

NOTE: In updating model with happy emotion item, model with only main effects for PE and Anticipation happy fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -0.158 5.177 -10.729 9.794 1.000 927 969
pe_2 0.301 0.035 0.233 0.368 1.001 2282 1359
anticipation_Happy_mean_bc -0.167 0.020 -0.204 -0.128 1.000 2082 1353
exam_f -0.594 0.341 -1.286 0.073 1.002 2092 1355

NOTE: PE updating effect, conditioned on Anticipation happy scores shows a symmetrical effect over both positive and negative PEs.



3.3.5 High arousal Positive Affect x PE Interaction

Excited
Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
md_update_AL_excited5h_noInt 0.000 0.000 -5679.996 35.424 21.682 0.400 11359.99 70.848
md_update_AL_excited5h_int -1.279 1.397 -5681.275 35.361 24.115 0.488 11362.55 70.722

NOTE: In updating model with Anticipation excited emotion item, model with only PE and Anticipation excited interaction effect fits the data best, though WAICs overlap and elpd_diff is not interpretable.



Effects from winning model

Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.577 5.430 -9.939 12.622 1.000 988 917
pe_2 0.247 0.035 0.179 0.315 1.002 1434 1364
anticipation_Excited_mean_bc -0.120 0.023 -0.163 -0.074 1.001 1773 1509
exam_f -0.831 0.354 -1.534 -0.137 1.000 2554 1581

NOTE: Updating ~ PE effect, conditioned on Anticipation happy scores shows a symmetrical updating effect.



4. Mediation models

4.1 Simple vs. moderated mediation

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
mod_mediation_dense 0.000 0.000 -12054.55 48.846 513.425 13.018 24109.10 97.692
simple_mediation_dense -558.759 31.695 -12613.31 51.755 456.686 13.846 25226.62 103.509

NOTE: Moderated mediation model, in which grade moderates the path from PE to Prediction Update fits the data better than the nested simple mediation model.



Bayesian R2

Estimate Est.Error Q2.5 Q97.5
R2NAscore5hmeanbc 0.298 0.046 0.206 0.368
R2nextupdateshort 0.493 0.014 0.464 0.521

NOTE: Coefficient of determination for Prediction Update (yellow density) is pretty impressive and appears to be a reliable estimate. The R2 distribution for NA mean (5h) indicates that approximately 25% of the variance in NA during the first 5 hours of dense sampling is explained by PE. Additional models (tested in section 4.2) will include Grade as a predictor of PE and as a moderator of the path from PE to Prediction Update.



Visualizing AB path

##    50%   2.5%  97.5% 
## -0.023 -0.270  0.291

Direct vs. total effects

NOTE: Zero appears to be a more credible estimate for the direct effect than the total effect through the mediator, Dense NA, with grade moderating the path from PE to Prediction Update.



4.2 Serial and Parallel Mediation

Model List

Name Model.Type Formula
mediation_test_1.1 mediator model NA_score_5h_mean_bc ~ grade + pe_2 + (1 + grade + pe_2 | cohort/class/id)
mediation_test_1.1 outcome_model next_update_short ~ pe_2 + NA_score_5h_mean_bc + (1 + pe_2 | cohort/class/id)
mediation_test_1.2 mediator model NA_score_5h_mean_bc ~ grade + pe_2 + (1 + grade + pe_2 | cohort/class/id)
mediation_test_1.2 outcome_model next_update_short ~ pe_2 * grade + NA_score_5h_mean_bc + (1 + grade + pe_2 | cohort/class/id)
mediation_test_1.3 mediator model NA_score_5h_mean_bc ~ grade + pe_2 + (1 + grade + pe_2 | cohort/class/id)
mediation_test_1.3 outcome_model next_update_short ~ pe_2 * NA_score_5h_mean_bc + (1 + pe_2 | cohort/class/id)
mediation_test_1.4 mediator model NA_score_5h_mean_bc ~ grade + pe_2 + (1 + grade + pe_2 | cohort/class/id)
mediation_test_1.4 outcome_model next_update_short ~ s(pe_2) + NA_score_5h_mean_bc + (1 + pe_2 | cohort/class/id)
mediation_test_1.5 mediator model [1] NA_score_5h_mean_bc ~ grade + pe_2 + (1 + grade + pe_2 | cohort/class/id)
mediation_test_1.5 mediator model [2] pe_2 ~ grade
mediation_test_1.5 outcome_model next_update_short ~ pe_2 + NA_score_5h_mean_bc + (1 + pe_2 + NA_score_5h_mean_bc | cohort/class/id)

Model comparison

elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
mediation_test_1.2 0.000 0.000 -11901.55 49.941 525.451 13.761 23803.10 99.882
mediation_test_1.4 -579.759 31.891 -12481.31 52.128 378.719 12.442 24962.62 104.256
mediation_test_1.3 -586.797 32.482 -12488.35 52.143 378.235 12.334 24976.70 104.287
mediation_test_1.1 -589.850 32.349 -12491.40 52.205 379.583 12.456 24982.80 104.410
mediation_test_1.5 -6276.324 48.833 -18177.88 65.786 509.798 15.797 36355.75 131.572

NOTE: Moderated mediation model with the addition of a path from grade to Dense NA (5 hour) yields the best fit to the data relative to other models tested.



Bayesian R2 (winning mediation model)

### {-}