Announcement

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

  • Is pweight compatible with cmxtmixlogit ?

    Dear collegues,

    I'm curently working on panel dataset. In this consumption survey, we asked to consumers to rank their three favorite schemes among a pool of nine alternatives.


    To analyse my data, i used a cmxtmixlogit command. I would like to know if this cmxtmixlogit command is compatible with a weighting command (such as pweight).

    According to STATA guide, it is possible. However, when i try to use it, it does'nt work. I don't know if i have some trouble with my line of code ?

    I use the following syntax:

    Code:
     cmxtmixlogit chosen, casevars(i.recode_age i.genre deplittoral prix_crit enfant univ tradi prefgeo) basealternative (10) [pw=poids]
    The outcome is the following error message : option [ not allowed r(198)

    I don't know if some of you have already encountered this kind of issue. I'm looking forward to any advice that you may have.

    If you need more information about my dataset, i remain available !

    Best regards,

    Jean-François DEWALS

  • #2
    cmxtmixlogit does support sampling weights. As with other estimation commands in Stata, you should specify weights before the comma. Try

    cmxtmixlogit chosen [pw=poids], casevars(i.recode_age ...) basealternative(10)
    Hope this helps,
    Joerg

    Comment


    • #3
      Hello Joerg,

      Thank a lot for your advice and your time !

      Unfortunately, this new code line does'nt work.

      Code:
      cmxtmixlogit chosen [pw=poids], casevars(i.recode_age i.genre deplittoral prix_crit enfant univ tradi prefgeo) basealternative (10)
      I obtain the "no observation r(2000) " error message.

      Do you have any further suggestion to overcome this problem ?

      Best regards,

      Jean-François

      Comment


      • #4

        It looks like one or more of your variables have missing values and the pattern of missing values is such that, after casewise elimination, no valid observations remain. Try the following to see if any valid observations remain after listwise elimination:
        Code:
         gen esamp = !missing(chosen, poids, recode_age, genre, deplittoral, prix_crit, enfant, univ, tradi, prefgeo)
        and
        Code:
         tab esamp
        You may also want to include the variables that you used to cmset the data. If there are valid observations left (i.e., indicated by esamp=1) then the problem is likely due to casewise elimination, which is what cmxtmixlogit does by default. In that case, you could consider whether alternativewise elimination of missing values would be a valid option for your analysis. If so, you can use the altwise option, see
        Code:
        help cmxtmixlogit
        If that does not resolve your problem, please send a reproducible example to Stata technical services, see: https://www.stata.com/support/tech-support/contact/

        Comment

        Working...
        X