library(tidyverse)
library(brms)
d_red <- read_csv("processed-data/data-to-model.csv")
d <- filter(d_red, !is.na(gender_female) & !is.na(pre_interest)) # if there are missing vals in the fixed predictors, MCMCglmm gives a warning
d <- fill(d, pre_interest, post_interest)
d <- d %>%
mutate(creating_product = ifelse(youth_activity_rc == "Creating Product", 1, 0),
lab_activity = ifelse(youth_activity_rc == "Lab Activity", 1, 0))
d <- d %>%
rename(lab_activity_prop = `Lab Activity`,
creating_product_prop = `Creating Product`)
d <- d %>%
mutate(creating_product = creating_product * 100,
lab_activity = lab_activity * 100)
files <- list.files()[str_detect(list.files(), ".rds")]
l <- files %>%
map(read_rds)
bf_0_1 <- bf(interest ~ 1 +
(1|s|beep_ID_new) +
(1|p|participant_ID) +
(1|q|program_ID))
bf_0_2 <- bf(post_interest ~ 1 +
(1|s|beep_ID_new) +
(1|p|participant_ID) +
(1|q|program_ID))
m0 <- brm(bf_0_1 + bf_0_2,
data = d_for_m2,
chains = 4, cores = 4, iter = 1000)
write_rds(m0, "m0.rds")
l[[1]]
## Family: MV(gaussian, gaussian)
## Links: mu = identity; sigma = identity
## mu = identity; sigma = identity
## Formula: interest ~ 1 + (1 | s | beep_ID_new) + (1 | p | participant_ID) + (1 | q | program_ID)
## post_interest ~ 1 + (1 | p | participant_ID) + (1 | q | program_ID)
## Data: d (Number of observations: 2714)
## Samples: 8 chains, each with iter = 750; warmup = 375; thin = 1;
## total post-warmup samples = 3000
##
## Group-Level Effects:
## ~beep_ID_new (Number of levels: 248)
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## sd(interest_Intercept) 0.21 0.02 0.16 0.25 1.02 642
## Tail_ESS
## sd(interest_Intercept) 1295
##
## ~participant_ID (Number of levels: 180)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.62 0.04 0.55
## sd(postinterest_Intercept) 0.82 0.04 0.74
## cor(interest_Intercept,postinterest_Intercept) 0.28 0.08 0.11
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.70 1.01 453 1153
## sd(postinterest_Intercept) 0.91 1.03 240 460
## cor(interest_Intercept,postinterest_Intercept) 0.41 1.06 133 154
##
## ~program_ID (Number of levels: 9)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.13 0.09 0.01
## sd(postinterest_Intercept) 0.58 0.23 0.30
## cor(interest_Intercept,postinterest_Intercept) 0.02 0.51 -0.89
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.35 1.03 164 488
## sd(postinterest_Intercept) 1.10 1.03 306 472
## cor(interest_Intercept,postinterest_Intercept) 0.88 1.08 85 243
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## interest_Intercept 2.87 0.07 2.73 3.02 1.01 423
## postinterest_Intercept 3.07 0.21 2.65 3.47 1.01 549
## Tail_ESS
## interest_Intercept 642
## postinterest_Intercept 992
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma_interest 0.83 0.01 0.81 0.85 1.00 2176 1959
## sigma_postinterest 0.07 0.00 0.06 0.07 1.00 2465 1904
##
## Residual Correlations:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## rescor(interest,postinterest) 0.06 0.02 0.03 0.10 1.00
## Bulk_ESS Tail_ESS
## rescor(interest,postinterest) 2448 2229
##
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample
## is a crude measure of effective sample size, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
bf_1 <- bf(interest ~ 1 +
# challenge +
# relevance +
gender_female +
pre_interest +
# creating_product +
# lab_activity +
(1|s|beep_ID_new) +
(1|p|participant_ID))
bf_2 <- bf(post_interest ~ 1 +
prop_attend +
gender_female +
pre_interest +
# lab_activity_prop +
# creating_product_prop +
(1|p|participant_ID))
m1 <- brm(bf_1 + bf_2,
data = d,
chains = 8, cores = 8, iter = 1000)
write_rds(m1, 'm1mb.rds')
l[[3]]
## Family: MV(gaussian, gaussian)
## Links: mu = identity; sigma = identity
## mu = identity; sigma = identity
## Formula: interest ~ 1 + gender_female + pre_interest + (1 | s | beep_ID_new) + (1 | p | participant_ID)
## post_interest ~ 1 + prop_attend + gender_female + pre_interest + (1 | p | participant_ID)
## Data: d (Number of observations: 2662)
## Samples: 8 chains, each with iter = 750; warmup = 375; thin = 1;
## total post-warmup samples = 3000
##
## Group-Level Effects:
## ~beep_ID_new (Number of levels: 248)
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## sd(interest_Intercept) 0.20 0.03 0.15 0.25 1.01 1095
## Tail_ESS
## sd(interest_Intercept) 1779
##
## ~participant_ID (Number of levels: 176)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.63 0.04 0.56
## sd(postinterest_Intercept) 0.78 0.04 0.71
## cor(interest_Intercept,postinterest_Intercept) 0.20 0.08 0.03
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.71 1.00 923 1570
## sd(postinterest_Intercept) 0.87 1.01 398 642
## cor(interest_Intercept,postinterest_Intercept) 0.34 1.07 101 374
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## interest_Intercept 2.55 0.19 2.18 2.94 1.02 674
## postinterest_Intercept 1.17 0.42 0.30 1.95 1.04 159
## interest_gender_female -0.09 0.10 -0.29 0.11 1.02 474
## interest_pre_interest 0.11 0.06 -0.00 0.22 1.02 707
## postinterest_prop_attend 0.38 0.40 -0.41 1.17 1.06 148
## postinterest_gender_female -0.09 0.12 -0.32 0.15 1.05 122
## postinterest_pre_interest 0.55 0.07 0.41 0.68 1.04 176
## Tail_ESS
## interest_Intercept 1226
## postinterest_Intercept 187
## interest_gender_female 626
## interest_pre_interest 1245
## postinterest_prop_attend 146
## postinterest_gender_female 220
## postinterest_pre_interest 444
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma_interest 0.83 0.01 0.81 0.86 1.00 4191 2476
## sigma_postinterest 0.07 0.00 0.07 0.07 1.01 4691 2302
##
## Residual Correlations:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## rescor(interest,postinterest) 0.06 0.02 0.02 0.10 1.01
## Bulk_ESS Tail_ESS
## rescor(interest,postinterest) 5249 1911
##
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample
## is a crude measure of effective sample size, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
bf_1 <- bf(interest ~ 1 +
challenge +
relevance +
gender_female +
pre_interest +
# creating_product +
# lab_activity +
(1|s|beep_ID_new) +
(1|p|participant_ID))
bf_2 <- bf(post_interest ~ 1 +
prop_attend +
gender_female +
pre_interest +
# lab_activity_prop +
# creating_product_prop +
(1|p|participant_ID))
m2 <- brm(bf_1 + bf_2,
data = d,
chains = 8, cores = 8, iter = 1000)
write_rds(m2, 'm2mb.rds')
l[[5]]
## Family: MV(gaussian, gaussian)
## Links: mu = identity; sigma = identity
## mu = identity; sigma = identity
## Formula: interest ~ 1 + challenge + relevance + gender_female + pre_interest + (1 | s | beep_ID_new) + (1 | p | participant_ID)
## post_interest ~ 1 + prop_attend + gender_female + pre_interest + (1 | p | participant_ID)
## Data: d (Number of observations: 2662)
## Samples: 8 chains, each with iter = 750; warmup = 375; thin = 1;
## total post-warmup samples = 3000
##
## Group-Level Effects:
## ~beep_ID_new (Number of levels: 248)
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## sd(interest_Intercept) 0.18 0.02 0.14 0.23 1.01 841
## Tail_ESS
## sd(interest_Intercept) 1383
##
## ~participant_ID (Number of levels: 176)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.32 0.03 0.27
## sd(postinterest_Intercept) 0.78 0.04 0.69
## cor(interest_Intercept,postinterest_Intercept) 0.28 0.10 0.07
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.37 1.00 1224 2090
## sd(postinterest_Intercept) 0.87 1.04 259 523
## cor(interest_Intercept,postinterest_Intercept) 0.46 1.09 84 305
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## interest_Intercept 0.97 0.12 0.73 1.22 1.01 1353
## postinterest_Intercept 1.20 0.38 0.43 1.91 1.03 209
## interest_challenge 0.05 0.02 0.01 0.08 1.00 2492
## interest_relevance 0.60 0.02 0.56 0.64 1.00 2433
## interest_gender_female 0.06 0.06 -0.06 0.17 1.00 1037
## interest_pre_interest 0.07 0.03 0.00 0.13 1.01 1162
## postinterest_prop_attend 0.34 0.37 -0.37 1.07 1.04 217
## postinterest_gender_female -0.09 0.12 -0.32 0.14 1.06 115
## postinterest_pre_interest 0.55 0.07 0.42 0.67 1.04 220
## Tail_ESS
## interest_Intercept 2031
## postinterest_Intercept 336
## interest_challenge 2568
## interest_relevance 2488
## interest_gender_female 1520
## interest_pre_interest 1676
## postinterest_prop_attend 545
## postinterest_gender_female 337
## postinterest_pre_interest 513
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma_interest 0.75 0.01 0.73 0.77 1.00 3410 2387
## sigma_postinterest 0.07 0.00 0.07 0.07 1.00 4712 2263
##
## Residual Correlations:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## rescor(interest,postinterest) 0.04 0.02 0.00 0.09 1.00
## Bulk_ESS Tail_ESS
## rescor(interest,postinterest) 4607 2305
##
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample
## is a crude measure of effective sample size, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
bf_1 <- bf(interest ~ 1 +
challenge +
relevance +
gender_female +
pre_interest +
creating_product +
lab_activity +
(1|s|beep_ID_new) +
(1|p|participant_ID))
bf_2 <- bf(post_interest ~ 1 +
prop_attend +
gender_female +
pre_interest +
# lab_activity_prop +
# creating_product_prop +
(1|p|participant_ID))
m3 <- brm(bf_1 + bf_2,
data = d,
chains = 8, cores = 8, iter = 1000)
write_rds(m3, 'm3mb.rds')
l[[7]]
## Family: MV(gaussian, gaussian)
## Links: mu = identity; sigma = identity
## mu = identity; sigma = identity
## Formula: interest ~ 1 + challenge + relevance + gender_female + pre_interest + creating_product + lab_activity + (1 | s | beep_ID_new) + (1 | p | participant_ID)
## post_interest ~ 1 + prop_attend + gender_female + pre_interest + (1 | p | participant_ID)
## Data: d (Number of observations: 2527)
## Samples: 8 chains, each with iter = 750; warmup = 375; thin = 1;
## total post-warmup samples = 3000
##
## Group-Level Effects:
## ~beep_ID_new (Number of levels: 235)
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## sd(interest_Intercept) 0.19 0.03 0.14 0.24 1.09 67
## Tail_ESS
## sd(interest_Intercept) 88
##
## ~participant_ID (Number of levels: 176)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.28 0.11 0.00
## sd(postinterest_Intercept) 0.77 0.04 0.70
## cor(interest_Intercept,postinterest_Intercept) 0.13 0.37 -0.93
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.37 1.30 22 24
## sd(postinterest_Intercept) 0.86 1.02 280 573
## cor(interest_Intercept,postinterest_Intercept) 0.46 1.42 17 27
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## interest_Intercept 0.97 0.13 0.73 1.23 1.06 103
## postinterest_Intercept 1.17 0.36 0.48 1.89 1.04 324
## interest_challenge 0.05 0.02 0.01 0.08 1.01 894
## interest_relevance 0.59 0.03 0.54 0.66 1.26 24
## interest_gender_female 0.06 0.06 -0.06 0.18 1.02 850
## interest_pre_interest 0.07 0.03 0.01 0.13 1.02 882
## interest_creating_product -0.00 0.05 -0.10 0.10 1.01 1099
## interest_lab_activity 0.06 0.11 -0.14 0.28 1.04 160
## postinterest_prop_attend 0.36 0.36 -0.34 1.08 1.04 322
## postinterest_gender_female -0.07 0.11 -0.28 0.15 1.03 337
## postinterest_pre_interest 0.55 0.06 0.42 0.67 1.03 318
## Tail_ESS
## interest_Intercept 1168
## postinterest_Intercept 701
## interest_challenge 1125
## interest_relevance 25
## interest_gender_female 903
## interest_pre_interest 1367
## interest_creating_product 1741
## interest_lab_activity 945
## postinterest_prop_attend 666
## postinterest_gender_female 622
## postinterest_pre_interest 611
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma_interest 0.75 0.02 0.73 0.81 1.30 21 23
## sigma_postinterest 0.07 0.00 0.06 0.07 1.01 2788 1599
##
## Residual Correlations:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## rescor(interest,postinterest) 0.05 0.02 0.01 0.09 1.00
## Bulk_ESS Tail_ESS
## rescor(interest,postinterest) 1950 1540
##
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample
## is a crude measure of effective sample size, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
bf_1 <- bf(interest ~ 1 +
challenge +
relevance +
gender_female +
pre_interest +
creating_product +
lab_activity +
(1|s|beep_ID_new) +
(1|p|participant_ID))
bf_2 <- bf(post_interest ~ 1 +
prop_attend +
gender_female +
pre_interest +
lab_activity_prop +
creating_product_prop +
(1|p|participant_ID))
m4 <- brm(bf_1 + bf_2,
data = d,
chains = 8, cores = 8, iter = 1000)
write_rds(m4, 'm4mb.rds')
l[[8]]
## Family: MV(gaussian, gaussian)
## Links: mu = identity; sigma = identity
## mu = identity; sigma = identity
## Formula: interest ~ 1 + challenge + relevance + gender_female + pre_interest + creating_product + lab_activity + (1 | s | beep_ID_new) + (1 | p | participant_ID)
## post_interest ~ 1 + prop_attend + gender_female + pre_interest + lab_activity_prop + creating_product_prop + (1 | p | participant_ID)
## Data: d (Number of observations: 2527)
## Samples: 8 chains, each with iter = 750; warmup = 375; thin = 1;
## total post-warmup samples = 3000
##
## Group-Level Effects:
## ~beep_ID_new (Number of levels: 235)
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## sd(interest_Intercept) 0.19 0.02 0.14 0.23 1.00 983
## Tail_ESS
## sd(interest_Intercept) 1812
##
## ~participant_ID (Number of levels: 176)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.32 0.03 0.27
## sd(postinterest_Intercept) 0.76 0.04 0.68
## cor(interest_Intercept,postinterest_Intercept) 0.28 0.09 0.10
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.37 1.00 1343 2189
## sd(postinterest_Intercept) 0.84 1.01 547 1076
## cor(interest_Intercept,postinterest_Intercept) 0.44 1.02 218 392
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## interest_Intercept 0.98 0.13 0.73 1.24 1.01
## postinterest_Intercept 1.06 0.38 0.32 1.83 1.02
## interest_challenge 0.05 0.02 0.02 0.09 1.00
## interest_relevance 0.58 0.02 0.54 0.63 1.00
## interest_gender_female 0.06 0.06 -0.06 0.17 1.01
## interest_pre_interest 0.07 0.03 0.01 0.14 1.01
## interest_creating_product 0.00 0.05 -0.10 0.11 1.00
## interest_lab_activity 0.06 0.11 -0.15 0.27 1.00
## postinterest_prop_attend 0.39 0.37 -0.33 1.12 1.01
## postinterest_gender_female -0.09 0.12 -0.33 0.13 1.03
## postinterest_pre_interest 0.44 0.07 0.31 0.58 1.02
## postinterest_lab_activity_prop 0.07 0.02 0.03 0.12 1.02
## postinterest_creating_product_prop 0.01 0.01 0.00 0.03 1.02
## Bulk_ESS Tail_ESS
## interest_Intercept 1438 2004
## postinterest_Intercept 355 574
## interest_challenge 3643 2768
## interest_relevance 2652 2604
## interest_gender_female 1389 1843
## interest_pre_interest 1385 1634
## interest_creating_product 2643 2649
## interest_lab_activity 2877 2163
## postinterest_prop_attend 470 779
## postinterest_gender_female 351 568
## postinterest_pre_interest 397 805
## postinterest_lab_activity_prop 388 611
## postinterest_creating_product_prop 376 641
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma_interest 0.75 0.01 0.73 0.77 1.00 3123 2240
## sigma_postinterest 0.07 0.00 0.06 0.07 1.00 5352 2034
##
## Residual Correlations:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## rescor(interest,postinterest) 0.05 0.02 0.00 0.09 1.00
## Bulk_ESS Tail_ESS
## rescor(interest,postinterest) 5064 2308
##
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample
## is a crude measure of effective sample size, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
bf_1 <- bf(interest ~ 1 +
challenge +
relevance +
gender_female +
pre_interest +
creating_product +
lab_activity +
(1|s|beep_ID_new) +
(1|q|program_ID))
bf_2 <- bf(post_interest ~ 1 +
prop_attend +
gender_female +
pre_interest +
lab_activity_prop +
creating_product_prop +
(1|s|beep_ID_new) +
(1|p|participant_ID) +
(1|q|program_ID))
m1 <- brm(bf_1 + bf_2,
data = d_for_m2,
chains = 4, cores = 4, iter = 1000)
write_rds(m4, 'm1.rds')
Should probably add this to all the previous “mb” models
l[[4]]
## Family: MV(gaussian, gaussian)
## Links: mu = identity; sigma = identity
## mu = identity; sigma = identity
## Formula: interest ~ 1 + challenge + relevance + gender_female + pre_interest + creating_product + lab_activity + (1 | s | beep_ID_new) + (1 | p | participant_ID) + (1 | q | program_ID)
## post_interest ~ 1 + prop_attend + gender_female + pre_interest + lab_activity_prop + creating_product_prop + (1 | p | participant_ID) + (1 | q | program_ID)
## Data: d (Number of observations: 2527)
## Samples: 8 chains, each with iter = 750; warmup = 375; thin = 1;
## total post-warmup samples = 3000
##
## Group-Level Effects:
## ~beep_ID_new (Number of levels: 235)
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## sd(interest_Intercept) 0.18 0.02 0.13 0.22 1.06 90
## Tail_ESS
## sd(interest_Intercept) 1454
##
## ~participant_ID (Number of levels: 176)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.27 0.10 0.00
## sd(postinterest_Intercept) 0.76 0.04 0.68
## cor(interest_Intercept,postinterest_Intercept) 0.14 0.39 -0.98
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.35 1.31 21 25
## sd(postinterest_Intercept) 0.84 1.03 347 846
## cor(interest_Intercept,postinterest_Intercept) 0.45 1.34 20 21
##
## ~program_ID (Number of levels: 9)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.14 0.07 0.04
## sd(postinterest_Intercept) 0.11 0.09 0.00
## cor(interest_Intercept,postinterest_Intercept) -0.03 0.54 -0.94
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.30 1.05 116 880
## sd(postinterest_Intercept) 0.33 1.09 66 63
## cor(interest_Intercept,postinterest_Intercept) 0.91 1.01 892 1319
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## interest_Intercept 0.95 0.14 0.69 1.23 1.04
## postinterest_Intercept 1.07 0.39 0.30 1.76 1.05
## interest_challenge 0.05 0.02 0.01 0.08 1.03
## interest_relevance 0.59 0.03 0.55 0.66 1.27
## interest_gender_female 0.05 0.06 -0.06 0.16 1.02
## interest_pre_interest 0.08 0.04 0.01 0.15 1.03
## interest_creating_product 0.01 0.06 -0.10 0.15 1.06
## interest_lab_activity 0.04 0.10 -0.15 0.24 1.01
## postinterest_prop_attend 0.42 0.36 -0.27 1.11 1.05
## postinterest_gender_female -0.07 0.11 -0.30 0.15 1.02
## postinterest_pre_interest 0.43 0.07 0.29 0.57 1.03
## postinterest_lab_activity_prop 0.08 0.03 0.02 0.13 1.03
## postinterest_creating_product_prop 0.01 0.01 -0.00 0.03 1.02
## Bulk_ESS Tail_ESS
## interest_Intercept 162 1830
## postinterest_Intercept 178 1091
## interest_challenge 223 2394
## interest_relevance 23 24
## interest_gender_female 1311 1541
## interest_pre_interest 250 1466
## interest_creating_product 91 23
## interest_lab_activity 2771 2454
## postinterest_prop_attend 280 860
## postinterest_gender_female 445 609
## postinterest_pre_interest 264 820
## postinterest_lab_activity_prop 513 1078
## postinterest_creating_product_prop 559 998
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma_interest 0.76 0.02 0.73 0.82 1.30 21 24
## sigma_postinterest 0.07 0.00 0.06 0.07 1.01 3371 2030
##
## Residual Correlations:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## rescor(interest,postinterest) 0.05 0.02 0.00 0.09 1.01
## Bulk_ESS Tail_ESS
## rescor(interest,postinterest) 1529 1449
##
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample
## is a crude measure of effective sample size, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
bf_1 <- bf(interest ~ 1 +
challenge +
relevance +
gender_female +
pre_interest +
creating_product +
lab_activity +
(relevance|s|beep_ID_new) +
(1|q|program_ID))
bf_2 <- bf(post_interest ~ 1 +
prop_attend +
gender_female +
pre_interest +
lab_activity_prop +
creating_product_prop +
(1|s|beep_ID_new) +
(1|p|participant_ID) +
(1|q|program_ID))
m2 <- brm(bf_1 + bf_2,
data = d_for_m2,
chains = 4, cores = 4, iter = 1000)
write_rds(m2, 'm2.rds')
l[[6]]
## Family: MV(gaussian, gaussian)
## Links: mu = identity; sigma = identity
## mu = identity; sigma = identity
## Formula: interest ~ 1 + challenge + relevance + gender_female + pre_interest + creating_product + lab_activity + (1 | s | beep_ID_new) + (relevance | p | participant_ID) + (1 | q | program_ID)
## post_interest ~ 1 + prop_attend + gender_female + pre_interest + lab_activity_prop + creating_product_prop + (1 | p | participant_ID) + (1 | q | program_ID)
## Data: d (Number of observations: 2527)
## Samples: 8 chains, each with iter = 750; warmup = 375; thin = 1;
## total post-warmup samples = 3000
##
## Group-Level Effects:
## ~beep_ID_new (Number of levels: 235)
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## sd(interest_Intercept) 0.18 0.02 0.13 0.22 1.00 871
## Tail_ESS
## sd(interest_Intercept) 1064
##
## ~participant_ID (Number of levels: 176)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.66 0.08 0.51
## sd(interest_relevance) 0.19 0.03 0.12
## sd(postinterest_Intercept) 0.75 0.04 0.67
## cor(interest_Intercept,interest_relevance) -0.91 0.03 -0.96
## cor(interest_Intercept,postinterest_Intercept) 0.01 0.13 -0.23
## cor(interest_relevance,postinterest_Intercept) 0.15 0.15 -0.15
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.83 1.00 673 1256
## sd(interest_relevance) 0.25 1.04 203 388
## sd(postinterest_Intercept) 0.84 1.01 638 879
## cor(interest_Intercept,interest_relevance) -0.82 1.03 246 367
## cor(interest_Intercept,postinterest_Intercept) 0.26 1.04 172 348
## cor(interest_relevance,postinterest_Intercept) 0.42 1.08 74 186
##
## ~program_ID (Number of levels: 9)
## Estimate Est.Error l-95% CI
## sd(interest_Intercept) 0.12 0.07 0.01
## sd(postinterest_Intercept) 0.11 0.09 0.00
## cor(interest_Intercept,postinterest_Intercept) 0.09 0.56 -0.93
## u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(interest_Intercept) 0.28 1.04 238 659
## sd(postinterest_Intercept) 0.36 1.03 418 1078
## cor(interest_Intercept,postinterest_Intercept) 0.96 1.01 1037 1460
##
## Population-Level Effects:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## interest_Intercept 1.00 0.14 0.73 1.28 1.01
## postinterest_Intercept 1.01 0.39 0.23 1.78 1.01
## interest_challenge 0.04 0.02 0.01 0.07 1.00
## interest_relevance 0.58 0.03 0.53 0.63 1.02
## interest_gender_female 0.06 0.06 -0.06 0.18 1.01
## interest_pre_interest 0.08 0.04 0.01 0.15 1.01
## interest_creating_product 0.01 0.05 -0.09 0.11 1.00
## interest_lab_activity 0.05 0.10 -0.14 0.26 1.00
## postinterest_prop_attend 0.45 0.37 -0.28 1.20 1.01
## postinterest_gender_female -0.08 0.12 -0.30 0.15 1.02
## postinterest_pre_interest 0.43 0.07 0.28 0.58 1.01
## postinterest_lab_activity_prop 0.08 0.03 0.02 0.14 1.00
## postinterest_creating_product_prop 0.01 0.01 -0.00 0.03 1.00
## Bulk_ESS Tail_ESS
## interest_Intercept 1168 1996
## postinterest_Intercept 800 1336
## interest_challenge 2531 2075
## interest_relevance 977 1642
## interest_gender_female 777 1163
## interest_pre_interest 1312 1245
## interest_creating_product 1741 2040
## interest_lab_activity 1550 2075
## postinterest_prop_attend 649 1014
## postinterest_gender_female 690 955
## postinterest_pre_interest 714 980
## postinterest_lab_activity_prop 818 1054
## postinterest_creating_product_prop 965 1511
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma_interest 0.74 0.01 0.71 0.76 1.01 985 1931
## sigma_postinterest 0.07 0.00 0.06 0.07 1.00 3262 1922
##
## Residual Correlations:
## Estimate Est.Error l-95% CI u-95% CI Rhat
## rescor(interest,postinterest) 0.05 0.02 0.01 0.09 1.01
## Bulk_ESS Tail_ESS
## rescor(interest,postinterest) 2389 1939
##
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample
## is a crude measure of effective sample size, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).