Thank you @Solomon for helping me! I am taking my old post example: How to properly compare interacting levels. The model is slightly revised, but is nice and simple leaving aside random effects, covariates etc.
# uniformly generated means
m = runif(4, 3, 18)
# random values, random means, same std. dev.
y = list()
for (i in 1:4) {
y[[i]] = rnorm(30, m[i], 0.8)
}
y = unlist(y)
# factorial design
F1 = c(rep('A', 30), rep('B', 30))
F2 = c('I', 'J')
design_matrix = expand.grid(F1=F1, F2=F2)
# dataset
dat = cbind(design_matrix, y)
library(brms)
library(emmeans)
model1 <- brm(y ~
F1 * F2,
data = dat,
chains=4, iter=4000, cores=4)
model1.emm = emmeans(model1, ~ F1 * F2)
joint_tests(model1.emm)
# model term df1 df2 F.ratio Chisq p.value
# F1 1 Inf 5288.825 5288.825 <.0001
# F2 1 Inf 18.793 18.793 <.0001
# F1:F2 1 Inf 56.745 56.745 <.0001
I appreciate the anova-style overall effect of F1, F2, and the interaction, but credible intervals might be more in Bayesian-spirit.