Hi everyone,
I have a (multivariate) cumulative model (with a probit link) with the following variables:
IV1 badge
: categorical predictor with 3 levels: nobadge
, twitter
and irma
.
IV2 context
: categorical predictor with 2 levels: earth
and cancer
Interaction badge:context
with 6 levels accordingly
3 DVs with 5-point Likert scale data (sharing, sourcred, messcred)
library(brms)
d <- read.csv("example_data.csv")
m1 <- brm(
mvbind(sharing, sourcred, messcred) ~ 1 + badge + context + badge:context,
data = d,
family = cumulative("probit"),
prior = c(
prior(normal(0,4), class = Intercept),
prior(normal(0,4), class = b)
)
)
To test my 2 hypotheses I need to compare:
H1 twitter
vs. nobadge
(main effect)
H2 irma_cancer
vs. nobadge_cancer
(interaction effect)
To test H1 I would use sum contrasts for context
and dummy contrasts for badge
(nobadge
as the reference level) so that the the estimate sharing_badgetwitter
is the difference in sharing scores
between the levels twitter and nobadge while averaging over context
.
For the second hypothesis I wanted to use the hypothesis()
function from brms but I can’t figure out how to create the right contrasts so that I compare only the relevant part of the interaction. So from the six levels of the interaction badge:context
I’m interested in the comparison of 'irma_cancervs.
nobadge_cancer`.
Question: How can I create the desired contrasts for H2?
- Operating System: macOS 11.5.2
- brms Version: 2.13.5
Thank you for your suggestions!
Here is an example screenshot from the summary output & example data:
example_data.csv (27.5 KB)