Thank you for asking.
Level 3: X (Independent variable)
Level 2: M (mediator or intervening variable)
Level 1: Y (outcome variable)
The independent variable is at level 3, a mediator is at level 2, and an outcome variable is at level 1. Thus, it is a 3 -> 2 -> 1 multilevel mediation model.

I have seen someone built a 2-1-1 model using OpenMx (https://openmx.ssri.psu.edu/node/4258), but was not sure whether I can build a three-level SEM using OpenMx.

I don't have an example script for 3 -> 2 -> 1 mediation, but yes OpenMx can fit 3-level multilevel structural equation models. Here's an example of a 3-level model that could also be done with e.g. the lme4 package.

But I think from this example it is relatively clear how one could have arbitrary SEMs at each level instead of the simple models in the example.

Of similar note, OpenMx's multilevel modeling can extent to a theoretically arbitrary number of levels. The paper Joshua wrote on this for instance uses a 5-level SEM.

I'm unfamiliar with that terminology. What is a 3-2-1 mediation model?

Hi, jpritikin.

Thank you for asking.

Level 3: X (Independent variable)

Level 2: M (mediator or intervening variable)

Level 1: Y (outcome variable)

The independent variable is at level 3, a mediator is at level 2, and an outcome variable is at level 1. Thus, it is a 3 -> 2 -> 1 multilevel mediation model.

I have seen someone built a 2-1-1 model using OpenMx (https://openmx.ssri.psu.edu/node/4258), but was not sure whether I can build a three-level SEM using OpenMx.

Claire

I don't have an example script for 3 -> 2 -> 1 mediation, but yes OpenMx can fit 3-level multilevel structural equation models. Here's an example of a 3-level model that could also be done with e.g. the

`lme4`

package.xxm-3.R

But I think from this example it is relatively clear how one could have arbitrary SEMs at each level instead of the simple models in the example.

Of similar note, OpenMx's multilevel modeling can extent to a theoretically arbitrary number of levels. The paper Joshua wrote on this for instance uses a 5-level SEM.

https://www.tandfonline.com/doi/full/10.1080/10705511.2017.1293542