How to translate brm model output into real scale

Hi all,

Firstly, sorry if this is an easy one - I’m new to R and bayesian modelling.
I have run a brms model looking at the effect of a number of factors on playful behaviour in children and now would like to translate the output into a real scale. So for example, if I have a categorical predictor variable, like mother status (dead or alive), I want to write the results as: “children whose mother is alive are xx% more playful than those whose mother is dead”.

Similarly, for a continuous variable such as height, I want to be able to work out how a 1cm increase in height affects playfulness.

All of the non-binary variables in the model are standardized and I used the beta_binomial2 custom family.

The results of my brms model are as follows (I hope this will be enough to help me answer this!).
Family: beta_binomial2
Links: mu = logit; phi = identity
Formula: playfulness| vint(totalinteractions) ~ me(relatedness_c, relatedness.sd) + height + mother.status + group.size + Age + (1 | ID) + (1 | Year)
Data: child.data (Number of observations: 625)
Samples: 4 chains, each with iter = 6000; warmup = 3000; thin = 1;
total post-warmup samples = 12000

Group-Level Effects:
~ID (Number of levels: 57)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.61 0.09 0.46 0.80 1.00 2911 5587

~Year1 (Number of levels: 35)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.47 0.09 0.32 0.68 1.00 3256 6078

Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept -5.88 0.15 -6.18 -5.58 1.00 2459 4494
height 0.10 0.05 0.01 0.20 1.00 9511 9579
mother.status -0.33 0.13 -0.57 -0.08 1.00 6913 7777
group.size -0.13 0.09 -0.31 0.04 1.00 3569 6087
Age -0.49 0.10 -0.69 -0.30 1.00 3172 5747
n.photo 0.07 0.05 -0.04 0.17 1.00 7714 8232
Relatedness -0.09 0.12 -0.32 0.13 1.00 2249 5441

Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
phi 183.13 14.89 154.86 213.41 1.00 8913 7590

Samples were drawn 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).
Thanks!

  • Operating System: Windows 10
  • brms Version:2.15.0

Hello, overall I think what you’re looking for is post-processing inference. There is support for this via ‘emmeans’ for brms models. Alternately, you can use the ‘fitted()’ function from your brms model.

For example; if you wanted to determine the expected value of playfulness as a function of height, you can pass new values of height to the ‘fitted()’ function, and examine how the predicted playfulness is related to height. Often this is easiest to visualize. The ‘conditional_effects()’ function automates this.

If you’re interested in functions of parameters then you can obtain them from the samples. For example, you could ask for the difference in playfulness between ‘mother==alive’ versus ‘mother==dead’ by calculating it for each sample, and then summarizing the results across samples. This forms a posterior distribution for the difference between those quantities. You can get this by passing ‘summary = FALSE’ to ‘fitted()’.

2 Likes

This is great, thanks for your help!