Announcement

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

  • 0/1 variable not reading as 0/1 with lclogitml

    My second and last post to Statalist today:

    I am using lclogitml to generate standard errors for coefficients from a latent class model using clogit.

    For some reasons I get the following error each time I use lclogitml:

    Code:
    choice is not a 0/1 variable which equals 1 for the chosen alternative.
    r(450);
    I have checked a few previous Statalist posts about this issue and there was not resolution to those posters same issue.

    I have checked my outcome variable y (called choice) many times to ensure that the only values it takes on are 0/1. I used recast to change the storage type of the variable and this did not resolve the issue.

    I used example data from this presentation to see if I could recreate the error with this other data and lclogitml worked just fine.

    What are the possible reasons why Stata is not reading this variable as 0/1 even though I see it as such? Perhaps this error is being generated for another reason that is not related to the 0/1 nature of my outcome variable?

    Thank you for your help!


    Last edited by Rebecca Boehm; 25 Oct 2016, 12:05.

  • #2
    Problem resolved! Two issues:

    In choice experiment data you must ensure that at least each choice set has an =1 in it.

    Second problem is that the post estimation command -lclogitml- requires an if statement if an if statement was used with -lclogit-.

    Took some discussion with author of command, but we figured it out together! Hope this is helpful to others.

    Comment


    • #3
      Hi Rebbeca, can you explain to me what you mean by "In choice experiment data you must ensure that at least each choice set has an =1 in it" I am having the same error(
      choice is not a 0/1 variable which equals 1 for the chosen alternative) ....

      Comment


      • #4
        Rotana Radwan:

        Please see my answer in another thread [Link].

        Comment

        Working...
        X