Analyses
R
Bayesian
Code
pacman::p_load(dplyr,purrr,tidyr,tibble,ggplot2,
  brms,tidybayes, rstanarm,emmeans,broom,bayestestR,
  stringr, here,conflicted, patchwork, knitr,kableExtra,ggh4x,ggpattern)

conflict_prefer_all("dplyr", quiet = TRUE)
options(scipen = 999)
walk(c("Display_Functions","fun_alm","fun_indv_fit","fun_model"), ~ source(here::here(paste0("Functions/", .x, ".R"))))

e1 <- readRDS(here("data/e1_08-21-23.rds")) 
e2 <- readRDS(here("data/e2_08-04-23.rds")) 
e3 <- readRDS(here("data/e3_08-04-23.rds")) 

# combine all 3 experiments
d <- rbind(e1,e2,e3)

d <- d |> 
    mutate(trainCon=case_when(
    bandOrder=="Original" ~ "800",
    bandOrder=="Reverse" ~ "600",
    TRUE ~ NA_character_
    ), trainCon=as.numeric(trainCon)) 


nbins=5
train <-  d |> filter(expMode2=="Train") |> group_by(id,condit,fb,bandOrder, vb) |> 
    mutate(Trial_Bin = cut( gt.train, breaks = seq(1, max(gt.train),length.out=nbins+1),include.lowest = TRUE, labels=FALSE)) 
train_max <- train |> filter(Trial_Bin == nbins, bandInt==trainCon)
train_avg <- train_max |> group_by(id,condit,fb,bandOrder) |> summarise(train_end = mean(dist))
train_avg2 <- train_max |> select(id,condit,fb,bandOrder,expMode2,vb,bandInt,dist,vx)

test2 <- d |> filter(expMode2=="Test") |> 
  select(id,condit,fb,bandOrder,expMode2,vb,bandInt,dist,vx) |> 
  rbind(train_avg2) |>
  left_join(train_avg, by=c("id","condit", "fb", "bandOrder")) 

test <- d |> filter(expMode2=="Test") |> left_join(train_avg, by=c("id","condit", "fb", "bandOrder")) |>
  select(id,condit,bandType,bandInt,vb,vx,dist,train_end,fb,bandOrder)

Testing Deviation

Code
d |> filter(expMode2=="Test") |> ggplot(aes(x = vb, y = dist,fill=condit)) +
  stat_bar

Code
d |> filter(expMode2=="Test") |> ggplot(aes(x = condit, y = dist,fill=vb)) +
  stat_bar + facet_wrap(~Exp)

Code
d |> filter(expMode2=="Test") |> ggplot(aes(x = condit, y = dist,fill=vb)) +
  stat_bar + facet_wrap(fb~bandOrder)

Code
k1 <- d |>
  filter(expMode2 == "Test") |>
  group_by(condit, bandType, fb, bandOrder, vb) |>  # No need for 'id' if not used later
  summarise(se_dist = sd(dist) / sqrt(n()),dist = mean(dist))

ep1 <- d |>
  filter(expMode2 == "Test") |>
  group_by(condit, bandType, fb, bandOrder, vb) |>  # No need for 'id' if not used later
  summarise(se_dist = sd(dist) / sqrt(n()),dist = mean(dist)) |>
  ggplot(aes(x = condit, y = dist, fill = vb,
             pattern=bandType,
             pattern_density=0.35,
             pattern_fill=bandType, 
             ppatern_angle=bandType,
            )) +
   geom_bar_pattern(stat = "identity", 
                   # pattern_density=.25,
                    position = position_dodge()) + 
  geom_errorbar(aes(ymin = dist - se_dist, ymax = dist + se_dist),position = position_dodge()) +
  facet_wrap2(~fb*bandOrder,axes="all") +
  labs(title="Testing Deviation",pattern = "Band Type") +
  # scale_pattern_manual(values = c("stripe", "circle"))
  scale_pattern_spacing_discrete(range = c(0.01, 0.05)) 


ep2 <- d |>
  filter(expMode2 == "Test") |>
  group_by(condit, bandType, fb, bandOrder, vb) |>  # No need for 'id' if not used later
  summarise(se_dist = sd(dist) / sqrt(n()),dist = mean(dist)) |>
  ggplot(aes(x = vb, y = dist, fill = condit, pattern=bandType)) +
   geom_bar_pattern(stat = "identity", 
                    
                    position = position_dodge()) + 
  geom_errorbar(aes(ymin = dist - se_dist, ymax = dist + se_dist),position = position_dodge()) +
  facet_wrap2(~fb*bandOrder,axes="all") +
  labs(title="Testing Deviation",pattern = "Band Type") +
   scale_pattern_manual(values = c("stripe", "circle"))

ep1/ep2
Warning: The `scale_name` argument of `discrete_scale()` is deprecated as of ggplot2
3.5.0.
Warning: The `scale_name` argument of `continuous_scale()` is deprecated as of ggplot2
3.5.0.
Warning: The `trans` argument of `continuous_scale()` is deprecated as of ggplot2 3.5.0.
ℹ Please use the `transform` argument instead.

Testing Vx

Code
ep1 <- d |>
  filter(expMode2 == "Test") |>
  group_by(condit, bandType, fb, bandOrder, vb) |>  # No need for 'id' if not used later
  summarise(se_vx = sd(vx) / sqrt(n()),vx = mean(vx)) |>
  ggplot(aes(x = condit, y = vx, fill = vb, pattern=bandType)) +
   geom_bar_pattern(stat = "identity", 
                    position = position_dodge()) + 
  geom_errorbar(aes(ymin = vx - se_vx, ymax = vx + se_vx),position = position_dodge()) +
  facet_wrap2(~fb*bandOrder,axes="all") +
  labs(title="Testing Vx",pattern = "Band Type") +
   scale_pattern_manual(values = c("stripe", "circle"))


ep2 <- d |>
  filter(expMode2 == "Test") |>
  group_by(condit, bandType, fb, bandOrder, vb) |>  # No need for 'id' if not used later
  summarise(se_vx = sd(vx) / sqrt(n()),vx = mean(vx)) |>
  ggplot(aes(x = vb, y = vx, fill = condit, pattern=bandType)) +
   geom_bar_pattern(stat = "identity", 
                    position = position_dodge()) + 
  geom_errorbar(aes(ymin = vx - se_vx, ymax = vx + se_vx),position = position_dodge()) +
  facet_wrap2(~fb*bandOrder,axes="all") +
  labs(title="Testing Vx",pattern = "Band Type") +
   scale_pattern_manual(values = c("stripe", "circle"))

ep1/ep2

Control for end of training performance

Code
test|> group_by(id,condit) |> pivot_longer(c("dist","train_end"),names_to="var",values_to="value") |> 
  ggplot(aes(x=var,y=value, fill=condit)) + stat_bar + facet_wrap(~var)

Code
test2 |> ggplot(aes(x=bandInt,y=dist,fill=expMode2)) + stat_bar + facet_wrap(~condit+fb+bandOrder)

Code
test2 |> mutate(train_end_q = ntile(train_end,4)) |>  
  ggplot(aes(x=bandInt,y=dist,fill=expMode2)) + stat_bar + facet_wrap(~condit+train_end_q+bandOrder)

Code
test2 |> mutate(train_end_q = ntile(train_end,4)) |>  
  ggplot(aes(x=condit,y=dist,fill=vb)) + stat_bar + 
  facet_wrap(~expMode2+train_end_q+bandOrder,scales="free")

Code
test2 |> mutate(train_end_q = ntile(train_end,4)) |>  
  ggplot(aes(x=vb,y=dist,fill=condit)) + stat_bar + 
  facet_wrap(~expMode2+train_end_q+bandOrder,scales="free")

Code
test2 |> mutate(train_end_q = ntile(train_end,4)) |>  
  ggplot(aes(x=train_end_q,y=dist,fill=condit)) + stat_bar + 
  facet_wrap(~expMode2+vb+bandOrder,scales="free")

Code
test |> ggplot(aes(x=train_end,y=dist,fill=condit)) + 
  stat_summary(geom = "line", position=position_dodge(), fun = mean) +
    stat_summary(geom = "errorbar", position=position_dodge(.9), fun.data = mean_se, width = .4, alpha = .7) + 
    facet_wrap(~vb) +
  labs(x="Band", y="Deviation From Target")
Warning: Width not defined
ℹ Set with `position_dodge(width = ...)`
Warning: `position_dodge()` requires non-overlapping x intervals.
`position_dodge()` requires non-overlapping x intervals.
`position_dodge()` requires non-overlapping x intervals.
`position_dodge()` requires non-overlapping x intervals.
`position_dodge()` requires non-overlapping x intervals.
`position_dodge()` requires non-overlapping x intervals.

Code
test |> filter(bandType=="Extrapolation") |>
  ggplot(aes(x=train_end,y=dist,fill=condit,col=condit)) + 
  #geom_point() +
  geom_smooth(method="loess") +
    facet_nested_wrap(~bandOrder+vb+fb) +
  labs(x="Band", y="Deviation From Target")
`geom_smooth()` using formula = 'y ~ x'

Code
test |> filter(bandType=="Extrapolation") |>
  ggplot(aes(x=train_end,y=dist,fill=condit,col=condit)) + 
  #geom_point() +
  geom_smooth() +
    facet_nested_wrap(~bandOrder+vb+fb) +
  labs(x="Band", y="Deviation From Target")
`geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'

Code
test |> filter(bandType=="Extrapolation") |>
  ggplot(aes(x=train_end,y=dist,fill=condit,col=condit)) + 
  #geom_point() +
  geom_smooth(method="lm") +
    facet_nested_wrap(~bandOrder+vb) +
  labs(x="Band", y="Deviation From Target")
`geom_smooth()` using formula = 'y ~ x'

Code
# create quartiles for train_end
test |> group_by(condit,vb,fb,bandOrder) |>  filter(bandType=="Extrapolation") |>
  mutate(train_end_q = ntile(train_end,4)) |> 
  ggplot(aes(x=train_end_q,y=dist,fill=condit)) + 
 stat_bar + 
    ggh4x::facet_wrap2(bandOrder~vb~fb) +
  labs(x="quartile", y="Deviation From Target")

Code
test |> group_by(condit,vb,fb,bandOrder) |>  #filter(bandType=="Extrapolation") |>
  mutate(train_end_q = ntile(train_end,4)) |> 
  ggplot(aes(x=condit,y=vx,fill=vb)) +
  stat_bar + 
    ggh4x::facet_wrap2(~train_end_q+bandOrder+fb) 

dist ~ condit * fb * bandOrder * bandInt + (1 + bandInt | id)

Code
# dist ~ condit * fb * bandOrder * bandInt + (1 + bandInt | id)
bmm_combo_testDistBand <- readRDS(paste0(here::here("data/model_cache","combo_testDistBand_RF_5k.rds")))

mted1 <- as.data.frame(describe_posterior(bmm_combo_testDistBand, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted1) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted1 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testDistBand$formula[1]))
dist ~ condit * fb * bandOrder * bandInt + (1 + bandInt | id)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 205.97 147.49 267.42 1.00
conditVaried 157.04 68.71 240.80 1.00
fbOrdinal 138.32 43.63 240.16 1.00
bandOrderReverse -54.71 -153.03 40.96 0.86
bandInt 0.01 -0.06 0.07 0.58
conditVaried:fbOrdinal -152.04 -301.04 -12.59 0.98
conditVaried:bandOrderReverse -225.89 -366.28 -84.64 1.00
fbOrdinal:bandOrderReverse -13.77 -163.82 130.61 0.57
conditVaried:bandInt -0.16 -0.25 -0.06 1.00
fbOrdinal:bandInt -0.14 -0.25 -0.03 1.00
bandOrderReverse:bandInt 0.10 -0.01 0.20 0.96
conditVaried:fbOrdinal:bandOrderReverse 46.25 -163.02 268.66 0.65
conditVaried:fbOrdinal:bandInt 0.16 0.00 0.32 0.98
conditVaried:bandOrderReverse:bandInt 0.28 0.13 0.44 1.00
fbOrdinal:bandOrderReverse:bandInt 0.02 -0.14 0.18 0.60
conditVaried:fbOrdinal:bandOrderReverse:bandInt -0.10 -0.35 0.13 0.79
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testDistBand),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)

vx ~ condit * fb * bandOrder * bandInt + (1 + bandInt | id)

Code
# vx ~ condit * fb * bandOrder * bandInt + (1 + bandInt | id)
bmm_combo_testVxBand<- readRDS(paste0(here::here("data/model_cache","combo_testVxBand_RF_5K.rds")))

mted2 <- as.data.frame(describe_posterior(bmm_combo_testVxBand, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted2) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted2 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testVxBand$formula[1]))
vx ~ condit * fb * bandOrder * bandInt + (1 + bandInt | id)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 415.31 333.21 494.51 1.00
conditVaried 163.41 45.67 275.80 1.00
fbOrdinal 186.14 59.22 314.65 1.00
bandOrderReverse -53.30 -173.43 68.10 0.81
bandInt 0.71 0.61 0.81 1.00
conditVaried:fbOrdinal -147.56 -329.93 41.42 0.94
conditVaried:bandOrderReverse -169.21 -340.18 11.54 0.97
fbOrdinal:bandOrderReverse 63.60 -117.65 242.70 0.76
conditVaried:bandInt -0.14 -0.29 0.00 0.97
fbOrdinal:bandInt -0.22 -0.39 -0.06 1.00
bandOrderReverse:bandInt 0.00 -0.15 0.15 0.51
conditVaried:fbOrdinal:bandOrderReverse -169.57 -438.52 93.73 0.90
conditVaried:fbOrdinal:bandInt 0.09 -0.15 0.32 0.78
conditVaried:bandOrderReverse:bandInt 0.08 -0.13 0.30 0.78
fbOrdinal:bandOrderReverse:bandInt -0.09 -0.33 0.13 0.80
conditVaried:fbOrdinal:bandOrderReverse:bandInt 0.34 0.01 0.68 0.98
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testVxBand),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)

dist ~ condit * bandType * bandOrder * fb + (1 + bandType | id)

Code
# dist ~ condit * bandType * bandOrder * fb + (1 + bandType | id)
bmm_combo_testBT_dist<- readRDS(paste0(here::here("data/model_cache/brms","combo_TeDistBt_test6__4_5000_0.93_12_Bt_test6_1537.rds")))

mted4 <- as.data.frame(describe_posterior(bmm_combo_testBT_dist, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted4) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted4 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testBT_dist$formula[1]))
dist ~ condit * bandType * bandOrder * fb + (1 + bandType | id)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 186.62 150.21 222.49 1.00
conditVaried 39.03 -9.09 88.02 0.94
bandTypeExtrapolation 23.83 -19.81 68.55 0.85
bandOrderReverse -2.40 -58.78 55.98 0.53
fbOrdinal 41.49 -17.95 100.89 0.91
conditVaried:bandTypeExtrapolation 54.72 -6.85 115.38 0.96
conditVaried:bandOrderReverse -73.30 -149.35 1.68 0.97
bandTypeExtrapolation:bandOrderReverse 31.52 -39.14 104.13 0.80
conditVaried:fbOrdinal -34.88 -114.89 47.95 0.80
bandTypeExtrapolation:fbOrdinal 26.82 -46.39 98.89 0.77
bandOrderReverse:fbOrdinal -70.56 -154.91 14.86 0.95
conditVaried:bandTypeExtrapolation:bandOrderReverse 51.22 -45.23 146.02 0.85
conditVaried:bandTypeExtrapolation:fbOrdinal -41.83 -145.96 62.54 0.79
conditVaried:bandOrderReverse:fbOrdinal 70.87 -45.83 183.42 0.89
bandTypeExtrapolation:bandOrderReverse:fbOrdinal 36.67 -66.72 139.66 0.75
conditVaried:bandTypeExtrapolation:bandOrderReverse:fbOrdinal -76.72 -221.77 71.82 0.85
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testBT_dist),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)

dist ~ condit * bandType * bandOrder * fb + (1 | id) + (1 | bandInt)

Code
# dist ~ condit * bandType * bandOrder * fb + (1 | id) + (1 | bandInt)
bmm_combo_testBT_dist3<- readRDS(paste0(here::here("data/model_cache/brms","combo_TeDistBand_test6_RF_2_2_8000_0.94_13_Band_test6_RF_21817.rds")))

mted7 <- as.data.frame(describe_posterior(bmm_combo_testBT_dist3, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted7) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted7 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testBT_dist3$formula[1]))
dist ~ condit * bandType * bandOrder * fb + (1 | id) + (1 | bandInt)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 219.02 150.88 288.15 1.00
conditVaried -2.12 -52.80 47.57 0.53
bandTypeExtrapolation -9.66 -35.89 16.09 0.77
bandOrderReverse 29.28 -30.80 89.14 0.83
fbOrdinal 40.26 -19.25 99.48 0.91
conditVaried:bandTypeExtrapolation 101.40 72.52 130.37 1.00
conditVaried:bandOrderReverse -89.61 -168.58 -13.13 0.99
bandTypeExtrapolation:bandOrderReverse -11.29 -53.56 31.35 0.70
conditVaried:fbOrdinal -33.43 -118.57 52.94 0.78
bandTypeExtrapolation:fbOrdinal 27.05 -10.96 65.49 0.92
bandOrderReverse:fbOrdinal -68.09 -156.41 17.84 0.94
conditVaried:bandTypeExtrapolation:bandOrderReverse 64.61 19.80 109.63 1.00
conditVaried:bandTypeExtrapolation:fbOrdinal -42.78 -89.10 3.82 0.96
conditVaried:bandOrderReverse:fbOrdinal 65.56 -53.40 183.10 0.87
bandTypeExtrapolation:bandOrderReverse:fbOrdinal 34.46 -19.89 88.51 0.89
conditVaried:bandTypeExtrapolation:bandOrderReverse:fbOrdinal -69.97 -135.85 -3.96 0.98
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testBT_dist3),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)

dist ~ condit * bandType * bandOrder * fb + (1 | id) + (1 | bandInt)

Code
# dist ~ condit * bandType * bandOrder * fb + (1 | id) + (1 | bandInt)
bmm_combo_testBT_dist2<- readRDS(paste0(here::here("data/model_cache/brms","combo_TeDistBand_test6_RF_2_4_5000_0.94_14_Band_test6_RF_25437.rds")))

mted5 <- as.data.frame(describe_posterior(bmm_combo_testBT_dist2, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted5) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted5 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testBT_dist2$formula[1]))
dist ~ condit * bandType * bandOrder * fb + (1 | id) + (1 | bandInt)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 218.19 143.92 288.36 1.00
conditVaried -1.11 -51.46 48.60 0.52
bandTypeExtrapolation -9.24 -35.42 17.02 0.76
bandOrderReverse 30.19 -28.56 86.72 0.84
fbOrdinal 41.44 -16.83 100.84 0.92
conditVaried:bandTypeExtrapolation 101.14 72.70 129.45 1.00
conditVaried:bandOrderReverse -91.21 -165.93 -13.21 0.99
bandTypeExtrapolation:bandOrderReverse -12.11 -53.77 29.59 0.72
conditVaried:fbOrdinal -33.01 -113.59 46.80 0.79
bandTypeExtrapolation:fbOrdinal 26.60 -11.27 64.33 0.92
bandOrderReverse:fbOrdinal -70.04 -154.19 13.95 0.95
conditVaried:bandTypeExtrapolation:bandOrderReverse 65.30 20.37 110.21 1.00
conditVaried:bandTypeExtrapolation:fbOrdinal -42.23 -88.30 3.79 0.96
conditVaried:bandOrderReverse:fbOrdinal 65.45 -54.03 181.29 0.87
bandTypeExtrapolation:bandOrderReverse:fbOrdinal 35.32 -18.02 89.89 0.90
conditVaried:bandTypeExtrapolation:bandOrderReverse:fbOrdinal -70.89 -137.60 -4.83 0.98
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testBT_dist2),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)

dist ~ condit * bandType * bandOrder * fb + (1 | id * bandInt)

Code
# dist ~ condit * bandType * bandOrder * fb + (1 | id * bandInt)
bmm_combo_testBT_dist4<- readRDS(paste0(here::here("data/model_cache/brms","combo_TeDistBt_test6_RF_int_2_8000_0.94_13_Bt_test6_RF_int4808.rds")))

mted9 <- as.data.frame(describe_posterior(bmm_combo_testBT_dist4, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted9) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted9 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testBT_dist4$formula[1]))
dist ~ condit * bandType * bandOrder * fb + (1 | id * bandInt)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 213.95 138.03 285.77 1.00
conditVaried 1.57 -52.63 57.54 0.51
bandTypeExtrapolation 1.25 -43.39 46.38 0.52
bandOrderReverse 26.73 -47.18 99.90 0.76
fbOrdinal 40.87 -28.66 110.50 0.88
conditVaried:bandTypeExtrapolation 91.75 40.69 142.93 1.00
conditVaried:bandOrderReverse -86.93 -171.08 -1.71 0.98
bandTypeExtrapolation:bandOrderReverse -21.29 -92.94 50.87 0.71
conditVaried:fbOrdinal -32.89 -120.92 55.22 0.77
bandTypeExtrapolation:fbOrdinal 13.60 -48.78 76.13 0.66
bandOrderReverse:fbOrdinal -71.63 -171.52 31.15 0.92
conditVaried:bandTypeExtrapolation:bandOrderReverse 73.15 -5.64 152.36 0.97
conditVaried:bandTypeExtrapolation:fbOrdinal -30.15 -110.05 48.97 0.77
conditVaried:bandOrderReverse:fbOrdinal 69.36 -56.34 192.48 0.86
bandTypeExtrapolation:bandOrderReverse:fbOrdinal 67.39 -23.76 157.12 0.93
conditVaried:bandTypeExtrapolation:bandOrderReverse:fbOrdinal -102.77 -215.69 10.23 0.96
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testBT_dist4),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)

dist ~ condit * bandType * bandOrder * fb + bandInt + (1 | id)

Code
# dist ~ condit * bandType * bandOrder * fb + (1 | id) + (1 | bandInt)
bmm_combo_testBT_dist3<- readRDS(paste0(here::here("data/model_cache/brms","combo_TeDistBand_test6_fixBandInt_RF_1_4_5000_0.94_14_Band_test6_fixBandInt_RF_10858.rds")))

mted5 <- as.data.frame(describe_posterior(bmm_combo_testBT_dist3, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted5) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted5 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testBT_dist3$formula[1]))
dist ~ condit * bandType * bandOrder * fb + bandInt + (1 | id)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 207.20 168.97 245.78 1.00
conditVaried 42.62 -6.68 91.45 0.96
bandTypeExtrapolation 16.24 -7.68 40.81 0.90
bandOrderReverse -10.08 -68.95 49.91 0.64
fbOrdinal 39.23 -20.79 97.66 0.90
bandInt -0.02 -0.03 -0.01 1.00
conditVaried:bandTypeExtrapolation 45.25 16.68 74.29 1.00
conditVaried:bandOrderReverse -80.96 -158.95 -2.68 0.98
bandTypeExtrapolation:bandOrderReverse 45.64 7.41 84.36 0.99
conditVaried:fbOrdinal -30.79 -110.29 49.26 0.77
bandTypeExtrapolation:fbOrdinal 27.26 -10.81 66.45 0.92
bandOrderReverse:fbOrdinal -66.90 -154.53 19.05 0.93
conditVaried:bandTypeExtrapolation:bandOrderReverse 67.94 23.37 113.09 1.00
conditVaried:bandTypeExtrapolation:fbOrdinal -42.98 -91.17 3.58 0.96
conditVaried:bandOrderReverse:fbOrdinal 63.08 -54.57 182.68 0.85
bandTypeExtrapolation:bandOrderReverse:fbOrdinal 35.08 -22.23 90.81 0.89
conditVaried:bandTypeExtrapolation:bandOrderReverse:fbOrdinal -70.38 -138.05 -1.13 0.98
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testBT_dist3),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)

vx ~ condit * bandType * bandOrder * fb + (1 + bandType | id)

Code
# vx ~ condit * bandType * bandOrder * fb + (1 + bandType | id)
bmm_combo_testBT<- readRDS(paste0(here::here("data/model_cache/brms","combo_TeVxBt_test6__4_5000_0.93_12_Bt_test6_3033.rds")))

mted3 <- as.data.frame(describe_posterior(bmm_combo_testBT, centrality = "Mean"))[, c(1,2,4,5,6)]
colnames(mted3) <- c("Term", "Estimate","95% CrI Lower", "95% CrI Upper", "pd")

mted3 |> mutate(across(where(is.numeric), \(x) round(x, 2))) |>
  tibble::remove_rownames() |> 
  mutate(Term = stringr::str_remove(Term, "b_")) |> kable(booktabs = TRUE, caption=(bmm_combo_testBT$formula[1]))
vx ~ condit * bandType * bandOrder * fb + (1 + bandType | id)
Term Estimate 95% CrI Lower 95% CrI Upper pd
Intercept 1006.75 947.60 1067.18 1.00
conditVaried 167.24 84.29 249.31 1.00
bandTypeExtrapolation -241.09 -309.10 -173.08 1.00
bandOrderReverse -274.23 -368.69 -179.03 1.00
fbOrdinal 4.84 -92.33 98.77 0.54
conditVaried:bandTypeExtrapolation -161.31 -253.24 -71.39 1.00
conditVaried:bandOrderReverse -337.34 -465.68 -209.79 1.00
bandTypeExtrapolation:bandOrderReverse 470.18 363.86 575.32 1.00
conditVaried:fbOrdinal -118.92 -251.26 16.32 0.96
bandTypeExtrapolation:fbOrdinal 71.23 -35.26 177.28 0.91
bandOrderReverse:fbOrdinal 38.34 -100.45 179.61 0.71
conditVaried:bandTypeExtrapolation:bandOrderReverse 387.75 243.41 529.99 1.00
conditVaried:bandTypeExtrapolation:fbOrdinal 43.02 -105.25 191.99 0.71
conditVaried:bandOrderReverse:fbOrdinal 41.08 -152.15 237.75 0.66
bandTypeExtrapolation:bandOrderReverse:fbOrdinal -128.62 -284.77 27.32 0.94
conditVaried:bandTypeExtrapolation:bandOrderReverse:fbOrdinal 102.72 -118.70 318.92 0.82
Code
ce_bmm1 <- plot(conditional_effects(bmm_combo_testBT),points=FALSE,plot=FALSE)
wrap_plots(ce_bmm1)