= Stata gsem = The '''`gsem`''' command fits a [[Statistics/StructuralEquationModeling|SEM]]. It is a generalized version of [[Stata/Sem|sem]]. <> ---- == Usage == `gsem` is a generalization of [[Stata/Sem|sem]] that can accommodate ordinal and binary variables. For example, given an ordinal `Y`, try: {{{ . gsem (X -> x1 x2 x3) (Z -> z1 z2 z3) (Y -> y1 y2 y3, oprobit) (Y <- X Z), noanchor variance(X@1 Z@1 e.Y@1) noconstant }}} Note that the only modification to the `sem` example is the insertion of the '''`oprobit`''' option in the model of `Y`. Comparing the output of the two, the only visual changes will be... * the inclusion of cuts of ''Y'' in terms of ''y1'' through ''y3'' * the exclusion of variances for the ordinal observed variables ''y1'' through ''y3'' Note that [[R/Lavaan|lavaan]] estimates latent variances whereas `gsem` fits data to a model using maximum likelihood. While regression coefficients can be comparable, the methods are fundamentally not. ---- == See also == [[Stata/Sem|sem]] [[https://www.stata.com/manuals/sem.pdf#semgsem|Stata manual for gsem]] ---- CategoryRicottone