Hi,
I am trying to fit a model to my ordered categorical data. I have been using : Bayesian ordinal regression with random effects using brms to help, as well as https://journals.sagepub.com/doi/full/10.1177/2515245918823199
to help. I am very new to bayesian models, so I am aware that I have probably made mistakes, so gentle explanations would be much appreciated!
I am trying to determine whether three different continents (Africa, Asia, Europe) have different numbers of life expectancies at different levels (low, med, high).
Essentially: does continent predict how many low/med/high life expectancies in that group?
My question is about priors. Here I have used freely available data to replicate my data. I am a little stuck on priors. I run my model and have not specified any priors. Do I need to? If so, how do I choose them? Pretend this is the first data of its kind, how could I know what to set? The only thing I know is that the data will be positive. I would be so grateful for some help in working out priors/what to put.
Then, once my model has run I check the conditional effects, and I’m not so sure what that is showing either. How does one interpret the results, If the Family is acat model and the Links: mu = cloglog, what does this translate to? how can I talk about it in real terms? What does it actually mean to the average person? Finally, is the graph the posterior effects? From my understanding Bayesian models should have priors and posteriors, and I’m not sure I’ve satisfied either!
My data/code:
#load libraries
library(brms)
library("gapminder")
library("dplyr")
#Edit data
data(gapminder)
gapminder <-gapminder
#select columns of interest
gapminder <-gapminder %>%
select(continent,lifeExp, pop)
#select continents of interest
gapminder <-gapminder %>%
filter(continent == c("Africa","Asia","Europe"))
#Make ordered factors
gapminder$lifeExp<- cut(gapminder$lifeExp, 3, labels=c("low","med","high"), ordered_result=TRUE)
#Run ordinal model
## Model 1 Acat with category specific effects
mod1selection_fit <- brm(formula = lifeExp ~ cs(continent),
data = gapminder,
family = acat("cloglog"))
> summary(mod1selection_fit)
Family: acat
Links: mu = cloglog; disc = identity
Formula: lifeExp ~ cs(continent)
Data: gapminder (Number of observations: 460)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept[1] 0.53 0.11 0.32 0.74 1.00 3159 2637
Intercept[2] 2.35 0.33 1.75 3.06 1.00 2511 2183
continentAsia[1] 0.71 0.18 0.36 1.06 1.00 3113 2705
continentAsia[2] 1.99 0.36 1.31 2.74 1.00 2523 2154
continentEurope[1] 258987332313292.19 231077452855566.66 10570797797140.76 968995983082967.00 1.32 10 39
continentEurope[2] 3.45 0.35 2.79 4.20 1.00 2546 2197
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
disc 1.00 0.00 1.00 1.00 NA NA NA
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
plotm1 <-conditional_effects(mod1selection_fit, "continent", categorical=TRUE)
- Operating System:MacOS (m1 chip)
- brms Version:2.16.3
Thank you for your patience in reading this, a lot of questions but am trying hard to get my head around this!