Hi, I’m learning to use brms but I have a doubt with interactions, this is a basic question, sorry.

I have fit the following model:

fit <- brm_multiple(survival| cens(1-Die) ~ treat+treat*histology, data = imp,family = lognormal(), iter=2000)

Both “treat” and “histology” are binary variables. Subsetting did not work in the imputed dataset (ie. subset = histology==1)

I want to evaluate the posterior probability that “treat” increases survival by 30% in both histology==1 and histology==0. I need something similar to the constrast function in the rms package.

I would also like to know the posterior probability of the interaction.

Thanks.

the problem is the constrast with an imputed dataset… can anybody help, please?

Your question may not actually brms related it seems since you try to subset a data and the imputed data set does not come from brms.

To compute the desired contrasts directly, the hypothesis function may be helpful.

1 Like

I am grateful for the answer, I have reviewed the documentation and it was not clear to me how it is done with the hypothesis function.

For example, I have used:

a<-hypothesis(fit, hypothesis = ‘treat*histology = 0’) # H0: No interaction

b<-hypothesis(fit, “treat > 0.26”)

c<-hypothesis(fit, “(treat+treat:histology) >0.26”)

I’m not sure if b and c is the right way to get what I need.

b and c definitely go in the right direction, thati is, are syntactically correct. But I am not sure where the 0.26 comes from?

1 Like