Announcement

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

  • latent class logit model (lclogit, Pacifico and Yoo)

    Dear members,



    I am using lclogit command for fitting latent class conditional logit models with the guide provided by Pacifico and Yoo (2013).

    For the estimate result, There are 4 classes.


    These may be theoretical questions,

    1. The estimated posterior membership probability was obtained using the command below.

    lclogit H, up
    sum H*

    lclogit G, cp
    sum G*


    gen b_cost = [choice1]cost*G1 + [choice2]cost*G2 + [choice3]cost*G3 + [choice4]cost*G4
    ...
    ...

    And then, I got a table below.
    qid G1 G2 G3 G4 Largest G
    1 0.967244166 7.50787E-12 9.67255E-14 0.032755834 1
    2 4.47569E-11 9.46414E-11 3.36089E-15 1 4
    3 9.43993E-05 8.21812E-09 6.81163E-07 0.999904911 4
    4 1.02623E-09 2.65639E-11 1.70497E-15 0.999999999 4
    5 0.999605016 3.42346E-12 9.3186E-10 0.000394983 1
    6 1.66431E-13 1 2.95906E-18 9.18833E-15 2
    7 2.24516E-13 1.02548E-10 7.90111E-15 1 4
    8 2.40474E-09 2.09035E-09 0.996114539 0.003885457 3

    Although I do not know whether an individual respondent belongs to a particular class q, can I understand that he or she belongs to the class with the largest posterior probability of membership?

    qid 1 would be in class 1
    qid 2 would be in class 4
    qid 3 would be in class 4
    ...



    2. I would like to do a sensitivity analysis.

    I can find the choice probability by substituting the attribute level x for a hypothetical alternative.

    By changing the price attribute level x_price, I can analysis the change in choice probability for price.

    Similarly, I would like to see changes in choice probability for different levels of psychological variables by 5-Likert scale.

    Can I change the psychological variable level z (1-> 2-> 3-> 4-> 5) to analysis the change in choice probability?



    Have a nice day
    Thank you

  • #2
    Yuna Seo:

    (1) If you have to assign each person to a specific class, what you've done is a sensible approach to apply. Part A of Table 3 in Sarias and Daziano (2018, https://doi.org/10.1016/j.jocm.2017.10.004) reports supporting simulation results for this approach: At T = 5 choices per person they can correctly classify 86% of individuals and at T = 10, 95%.

    (2) If you think it makes sense in the context of your analysis, I don't see anything technically wrong with what you've proposed.

    (P.S.) There's now -lclogit2-, which can do everything -lclogit- does in a faster and more flexible way. You can download it by typing -ssc install lclogit2-. The background paper is available at this [link] to the Stata Journal.

    Comment


    • #3
      Dear professor,


      Thank you so much!

      I will try sensitivity analysis. Thank you for your kindness in attaching the paper.

      I have been trying lclogit2, but it wasn't working. I will try again.


      Thank you! 감사합니다

      Comment


      • #4
        I used the lclogit2: An enhanced command to fit latent class conditional logit models and ran the code
        ''
        lclogit2 choice, ncl(2) rand(X1 X2 X3 X4 asc1 asc2 asc3 asc4 asc5) membership(income ps1 ps2 ps3) group(gid) id(id)

        ''

        and got the output of
        ''

        Choice model parameters and average classs shares
        -------------------------------
        Variable | Class1 Class2
        -------------+-----------------
        X1| -1.959 -1.204
        X2| -1.394 -3.322
        X3| 0.662 0.517
        X4 | 0.377 0.499
        asc1 | 1.143 1.014
        asc2 | -0.148 1.967
        asc3 | 1.002 1.282
        asc4 | -1.412 1.067
        o.asc5 | 0.000 0.000
        -------------+-----------------
        Class Share | 0.686 0.314
        -------------------------------

        Class membership model parameters : Class2 = Reference class
        -------------------------------
        Variable | Class1 Class2
        -------------+-----------------
        Coef of |
        income | -0.000 0.000
        ps1| 0.110 0.000
        ps2| 0.071 0.000
        ps3| 0.029 0.000
        _cons | -0.114 0.000
        -------------------------------

        Note: Model estimated via EM algorithm



        ''

        Now I want to assign each person to a specific class, but when I run'' predict classprob*, classposteriorpr'' or '' predict classprob1 classprob2, class'' I will the error of '' option classposteriorpr or class not allowed''

        I would be grateful if anyone could help me with this.
        Last edited by Arsab buki; 11 Mar 2025, 04:03.

        Comment


        • #5
          Hi again,
          Also, I have a question about the reference category. I have five alternatives and want to use one of them as the "base alternative." I used it, but it didn't work. I would be grateful for your guidance.

          Comment

          Working...
          X