Announcement

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

  • [Discrete Choice Models] Error when running cmxtmixlogit command

    Dear Statalist,

    I'm using discrete choice modelling with the -cmxtmixlogit- provided by the software. The design of the experiment is as follow:
    - 19 scenarios (choices)
    - 2 alternatives without optout
    - 7 attributes with 4 to 6 levels
    Then, 38 lines by individual.

    Here is an illustration for the first ID:

    Code:
        id    group    alt    valu    
                        
    1.    1    1    0    1    
    2.    1    1    1    0    
    3.    1    2    0    1    
    4.    1    2    1    0    
    5.    1    3    0    0    
    6.    1    3    1    1    
    7.    1    4    0    0    
    8.    1    4    1    1    
    9.    1    5    0    1    
    10.    1    5    1    0    
    11.    1    6    0    0    
    12.    1    6    1    1    
    13.    1    7    0    1    
    14.    1    7    1    0    
    15.    1    8    0    1    
    16.    1    8    1    0    
    17.    1    9    0    0    
    18.    1    9    1    1    
    19.    1    10    0    0    
    20.    1    10    1    1    
    21.    1    11    0    1    
    22.    1    11    1    0    
    23.    1    12    0    1    
    24.    1    12    1    0    
    25.    1    13    0    0    
    26.    1    13    1    1    
    27.    1    14    0    0    
    28.    1    14    1    1    
    29.    1    15    0    1    
    30.    1    15    1    0    
    31.    1    16    0    0    
    32.    1    16    1    1    
    33.    1    17    0    1    
    34.    1    17    1    0    
    35.    1    18    0    1    
    36.    1    18    1    0    
    37.    1    19    0    1    
    38.    1    19    1    0
    I cannot use the -mixlogit- command because it only accepts the Halton as integration method that does not support than 20 coefficients. So, I decided to use the -cmxtmixlogit- command that allows the random method to alleviate the large numbers of coefficients. Here is my code:

    Code:
    cmxtmixlogit valu,                   ///
        random(ib1.PF#c.du           ///
                ib1.RL#c.du                ///
                ib1.SF#c.du                ///
                ib1.PA#c.du                ///
                ib1.MH#c.du               ///
                ib1.VT#c.du                ///
                 c.du, normal)             ///
                    intmethod(random) tech() intpoints() intseed() favor()
    Unfortunately, I got this error message:

    Code:
    Fitting fixed parameter model:
    
    Fitting full model:
    _ASMIX_lgprime():  3301    subscript invalid
    _ASMIX_setup():     -    function returned    error
    <istmt>:     -    function returned    error
    r(3301);
    Does anyone know something about it? I didn't found any cues. It seems that it is linked to the technical capacities of Stata.

    Many thanks,

    GM

  • #2
    It looks as though your Stata is not up to date. Please open a fresh Stata instance and enter
    Code:
    update query
    then follow the instructions on the screen. Once updated, try to run your code again. The behavior you observe is likely due to a problem that has since been fixed. In Stata, enter
    Code:
    help whatsnew17
    and look for item 4 under update 08mar2023.

    Comment


    • #3
      Originally posted by Joerg Luedicke (StataCorp) View Post
      It looks as though your Stata is not up to date. Please open a fresh Stata instance and enter
      Code:
      update query
      then follow the instructions on the screen. Once updated, try to run your code again. The behavior you observe is likely due to a problem that has since been fixed. In Stata, enter
      Code:
      help whatsnew17
      and look for item 4 under update 08mar2023.
      Hi Joerg,

      Thanks a lot, it perfectly works! I never looked at the Stata updates... Hope this post will help other Stata users.

      Best,

      Gabin

      Comment

      Working...
      X