Hi!
After following the tutorial for modelling ordinal responses with brms I ran into a bit of a problem. I want to run a relatively basic path analysis using two separate formulas. Since the responses for both the outcome and the mediator are questionnaires with several items, I used a multilevel formula syntax like the tutorial instructed:
outcome_formula <- bf(outcome_questionnaire_score ~ 1 + predictor_variable + (1|person) + (1|outcome_questionnaire_item))
mediator_formula <- bf(mediator_questionnaire_score ~ 1 + predictor_variable + (1|person) + (1|mediator_questionnaire_item))
Then I combine the two formulas in the brm function as usual:
fit_ordered <- brm(
outcome_formula + mediator_formula + set_rescor(FALSE),
data = data_long,
family = cumulative("logit")
)
The problem
My mediator questionnaire has more items than the outcome questionnaire. As such, I can get the data to look like this in the long format to feed to the model:
The issue is , of course, all the NAs are dropped when I run the model. The result is that a lot (in my real data about 15) of the mediator questionnaire items end up being discarded. Apologies if this is an amateur question, but outside of imputing values for items that do not exist, what are my options here?
Follow up question -
How do I even include the mediator in the outcome formula? Should I use something like
outcome_formula <- bf(outcome_questionnaire_score ~ 1 + (mediator_questionnaire_score| item\person) + mediator_questionnaire_score + predictor_variable + (1|person) + (1|outcome_questionnaire_item))
I’m out of my depth here.
- Operating System: Windows 10 (R 4.0)
- brms Version: 2.13
Thanks in advance,