Announcement

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

  • Latent Class Analysis with Stata

    Dear Stats-users,

    I am having trouble fitting a latent class model with Stata.

    I have a panel data set from an online discrete choice experiment. Each respondent was represented 12 choice sets with 2 alternatives and, therefore, had to make 12 choice decisions. One alternative was described by 8 attributes (3 attributes with 3 levels and 5 attributes with 6 levels). In the long formatted data set one respondent comprises 24 rows. Each row means one observation. All in all there are 13464 oservations (N=561 * 24 rows). Attributes were effects-coded. With L-1 parameter for each attribute I have 31 paramater for the model.

    First I tried to fit a conditional logit model which worked fine:

    .clogit choice V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31, group(CsetID)

    Then I used the module lclogit in order to estimate a latent class model:

    .lclogit choice V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31, group(CsetID) id(RespID) nclasses(2)

    Afterwards I applied post-estimation command lclogitml (gllamm-wrapper) to get standard errors which worked fine too.

    But then I failed doing the same for a latent class model with 3 classes. I repeated lclogit-procedure with nclasses(3). After recalling lclogitml command gllamm stopped initializing process with error message "equation z2_5_3 not found// (r111)".

    I guess z2_5_3 refers to the 5th parameter in class 2 of the 2-level-model. But I can't imagine what might be wrong here. I hope somebody can help me understand why I get this error message and gllamm does not proceed.

    Many thanks.

    Andrew


  • #2
    Hi, Andrew
    i am a PhD (Economics) student from Germany doing research on role of logistics/transport on international trade. I am using discrete choice modelling and have some questions regarding choice designing (D-efficient, Bayesian efficient) and model fitting (like Clogit, LClogit, RPlogit). I would like to talk you, can you please provide me your email or telephone, i will appreciate it.

    With Thanks

    Shams

    Comment


    • #3
      Shams:
      for private issues, you can send a -Message-. Thanks.
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #4
        hello, i try to run lclogit in stata and finaly i have obtain 3 class. now what's command can i use to estimate the number of person who is in class1, class 2, class3? and so what is the command to estimate the partworth.?
        Thank you for reading my post.

        Comment

        Working...
        X