I have generated posterior distributions of several estimates by combining a series of chains from Bayesian regression models. Specifically, they are merged chains from
These models are of the form
y ~ a + b + c, where
b are factors with multiple levels, and
c is a continuous variable. From these posterior distributions I can calculate the estimate (mean) and its confidence interval.
For the continuous variable this is sufficient. However, for the factors I would like to know the predicted mean and CI for each of the factor levels. Ideally, I would also like to test which levels are different from each other.
Example code in R:
library(MCMCglmm) m <- MCMCglmm(mpg ~ factor(cyl) + factor(vs) + wt, data = mtcars) d <- as.data.frame(test$Sol)
Can one use
- calculate the means of each level of
- test whether the different levels of
cyldiffer significantly from each other?
(I mainly interested in knowing if and how I can do this in a statistical sense. R code would be appreciated, but it is not the focus of my question.)