Two ordinal responses with unequal number of items


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,

1 Like

Sorry, short on time, so just a quick notice - If I understand the problem correctly the subset term should let you use only the relevant rows for outcome_questionnaire_item (see the help for brmsformula for details). I think you would still need to replace the NAs with something, but brms should ignore those not matching the subset condition.

Does that resolve your issue?

That is 100% the solution I needed to only use a portion of the data set for each formula. Thank you so very much for your help!

Meanwhile, I am still stuck on the mediation with an ordinal mediator variable problem if anyone has any idea how to compute the indirect effects there (the second half of the original post!

Glad to have helped. Unfortunately I don’ really understand mediation analysis - you may want to post that as a separate topic to attract attention to it (most people answering questions here don’t engage with questions that already gathered some response).

Generally, if using an ordinal item as a predictor, it is usually good to treat it as monotonic predictor (mo(mediator_questionnaire_score)) - see the help and/or for more details.

Best of luck!

Again, you might have just provided me with the answer. The monotonic predictor syntax might just be exactly what I need! I will try and come up with something using that before considering a new post.

I’m extremely grateful for you help, it really was invaluable.

1 Like