Announcement

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

  • Plotting predicted probabilities for alternative-specific variables with asclogit

    Dear all,

    I am trying to estimate the change in the predicted probability of selecting an outcome for different values of an alternative-specific variable after asclogit. That is, I want to estimate how likely it is than an outcome is selected at different values of a continous alternative specific variable. I know how to do this for case-specific variables but I cannot do it for alternative-specific variables.

    Here you have an example of how I am trying to do it with the "choice" example dataset. In this case I would like to estimate the probability of an outcome being selected for different values of the alternative-specific variable dealer, which ranges between 1 and 24. The way I am doing it is the following:

    Code:
    webuse choice, clear
    asclogit choice dealer, case(id) alternatives(car) casevars(sex)
    
    drop _all
    set obs 24
    gen sex = 0.73            // set sex to its mean value
    gen dealer = _n        // create values for dealer from 1 to 24
    gen id = _n                // create case id
    
    expand 3
    sort id
    by id: gen car = _n
    label values car nation
    
    predict p
    However, when I do this the predicted probabilities are the same for each of the three possible outcomes at each level of the variable dealer. Here you see the first part of the dataset that is created to estimate the predicted probabilities with the predicted probabilities in the last column.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(sex dealer id car p)
    .73 1 1 1 .52017343
    .73 1 1 2 .27786776
    .73 1 1 3  .2019588
    .73 2 2 1 .52017343
    .73 2 2 2 .27786776
    .73 2 2 3  .2019588
    .73 3 3 1 .52017343
    .73 3 3 2 .27786776
    .73 3 3 3  .2019588
    .73 4 4 1 .52017343
    .73 4 4 2 .27786776
    .73 4 4 3  .2019588
    .73 5 5 1 .52017343
    .73 5 5 2 .27786776
    .73 5 5 3  .2019588
    .73 6 6 1 .52017343
    .73 6 6 2 .27786776
    .73 6 6 3  .2019588
    .73 7 7 1 .52017343
    .73 7 7 2 .27786776
    .73 7 7 3  .2019588
    .73 8 8 1 .52017343
    .73 8 8 2 .27786776
    .73 8 8 3  .2019588
    end
    label values car nation
    label def nation 1 "American", modify
    label def nation 2 "Japan", modify
    label def nation 3 "Europe", modify

    Is there a way to do this or it is simply impossible/incorrect to estimate predicted probabilities for alternative-specific variables?




  • #2
    If all three observations in each case have the same value for the dealer, it's hard to see how it can affect the decision between the three alternatives, unless in the model (that you have not shown us) there is some sort of interaction between dealer and car or dealer and sex.

    Perhaps what you want is 2 (0/1) sexes times 3 (America/Japan/Europe) cases each with 24 dealer choices?

    Comment


    • #3
      Dear William,

      Thanks for your answer. The results of the model are the following:

      Code:
      . webuse choice, clear
      
      . asclogit choice dealer, case(id) alternatives(car) casevars(sex)
      
      Iteration 0:   log likelihood = -276.83154  
      Iteration 1:   log likelihood = -257.34659  
      Iteration 2:   log likelihood = -255.55681  
      Iteration 3:   log likelihood =  -255.5512  
      Iteration 4:   log likelihood =  -255.5512  
      
      Alternative-specific conditional logit         Number of obs      =        885
      Case variable: id                              Number of cases    =        295
      
      Alternative variable: car                      Alts per case: min =          3
                                                                    avg =        3.0
                                                                    max =          3
      
                                                        Wald chi2(3)    =       7.19
      Log likelihood =  -255.5512                       Prob > chi2     =     0.0661
      
      ------------------------------------------------------------------------------
            choice |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      car          |
            dealer |   .0436522   .0329333     1.33   0.185     -.020896    .1082003
      -------------+----------------------------------------------------------------
      American     |  (base alternative)
      -------------+----------------------------------------------------------------
      Japan        |
               sex |  -.6390918   .3105483    -2.06   0.040    -1.247755   -.0304283
             _cons |  -.1604799   .4730256    -0.34   0.734    -1.087593    .7666333
      -------------+----------------------------------------------------------------
      Europe       |
               sex |   .4242441   .4496724     0.94   0.345    -.4570977    1.305586
             _cons |  -1.255797   .6455486    -1.95   0.052    -2.521049    .0094554
      ------------------------------------------------------------------------------
      What I would like to estimate is the predicted probability of selecting an outcome (in this case choosing a car) at different values of the dealer variable, which ranges between 1 and 24.

      Comment

      Working...
      X