Multiple group SEM

Stata's generalized structural equations model (SEM) command now makes it easy to fit models on data comprising groups.

With gsem's new features, you can perform a confirmatory factor analysis (CFA) and allow for differences between men and women by typing:

Confirmatory factor analysis

If you are new to Stata and gsem, let us tell you that this is just one new feature in a command that already has many features gsem fits confirmatory factor models, seemingly unrelated models, SEMs, multilevel models, and all combinations thereof. It fits these models with outcomes that are continuous, binary, ordinal, count, and even survival. With the new group() option, we can estimate distinct parameters across groups for any of these models. We can even combine group analysis with gsem's other new featurelatent class analyses.

The new syntax features

The new syntax features are the group() and ginvariant() options. They work together. Say you want to fit a path model such as:

group and ginvariant options

If you wanted to fit the same model but obtain separate parameter estimates for each of three groups in the data identified by variable subset equal to 1, 2, and 3, you could fit the model three times:

group and ginvariant options

But then you could not compare the fitted parameters or constrain some parameters to be equal across groups.

In Stata 15, you can type:

group and ginvariant options

And you can specify a separate model for each group:

group and ginvariant options

The ginvariant() option specifies which fitted parameters are to be constrained to be equal across groups. The types of parameters gsem fits are

group and ginvariant options

Thus, if you type:

group and ginvariant options

only the intercepts are constrained to be equal across groups.

Post your comment

Timberlake Consultants