That’s how far I’ve come:
Here my data
my_data <- structure(list(Material = c("Flint", "Flint", "Flint", "Flint", "Flint", "Flint", "Flint", "Quartzite", "Quartzite", "Quartzite", "Quartzite", "Quartzite", "Quartzite", "Quartzite", "Quartzite"), Brush_Dirt = c("No_Brush_No_Dirt", "No_Brush_Yes_Dirt", "No_Brush_Yes_Dirt", "Yes_Brush_No_Dirt", "Yes_Brush_No_Dirt", "Yes_Brush_Yes_Dirt", "Yes_Brush_Yes_Dirt", "No_Brush_No_Dirt", "No_Brush_No_Dirt", "No_Brush_Yes_Dirt", "No_Brush_Yes_Dirt", "Yes_Brush_No_Dirt", "Yes_Brush_No_Dirt", "Yes_Brush_Yes_Dirt", "Yes_Brush_Yes_Dirt"), Z = c(0.244351382982314, -0.0015361217248987, -0.877775019539761, -0.498374272882404, -0.659639015247898, 0.488286794228672, -0.794444097789949, 0.909867363652624, 2.05669202585517, 0.019788897546955, 1.31082564239473, -0.0230158910253944, -0.62363353368801, 0.498543577208916, -2.04993773197107)), row.names = c(NA, 15L), class = "data.frame")
And the (unfinished) brms model:
fit <- brm(data = my_data, family = gaussian,
Z ~ 1 + Material * Brush_Dirt,
prior = c(prior(normal(0, sigma0), class = Intercept), # beta0
prior(normal(0, sigma1), class = b, lb = 0, coef = Material), # beta1
prior(normal(0, sigma2), class = b, lb = 0, coef = Brush_Dirt), # beta2
prior(uniform(0, ErrorMax), class = sigma))
I now know more or less how to define the priors for the interaction (M), but the remaining question is:
How do I define the priors for sigma0, sigma1, sigma2 and sigmaM [~HN(0, sX)]? Do I need several formulas with the bf()
function (one for each sigmaX) and specify the dpar
argument ( = sigmaX
)?
But then, what would be the class
for the prior()
statement?
(Sorry for the formatting of the previous version)