Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Latent class analysis (LCA) in Stata

    I'm learning LCA for the first time, so I apologize if this is naïve, but...


    Once I've created latent classes in Stata, how can I use them as dependent variables?

    Below, I've created two latent classes from a set of eleven binary variables. I'm trying to predict which class the respondent falls into based on an independent variable (netsizeSD) and a set of covariates (female age college i.diagnosis). Is the bolded part of my code correct?
    (Note that I've constrained four parameters to avoid issues of perfect prediction.)


    Code:
    gsem (_-> epi_strug___1 epi_strug___2 epi_strug___3 epi_strug___4 epi_strug___5 ///
    epi_strug___6 epi_strug___7 epi_strug___8 epi_strug___9 epi_strug___10 epi_strug___11, logit) ///
    (Class <- netsizeSD female age college i.diagnosis) ///
    (1: epi_strug___2 <- _cons@15) ///
    (2: epi_strug___2 <- _cons@15) ///
    (2: epi_strug___8 <- _cons@15) ///
    (2: epi_strug___10 <- _cons@15) ///
    , lclass(Class 2)

    If this is correct, how do I interpret the output? For example, the coefficient on netsizeSD is 1.284785. Is that an odds ratio (i.e., a one-SD increase in netsize is associated with a 28% increase in the odds of being in Class 2 rather than Class 1)?

    Thanks for your help.

  • #2
    Max Coleman

    In the past, I assigned the observations to latent classes based on their predicted posterior probabilities. I attached the code I used.

    Code:
    gsem (logecr-logunf <-), lclass(C 3)
    estat ic 
    estat lcprob
    estat lcmean
    
    predict cpost*, classposteriorpr
    
    gen class1 = 1 if cpost1>0.5
    replace class1=0 if cpost1<0.5
    gen class2 = 1 if cpost2>0.5
    replace class2=0 if cpost2<0.5
    gen class3 = 1 if cpost3>0.5
    replace class3=0 if cpost3<0.5

    Comment


    • #3
      You could do that with your two groups and then run a logistic regression. I'm realizing now that that doesn't incorporate the uncertainty in group membership, so I guess you would only want to do that if the observations fell into classes with high probability.

      Comment

      Working...
      X