Announcement

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

  • Random Parameters Logit Model in Stata with ONLY case-specific variables (no alternative-specific independent variables)

    Dear All,

    I would like to model the severity of traffic crashes using a multinomial logit model with random parameters (also known as mixed logit model or random parameters logit model), testing for heterogeneous means and variances or correlated parameters.


    My data (severity of traffic crashes (dependent variable) and the independent variables) is characterized by:

    *The dependent variable is the level of severity (eg, no injury, minor injury, severe injury)

    *Multinomial logit models have been used extensively, but they are not able to deal with unobserved heterogeneity (that is the reason for using mixed logit models).

    *It is cross-sectional data (not panel data). There is only one observation for each traffic crash.

    *If considered as choice models (other software uses this approach, considering the level of severity as different choices) there are not alternative-specific independent variables. All independent variables are case-specific variables and consist of a set of individual specific characteristics for each crash, such as driver’s age, type of crash, gender, etc.

    *ALL independent case-specific variables are dummy

    *No multilevel structure


    I know that it is possible estimate the models with NLOGIT 6, but I am struggling looking for the possibility of using Stata 16. I have investigated several commands (eg., melogit, cmmixlogit, xtmelogit, mixlogit, cmxtmixlogit, etc). However, I have not been able to estimate my model yet.

    Any help would be welcome. Also, if anybody knows that this is not possible in Stata, please, let me know.

    Best

    Juan

  • #2
    It is possible to estimate such a model, though my guess is that empirical identification of the model is likely to be fragile. Algebraically, models with "case-specific" independent variables can be viewed as a special case of models with "alternative-specific" independent variables. Using this relationship, you can proceed as in the toy example below:

    Code:
    // load data and drop observations with missing dependent variable values
    webuse sysdsn1, clear
    drop if missing(insure)
    
    // -mlogit-
    mlogit insure age male
    tab insure, nolabel
    
    // expand the data so that we can use -clogit- to replicate -mlogit-
    gen int group = _n
    expand 3
    sort group, stable
    
    // generate alternative indicator
    by group: gen int alt = _n
    
    // generate choice indicator
    gen int choice = [insure == alt]
    
    // convert "case-specific" independent variables into equivalent "alternative-specific" variables
    quietly tab alt, gen(alt)
    forvalues k = 1/3 {
        foreach v of varlist age male {
            gen double alt`k'_`v' = alt`k' * `v'
        }
    }
    
    // run -clogit- to replicate -mlogit-
    clogit choice alt2_age alt2_male alt2 alt3_age alt3_male alt3, group(group)
    
    // install Arne Risa Hole's mixlogit
    capture which mixlogit
    if (_rc != 0) ssc install mixlogit
    
    // run -mixlogit- to make the coefficient on age random
    mixlogit choice alt2_male alt2 alt3_male alt3, rand(alt2_age alt3_age) group(group)
    Last edited by Hong Il Yoo; 12 Dec 2020, 05:53.

    Comment


    • #3
      Dear Juan de Ona,

      I am also trying to model similar data using. Were you able to overcome the problems you encountered?

      Regards

      Comment

      Working...
      X