Announcement

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

  • Missing parameter estimates in lclogit

    Hi Statalist,

    I ran latent class logit model in Stata 13 with discrete choice experiment (DCE) data using lclogit written by Pacifico and Yoo.
    To fix idea about my research, here is what I am working on
    My choice experiment measure tourist willingness to pay for attributes of ecotourism trip (Village accommodation, craft making market, village tour and price).
    110 tourists were presented with 7 choice sets each with three alternatives (i.e. 2 alternatives with attributes of ecotourism and a status quo equivalent to their current trip)
    Tourist can either choose Trip A or Trip B or stick with current trip (equivalent to status quo or opt out).
    Tourist socio-demographic characteristics such as Gender Age Education years, nationality and income were used as determinants of class membeship

    The challenge encountered is that parameter estimates for a particular class are missing. I really do not know why these parameters are missing and the implications for the applicability of the result to my data. Any assistance will be much appreciated. Thanking you in advance for your comments!

    Below is the command ran Code:

    ***Estimation of asmptotic standard errors and z-values of estimates from lclogit through gllam lclogitml, iterate(5)
    After sending the above command to stata, I got the result below
    Code:

    ***Estimation of asmptotic standard errors and z-values of estimates from lclogit through gllam . lclogitml, iterate(5) -gllamm- is initializing. This process may take a few minutes. numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered Iteration 0: log likelihood = -441.06276 (not concave) numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered Iteration 1: log likelihood = -441.06276 (not concave) numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered Iteration 2: log likelihood = -441.06276 (not concave) numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered Iteration 3: log likelihood = -441.06276 (not concave) numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered Iteration 4: log likelihood = -441.06276 (not concave) numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered numerical derivatives are approximate flat or discontinuous region encountered Iteration 5: log likelihood = -441.06276 (not concave) convergence not achieved Latent class model with 3 latent classes ------------------------------------------------------------------------------- Choice | Coef. Std. Err. z P>|z| [95% Conf. Interval] --------------+---------------------------------------------------------------- choice1 | Price2 | .0659244 .0107037 6.16 0.000 .0449455 .0869032 Accommodation | -.7282424 .2369424 -3.07 0.002 -1.192641 -.2638437 Market | -.0795953 .2947011 -0.27 0.787 -.6571989 .4980083 Tour | .2114257 .2318396 0.91 0.362 -.2429715 .6658229 --------------+---------------------------------------------------------------- choice2 | Price2 | -2.520002 1.075836 -2.34 0.019 -4.628602 -.4114024 Accommodation | 33.41135 17.16425 1.95 0.052 -.2299641 67.05266 Market | 17.96667 . . . . . Tour | -1.970766 . . . . . --------------+---------------------------------------------------------------- choice3 | Price2 | -.0027144 .0100404 -0.27 0.787 -.0223932 .0169644 Accommodation | -.9510399 .1919325 -4.96 0.000 -1.327221 -.574859 Market | -.406724 .1761886 -2.31 0.021 -.7520474 -.0614006 Tour | -.4181075 .1473625 -2.84 0.005 -.7069328 -.1292822 --------------+---------------------------------------------------------------- share1 | male | -.0801244 .6545101 -0.12 0.903 -1.362941 1.202692 Age | .0322988 .0250557 1.29 0.197 -.0168093 .081407 Eduyears | -.1015891 .1269271 -0.80 0.423 -.3503617 .1471835 national | -.8126188 .7034051 -1.16 0.248 -2.191267 .5660298 Income | .5675667 .3120162 1.82 0.069 -.0439738 1.179107 _cons | -1.547812 2.07203 -0.75 0.455 -5.608915 2.513292 --------------+---------------------------------------------------------------- share2 | male | .510867 .4993067 1.02 0.306 -.4677561 1.48949 Age | .0517979 .0193701 2.67 0.007 .0138332 .0897626 Eduyears | -.189617 .1004979 -1.89 0.059 -.3865893 .0073553 national | -.8631777 .544691 -1.58 0.113 -1.930752 .2043971 Income | .231292 .2207554 1.05 0.295 -.2013807 .6639647 _cons | .6208119 1.523915 0.41 0.684 -2.366006 3.60763 -------------------------------------------------------------------------------
    As you can see, parameter estimates for the standard error, z-statistics, p>|z| and 95% confidence interval for Market and Tour in choice 2 are missing.

    I look forward to comments

    Babatope Akinyemi

  • #2
    Babatope:
    as we can see, your post has severe formatting problems.
    Please use CODE delimiters to post what you typed and what Stata gave you back (as per FAQ, which also highlight the strong preference on this forum for real given and family names). Thanks.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Hi Carlo,

      Thanks for reading and commenting on my post. Please accept my apology for not following the forum convention on given and family name (my details will be updated shortly).
      Here is what I typed on stata
      To find plausible latent class, I typed the command below:
      Code:
      ****Finding the number of latent class plausible for the sample
      set seed 1234567890
      di c(current_time)
      forvalues c = 2/7 {
      quietly lclogit Choice Price2 Accommodation Market Tour, group(set) id (ID) nclass(`c') membership( Gender Age national) seed(1234567890)
      matrix b = e(b)
      matrix ic = nullmat(ic) \ `e(nclasses)', `e(ll)', `=colsof(b)', `e(caic)', `e(bic)'
      }
      matrix colnames ic = "Classes" "LLF" "Nparam" "CAIC" "BIC"
      matlist ic, name(columns)
      lclogit Choice Price2 Accommodation Market Tour, group(set) id (ID) nclass(3) membership(male Age Eduyears national Income) seed(1234567890)
      bys `e(id)': gen first = _n==1
      lclogitpr cp, cp
      egen double cpmax = rowmax(cp1-cp3)
      sum cpmax if first, sep(0)
      I got the result below
      Code:
      matrix colnames ic = "Classes" "LLF" "Nparam" "CAIC" "BIC"
      
      . matlist ic, name(columns)
      
        Classes        LLF     Nparam       CAIC        BIC 
      ------------------------------------------------------
              2  -483.6197         12   1035.645   1023.645 
              3  -444.5873         20   1003.184   983.1843 
              4  -434.1761         28   1027.966   999.9657 
              5  -430.5919         36   1066.401   1030.401 
              6  -420.7023         44   1092.226   1048.226 
              7  -418.8815         52   1134.188   1082.188
      To estimate conditional probability of class membership among respondents, I typed the command below
      Code:
      * Estimating the conditional probability of class membership among respondents
      lclogitpr pr, pr
      gen byte class =.
      forvalues c = 1/`e(nclasses)' {
      quietly replace class = `c' if cpmax==cp`c'
      }
      forvalues c = 1/`e(nclasses)' {
      qui sum pr if class == `c' & Choice==1
      local n=r(N)
      local a=r(mean)
      qui sum pr`c' if class == `c' & Choice==1
      local b=r(mean)
      matrix pr = nullmat(pr) \ `n', `c', `a', `b'
      }
      matrix colnames pr = "Obs" "Class" "Uncond_Pr" "Cond_PR"
      matlist pr, name(columns)
      matrix list e(PB)
      matrix list e(CB)
      quietly lclogitcov Market Tour Price2
      sum var_1 cov_12 var_2 if Age >42 & first
      sum var_1 cov_12 if Age <=42 & first
      I got the result below

      Code:
       * Estimating the conditional probability of class membership among respondents
      . lclogitpr pr, pr
      
      . gen byte class =.
      (2310 missing values generated)
      
      . forvalues c = 1/`e(nclasses)' {
        2. quietly replace class = `c' if cpmax==cp`c'
        3. }
      
      . forvalues c = 1/`e(nclasses)' {
        2. qui sum pr if class == `c' & Choice==1
        3. local n=r(N)
        4. local a=r(mean)
        5. qui sum pr`c' if class == `c' & Choice==1
        6. local b=r(mean)
        7. matrix pr = nullmat(pr) \ `n', `c', `a', `b'
        8. }
      
      . matrix colnames pr = "Obs" "Class" "Uncond_Pr" "Cond_PR"
      
      . matlist pr, name(columns)
      
            Obs      Class  Uncond_Pr    Cond_PR 
      -------------------------------------------
            147          1   .2311172     .56333 
            371          2    .634699          1 
            252          3   .3501827   .4410339 
      
      . matrix list e(PB)
      
      e(PB)[1,4]
                      Average of:   Average of:   Average of:   Average of:
                          Price2  Accommodat~n        Market          Tour
      Coefficients    -1.2022942     15.645479     8.5068397    -1.0465603
      
      . matrix list e(CB)
      
      symmetric e(CB)[4,4]
                          Price2  Accommodat~n        Market          Tour
            Price2     1.6141487
      Accommodat~n    -21.756534     293.40716
            Market    -11.583016     156.23658     83.199755
              Tour     1.1370887    -15.246119    -8.1023346     .84167371
      
      . quietly lclogitcov Market Tour Price2
      
      . sum var_1 cov_12 var_2 if Age >42 & first
      
          Variable |       Obs        Mean    Std. Dev.       Min        Max
      -------------+--------------------------------------------------------
             var_1 |        47    84.30443     1.63671   80.28512   86.88798
            cov_12 |        47   -8.464451    .4089107  -9.074221  -7.127752
             var_2 |        47    .8956158    .0824142   .6560011    1.03399
      
      . sum var_1 cov_12 if Age <=42 & first
      
          Variable |       Obs        Mean    Std. Dev.       Min        Max
      -------------+--------------------------------------------------------
             var_1 |        63    82.37563    1.304967    79.8566   85.98016
            cov_12 |        63   -7.832184     .672765  -8.773386  -6.706425
      To find the asymptotic standard errors, z statistics and p-values and estimate the WTP, I typed the command below

      Code:
      ***Estimation of asymptotic standard errors and z-values of estimates from lclogit through gllam
      lclogitml, iterate(5)
      
      **Estimating WTP
      wtp Price2 Accommodation Market Tour, equation(choice1)
      wtp Price2 Accommodation Market Tour, equation(choice2)
      wtp Price2 Accommodation Market Tour, equation(choice3)
      I got the result below:

      Code:
      ***Estimation of asmptotic standard errors and z-values of estimates from lclogit through gllam
      . lclogitml, iterate(5)
      -gllamm- is initializing. This process may take a few minutes.
      
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      Iteration 0:   log likelihood = -441.06276  (not concave)
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      Iteration 1:   log likelihood = -441.06276  (not concave)
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      Iteration 2:   log likelihood = -441.06276  (not concave)
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      Iteration 3:   log likelihood = -441.06276  (not concave)
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      Iteration 4:   log likelihood = -441.06276  (not concave)
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      numerical derivatives are approximate
      flat or discontinuous region encountered
      Iteration 5:   log likelihood = -441.06276  (not concave)
      convergence not achieved
      
      Latent class model with 3 latent classes
      -------------------------------------------------------------------------------
             Choice |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      choice1       |
             Price2 |   .0659244   .0107037     6.16   0.000     .0449455    .0869032
      Accommodation |  -.7282424   .2369424    -3.07   0.002    -1.192641   -.2638437
             Market |  -.0795953   .2947011    -0.27   0.787    -.6571989    .4980083
               Tour |   .2114257   .2318396     0.91   0.362    -.2429715    .6658229
      --------------+----------------------------------------------------------------
      choice2       |
             Price2 |  -2.520002   1.075836    -2.34   0.019    -4.628603   -.4114023
      Accommodation |   33.41135   17.16425     1.95   0.052    -.2299641    67.05266
             Market |   17.96667          .        .       .            .           .
               Tour |  -1.970766          .        .       .            .           .
      --------------+----------------------------------------------------------------
      choice3       |
             Price2 |  -.0027144   .0100404    -0.27   0.787    -.0223932    .0169644
      Accommodation |  -.9510399   .1919325    -4.96   0.000    -1.327221    -.574859
             Market |   -.406724   .1761886    -2.31   0.021    -.7520474   -.0614006
               Tour |  -.4181075   .1473625    -2.84   0.005    -.7069328   -.1292822
      --------------+----------------------------------------------------------------
      share1        |
               male |  -.0801244   .6545101    -0.12   0.903    -1.362941    1.202692
                Age |   .0322988   .0250557     1.29   0.197    -.0168093     .081407
           Eduyears |  -.1015891   .1269271    -0.80   0.423    -.3503616    .1471834
           national |  -.8126188    .703405    -1.16   0.248    -2.191267    .5660297
             Income |   .5675667   .3120162     1.82   0.069    -.0439738    1.179107
              _cons |  -1.547812   2.072029    -0.75   0.455    -5.608913     2.51329
      --------------+----------------------------------------------------------------
      share2        |
               male |    .510867   .4993067     1.02   0.306    -.4677561     1.48949
                Age |   .0517979   .0193701     2.67   0.007     .0138332    .0897626
           Eduyears |   -.189617   .1004979    -1.89   0.059    -.3865893    .0073553
           national |  -.8631777    .544691    -1.58   0.113    -1.930752     .204397
             Income |    .231292   .2207554     1.05   0.295    -.2013807    .6639647
              _cons |   .6208119   1.523914     0.41   0.684    -2.366005    3.607629
      -------------------------------------------------------------------------------
      
      . 
      . **Estimating WTP
      . wtp Price2 Accommodation Market Tour, equation(choice1)
      
           Accommodation         Market           Tour
      wtp      11.046635      1.2073728     -3.2070954
       ll      5.8421388     -7.4204234     -10.460662
       ul      16.251131       9.835169      4.0464717
      
      . wtp Price2 Accommodation Market Tour, equation(choice2)
      
           Accommodation         Market           Tour
      wtp      13.258459      7.1296249     -.78204926
       ll     -4.9648705      1.1639449     -1.4364253
       ul      31.481788      13.095305     -.12767323
      
      . wtp Price2 Accommodation Market Tour, equation(choice3)
      
           Accommodation         Market           Tour
      wtp     -350.36546     -149.83813     -154.03185
       ll     -2985.3072     -1273.3314     -1300.4635
       ul      2284.5763      973.65513      992.39985
      I noticed the following from the results
      1. Convergence was not achieved
      2. Parameter estimates are missing for choice 2

      My question is why is convergence not achieved and why missing estimates for choice 2?

      Again, much thanks for reading my post and your comments will be much appreciated

      Babatope Akinyemi

      Comment


      • #4
        Babatope:
        I can answer to the first part of your question: in order to investigate why your model had such hard times in reaching the top of the hill (i.e. maximization), you should start it all over again, add one predictor at time and see where Stata starts to choke on.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Carlo:
          I want to thank you for your comments. I will start all over again as advised and add one predictor at a time and see what predictor actually choked the model.

          Kind regards,

          Babatope Akinyemi

          Comment


          • #6
            Babatope:
            thanks for your feed-back and for re-registering according to the list requirements.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              You are much welcome Sir! I also appreciate the way you gently pointed it out to me

              Kindest regards!

              Babatope

              Comment


              • #8
                Hi Babatope,

                Have you estimated socio-demographic variables in your model?

                Because currently I am using mixlogit and latent class model to analyze a discrete choice experiment data, but I can not put the socio-demographic variables directly into these model. And so far I have not found out solutions.

                Therefore, could you please tell me how did you manage it in your case?

                Best regards,

                Zhao

                Comment


                • #9
                  Hi Lukas,

                  Yes, I already estimated socio-demographic variables in my mixlogit model.
                  All you need to do is to interact the socio-demographic variable of interest with ASC before including the variables in the model.

                  You however should be wary of how the interacted variable entered the model (either as fixed or random component).

                  I hope this will help you.

                  Cheers!




                  Comment


                  • #10
                    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


                    • #11
                      hello
                      how can i calculate the market share for each attribut in each class?

                      Comment


                      • #12
                        Hi Statalist

                        I have similar problem with Babatope Akinyemi. My model did not converge and one of the predictors has no standard error and z value. Is there any new insight on how to address this issue.
                        Thank you.

                        Peter

                        Comment

                        Working...
                        X