Path model with measurement error and splines

I’d like to specify a path model (aka piecewise SEM) with brms. Say, I have the following structure a → b → c → d, where b and c are measured with an error, and the a → b relationship is non-linear. Would this be a correct specification:

form <- bf(b | mi(b) ~ s(a)) +
  bf(c | mi(c) ~  mi(b)) +
bf(d ~ mi(c)) +

I tried to follow the logic discussed in this topic: Is the brms() measurement error model doing the 'right' thing?, but I’m not sure if I can use the mi() term on both sides of the same regression equation like in the example above with bf(c | mi(c) ~ mi(b)).

You can do that but I would think that instead of mi© on the left hand side you want mi(se_c) or however you measurement sd variable is called.

1 Like