Using mi() for Covariates of a Multivariate Model

Hello,

I’m working to fit a multivariate location scale model for partners in a dyad. Here is the code I’d like to use to specify my model:

actor_bf6 <- bf(actor_pa_rel | mi() ~ 1 + mi(partner_pa_gral_c) + mi(lagged_actor_pa_gral_c) + mi(rel_sat) + partner_pa_gral_mean + (1 |c| id_dyad),
                sigma ~ 1 + mi(rel_sat) + mi(partner_na_gral_c) + partner_na_gral_mean + (1 |c| id_dyad)) +
  bf(partner_pa_gral_c | mi() ~ 1) +
  bf(lagged_actor_pa_gral_c | mi() ~ 1) +
  bf(rel_sat | mi() ~ 1) +
  bf(partner_na_gral_c | mi() ~ 1) +
  set_rescor(TRUE)

partner_bf6 <- bf(partner_pa_rel | mi() ~ 1 + mi(actor_pa_gral_c) + mi(lagged_partner_pa_gral_c) + mi(rel_sat) + actor_pa_gral_mean + (1 |c| id_dyad),
                  sigma ~ 1 + mi(rel_sat) + mi(actor_na_gral_c) + actor_na_gral_mean + (1 |c| id_dyad)) +
  bf(actor_pa_gral_c | mi() ~ 1) +
  bf(lagged_partner_pa_gral_c | mi() ~ 1) +
  bf(rel_sat | mi() ~ 1) +
  bf(actor_na_gral_c | mi() ~ 1) +
  set_rescor(TRUE)

fit_fb6 <- brm(actor_bf6 + partner_bf6, data = actor_data, seed = 111, iter = 50000)

The issue is that I get an error message when fitting the above model:

Error: Don’t know how to add a mvbrmsformulabform object without the response variable name. See help(‘brmsformula-helpers’) for more details.

This error does not appear for:

actor_bf6 <- bf(actor_pa_rel | mi() ~ 1 + mi(partner_pa_gral_c) + mi(lagged_actor_pa_gral_c) + mi(rel_sat) + partner_pa_gral_mean + (1 |c| id_dyad),
                sigma ~ 1 + mi(rel_sat) + mi(partner_na_gral_c) + partner_na_gral_mean + (1 |c| id_dyad)) +
  bf(partner_pa_gral_c | mi() ~ 1) +
  bf(lagged_actor_pa_gral_c | mi() ~ 1) +
  bf(rel_sat | mi() ~ 1) +
  bf(partner_na_gral_c | mi() ~ 1) +
  set_rescor(TRUE)

partner_bf6 <- bf(partner_pa_rel | mi() ~ 1 + actor_pa_gral_c + lagged_partner_pa_gral_c + rel_sat + actor_pa_gral_mean + (1 |c| id_dyad),
                  sigma ~ 1 + rel_sat + actor_na_gral_c + actor_na_gral_mean + (1 |c| id_dyad)) +
  bf(actor_pa_gral_c | mi() ~ 1) +
  set_rescor(TRUE)

fit_fb6 <- brm(actor_bf6 + partner_bf6, data = partner_data, seed = 111, iter = 50000)

However, the error appears as soon as I edit the above code to also impute actor_pa_gral_c in partner_bf6.

I’ve uploaded my data and would greatly appreciate if anyone could help!

actor_data.csv (4.1 MB)

Madeline

Could you print the output of actor_bf6 + partner_bf6 ? Like, I just want to see how brms is interpreting this combined brmsformula.