Hi,
I am currently working on a latent profile model in Stata. I have read Masyn's book chapter (which has been used as a reference in Stata Example 52g - Latent profile model): Masyn, K. E. 2013. Latent class analysis and finite mixture modeling. In The Oxford Handbook of Quantitative Methods, ed. T. D. Little, vol. 2, 551–610. New York: Oxford University Press.
Masyn states that the conditional independence assumption is not necessary for the within-class covariance structure. Unlike LCA, latent profile models do not require partial conditional independence for model identification—all indicators can covary with all other indicators within class. With increased flexibility in the within-class model specification comes additional
complexity in the model-building process. She uses 4 main within-class variance-covariance structures - I am trying to model these in Stata, however, have some issues with this (described below).
Masyn compares 4 different LPA models: class-invariant, diagonal; class-varying, diagonal; class-invariant, unrestricted ; and class-varying, unrestricted.
She recommends to compare these options for the 1-class model, 2-class model, 3-class model, etc. (depending on what is relevant for your study) for the class enumeration.
I am interested in 7 observable variables, so I was going to do this for the models ranging from 1-class to 6-classes. However, I have been trying to replicate the models of Masyn by using the covstructure and lcinvariant options to the gsem model (as described in the latent profile example) - to then do this with my own models afterwards.
As an example I have provided my 1-class models below, using the example dataset Masyn used in her book. These are all different in the covstructure and lcinvariant options (based on the Stata example 52g). Models 1, 2, and 4 seem to be giving the same numbers as reported by Masyn in her chapter. However, I can't seem to get the model 3 right.
Is there anyone who has modelled these before and wants to share their commands/provide me with feedback?
Much appreciated,
Simone
* Masyn uses the stata-press data (see below).
clear
use http://www.stata-press.com/data/r15/gsem_lca2
* WITH 1 class
*1 CIDIA
* CIDIA. Class-invariant, diagonal (conditional independence is imposed and covariances between indicators are fixed at zero within class, covariances are constrained to be equal across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 1) covstructure(e._OEn, diagonal) nolog nodvheader
*2 CVDIA
* CVDIA. Class-varying, diagonal (conditional independence is imposed and covariances between indicators are fixed at zero within class while the variances are freely estimated and allowed to be different across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 1) lcinvariant(none) covstructure(e._OEn, diagonal) nolog nodvheader
*3 CIUNR
* CIUNR. Class-invariant, unrestricted (all indicator variables are allowed to covary within class, covariances are constrained to be equal across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 2) covstructure(e._OEn, unstructured)
// definitiely no lcinvariant
*4 CVUNR
* CVUNR. Least restrictive of variance-covariance structures: class-varying, unrestricted class-specific estimated means (all indicator variables are allowed to covary within class, and the variances are allowed to be different across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 1) lcinvariant(none) covstructure(e._OEn, unstructured) nolog nodvheader
I am currently working on a latent profile model in Stata. I have read Masyn's book chapter (which has been used as a reference in Stata Example 52g - Latent profile model): Masyn, K. E. 2013. Latent class analysis and finite mixture modeling. In The Oxford Handbook of Quantitative Methods, ed. T. D. Little, vol. 2, 551–610. New York: Oxford University Press.
Masyn states that the conditional independence assumption is not necessary for the within-class covariance structure. Unlike LCA, latent profile models do not require partial conditional independence for model identification—all indicators can covary with all other indicators within class. With increased flexibility in the within-class model specification comes additional
complexity in the model-building process. She uses 4 main within-class variance-covariance structures - I am trying to model these in Stata, however, have some issues with this (described below).
Masyn compares 4 different LPA models: class-invariant, diagonal; class-varying, diagonal; class-invariant, unrestricted ; and class-varying, unrestricted.
She recommends to compare these options for the 1-class model, 2-class model, 3-class model, etc. (depending on what is relevant for your study) for the class enumeration.
I am interested in 7 observable variables, so I was going to do this for the models ranging from 1-class to 6-classes. However, I have been trying to replicate the models of Masyn by using the covstructure and lcinvariant options to the gsem model (as described in the latent profile example) - to then do this with my own models afterwards.
As an example I have provided my 1-class models below, using the example dataset Masyn used in her book. These are all different in the covstructure and lcinvariant options (based on the Stata example 52g). Models 1, 2, and 4 seem to be giving the same numbers as reported by Masyn in her chapter. However, I can't seem to get the model 3 right.
Is there anyone who has modelled these before and wants to share their commands/provide me with feedback?
Much appreciated,
Simone
* Masyn uses the stata-press data (see below).
clear
use http://www.stata-press.com/data/r15/gsem_lca2
* WITH 1 class
*1 CIDIA
* CIDIA. Class-invariant, diagonal (conditional independence is imposed and covariances between indicators are fixed at zero within class, covariances are constrained to be equal across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 1) covstructure(e._OEn, diagonal) nolog nodvheader
*2 CVDIA
* CVDIA. Class-varying, diagonal (conditional independence is imposed and covariances between indicators are fixed at zero within class while the variances are freely estimated and allowed to be different across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 1) lcinvariant(none) covstructure(e._OEn, diagonal) nolog nodvheader
*3 CIUNR
* CIUNR. Class-invariant, unrestricted (all indicator variables are allowed to covary within class, covariances are constrained to be equal across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 2) covstructure(e._OEn, unstructured)
// definitiely no lcinvariant
*4 CVUNR
* CVUNR. Least restrictive of variance-covariance structures: class-varying, unrestricted class-specific estimated means (all indicator variables are allowed to covary within class, and the variances are allowed to be different across the latent classes).
gsem (glucose insulin sspg <- _cons), lclass(C 1) lcinvariant(none) covstructure(e._OEn, unstructured) nolog nodvheader
Comment