LTA Analysis

157 views
Skip to first unread message

Kyle Rehn

unread,
Jun 30, 2023, 5:40:44 PM6/30/23
to lavaan
Is it possible to conduct latent transition analysis using the lavaan package? Thanks so much!

Kyle


Mauricio Garnier-Villarreal

unread,
Jul 1, 2023, 3:00:52 PM7/1/23
to lavaan
No, for such model I think the best option within R is depmixS4 or LatentGold (proprietary)

Mauricio Garnier-Villarreal

unread,
Jul 3, 2023, 6:49:58 AM7/3/23
to lavaan

Kyle Rehn

unread,
Aug 1, 2023, 10:50:51 AM8/1/23
to lavaan
Hey! This was SUPER helpful and I really appreciate your help. I think I got most of the code figured out finally except for the covariates part. I want to include Wave as the time interval period over time and Sex as the covariate. The code works but I can't see how Sex plays a part in the output (cant see it anywhere). Do you have any recommendations? Here is my code below. 

ST <- depmix(
  response = list(Physical ~ 1, Counseling ~ 1, NeedCare ~ 1, SuicideThink ~ 1),
  data = HMM,
  nstates = 4,
  transition = ~ Wave,
  ntimes = as.numeric(table(HMM$AID)),
  family = list(
    multinomial("identity"),
    multinomial("identity"),
    multinomial("identity"),
    multinomial("identity"),
    multinomial("identity"),
    multinomial("identity"),
    multinomial("identity"),
    multinomial("identity")
  ),
  covariates = ~ Sex
)

Thanks so much!

Kyle

Mauricio Garnier-Villarreal

unread,
Aug 1, 2023, 5:26:59 PM8/1/23
to lavaan
Kyle

As this is no longer a lavaan question please email me directly, and I can help you on that

(I should add a covariate section to the titorial then jaja)
Reply all
Reply to author
Forward
0 new messages