Announcement

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

  • (Generalized) Ordered Logit marginal effects

    Dear Statalist,

    I'm having trouble to derive marginal effects after computing a Generalized Ordered Logit (correcting by the parallel-lines assumption violated using the gologit2 command).

    I have three levels (1, 2 and 3) of my response variable, then, after running the gologit2 command with the autofit lrforce option, the output gives me the estimates of the cumulative effects (1 vs 2 and 3; and 1 and 2 vs 3).

    This is a sample of how the output looks like:

    HTML Code:
    gologit2  response pop_density pp_college pp_no_citizen pp_no_car income_Gini, autofit lrforce
    
    ------------------------------------------------------------------------------
    Testing parallel lines assumption using the .05 level of significance...
    
    Step  1:  Constraints for parallel lines imposed for pp_no_citizen (P Value = 0.8867)
    Step  2:  Constraints for parallel lines imposed for income_Gini (P Value = 0.7025)
    Step  3:  Constraints for parallel lines are not imposed for
              pop_density (P Value = 0.04162)
              pp_college (P Value = 0.00746)
              pp_no_car (P Value = 0.02939)
    
    Wald test of parallel lines assumption for the final model:
    
     ( 1)  [1]pp_no_citizen - [2]pp_no_citizen = 0
     ( 2)  [1]income_Gini - [2]income_Gini = 0
    
               chi2(  2) =    0.17
             Prob > chi2 =    0.9203
    
    An insignificant test statistic indicates that the final model
    does not violate the proportional odds/ parallel lines assumption
    
    If you re-estimate this exact same model with gologit2, instead
    of autofit you can save time by using the parameter
    
    pl(pp_no_citizen income_Gini)
    
    ------------------------------------------------------------------------------
    
    Generalized Ordered Logit Estimates               Number of obs   =       1182
                                                      LR chi2(8)      =     223.80
                                                      Prob > chi2     =     0.0000
    Log likelihood =  -1056.791                       Pseudo R2       =     0.0957
    
     ( 1)  [1]pp_no_citizen - [2]pp_no_citizen = 0
     ( 2)  [1]income_Gini - [2]income_Gini = 0
    -------------------------------------------------------------------------------
         response |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    1             |
      pop_density |  -.0005147   .0002311    -2.23   0.026    -.0009676   -.0000619
       pp_college |  -.0821576   .0159082    -5.16   0.000    -.1133371   -.0509781
    pp_no_citizen |   .0412044   .0049467     8.33   0.000      .031509    .0508997
        pp_no_car |   .0312774   .0307727     1.02   0.309    -.0290359    .0915907
      income_Gini |   2.607472   2.304695     1.13   0.258    -1.909648    7.124592
            _cons |  -2.476667   .8911029    -2.78   0.005    -4.223196   -.7301372
    --------------+----------------------------------------------------------------
    2             |
      pop_density |  -.0033817   .0014051    -2.41   0.016    -.0061356   -.0006278
       pp_college |  -.1726428   .0338568    -5.10   0.000     -.239001   -.1062847
    pp_no_citizen |   .0412044   .0049467     8.33   0.000      .031509    .0508997
        pp_no_car |  -.0691822   .0464367    -1.49   0.136    -.1601966    .0218321
      income_Gini |   2.607472   2.304695     1.13   0.258    -1.909648    7.124592
            _cons |  -3.368429   .9342685    -3.61   0.000    -5.199562   -1.537297
    -------------------------------------------------------------------------------


    Finally, to derive the marginal effects, I'm using the margins command as follows:

    HTML Code:
    margins, dydx(*) predict(xb)
    
    Average marginal effects                          Number of obs   =       1182
    Model VCE    : OIM
    
    Expression   : Linear prediction, response==1, predict(xb)
    dy/dx w.r.t. : pop_density pp_college pp_no_citizen pp_no_car income_Gini
    
    -------------------------------------------------------------------------------
                  |            Delta-method
                  |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
      pop_density |  -.0005147   .0002311    -2.23   0.026    -.0009676   -.0000619
       pp_college |  -.0821576   .0159082    -5.16   0.000    -.1133371   -.0509781
    pp_no_citizen |   .0412044   .0049467     8.33   0.000      .031509    .0508997
        pp_no_car |   .0312774   .0307727     1.02   0.309    -.0290359    .0915907
      income_Gini |   2.607472   2.304695     1.13   0.258    -1.909648    7.124592
    -------------------------------------------------------------------------------

    My question is: How can I derive the corresponding marginal effects of the Generalized Ordered Logit model of the first table, e.g., two different sets of marginal per explanatory variable (1 vs 2 and 3; and 1 and 2 vs 3)? As far as I can see the margins command (second table) is computing average values which are the same for every level of the response variable.

    Thanks in advance.
    Last edited by Francisco Benita; 19 Aug 2019, 08:21.

  • #2
    Welcome to Statalist.

    What version of Stata are you using? Margins got better with multiple-outcome commands in V. 14. Also, why use XB? XB will just give you the original coefficients back.

    This handout will hopefully be helpful. If you are condemned to using Stata 13 or earlier, the appendix shows how to modify margins commands.

    https://www3.nd.edu/~rwilliam/xsoc73994/Margins05.pdf

    Also make sure you have the latest version of gologit2, available from SSC:

    Code:
    . which gologit2
    c:\ado\plus\g\gologit2.ado
    *! version 3.2.5 17may2019 Richard Williams, [email protected]
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Thank you for your kind response Prof. Williams, I'm working with Stata 14 and version 3.2.5 17may2019 of your command gologit2. I think I got a bit confused with the correct use of the margins command. I basically would like to compute the marginal effects corresponding to my original table 1 (the one that has two sets of coefficients, one for response=1 and response=2). After running the autofit lrforce option what I have are cumulative effects relative between groups.

      If I run margins, dydx(*) I get:

      HTML Code:
      margins, dydx(*)
      
      Average marginal effects                        Number of obs     =      1,182
      Model VCE    : OIM
      
      dy/dx w.r.t. : pop_density pp_college pp_no_citizen pp_no_car income_Gini
      1._predict   : Pr(response==1), predict(pr outcome(1))
      2._predict   : Pr(response==2), predict(pr outcome(2))
      3._predict   : Pr(response==3), predict(pr outcome(3))
      
      -------------------------------------------------------------------------------
                    |            Delta-method
                    |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      pop_density   |
           _predict |
                 1  |   .0001113   .0000496     2.24   0.025     .0000141    .0002084
                 2  |   .0002276   .0001451     1.57   0.117    -.0000567    .0005119
                 3  |  -.0003389   .0001402    -2.42   0.016    -.0006137   -.0000641
      --------------+----------------------------------------------------------------
      pp_college    |
           _predict |
                 1  |   .0177607   .0032931     5.39   0.000     .0113062    .0242151
                 2  |  -.0004614    .004019    -0.11   0.909    -.0083385    .0074157
                 3  |  -.0172993   .0033288    -5.20   0.000    -.0238236    -.010775
      --------------+----------------------------------------------------------------
      pp_no_citizen |
           _predict |
                 1  |  -.0089075   .0009733    -9.15   0.000    -.0108152   -.0069998
                 2  |   .0047787   .0005671     8.43   0.000     .0036671    .0058903
                 3  |   .0041288   .0005285     7.81   0.000     .0030929    .0051647
      --------------+----------------------------------------------------------------
      pp_no_car     |
           _predict |
                 1  |  -.0067615   .0066402    -1.02   0.309    -.0197761    .0062531
                 2  |   .0136937   .0066687     2.05   0.040     .0006233    .0267641
                 3  |  -.0069323   .0046527    -1.49   0.136    -.0160514    .0021869
      --------------+----------------------------------------------------------------
      income_Gini   |
           _predict |
                 1  |  -.5636791    .497252    -1.13   0.257    -1.538275     .410917
                 2  |   .3024029   .2669899     1.13   0.257    -.2208877    .8256935
                 3  |   .2612761   .2312865     1.13   0.259    -.1920371    .7145894
      -------------------------------------------------------------------------------

      which are the predicted marginal effects at each level of response, but they do not match the results from the first table (1 vs 2 and 3; and 1 and 2 vs 3). I would appreciate any hints on this problem – thanks!


      Comment


      • #4
        Francisco, I'm afraid I don't understand the question. What is it that is not matching? How can you even tell that they are not matching? As far as I know, all your results are fine, but I am not sure what you think the problem is, and why.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          In the very first table, you can see that the coefficients for pp_no_car are 0.0312774 (for response=1), and -0.0691822 (for response=2). Hence, I would expect their respective marginal effects being positive (for response=1) and negative (for response=2). The table above/below shows the results after using margins, dydx(*) which gives:

          HTML Code:
          --------------+----------------------------------------------------------------
          pp_no_car     |
               _predict |
                     1  |  -.0067615   .0066402    -1.02   0.309    -.0197761    .0062531
                     2  |   .0136937   .0066687     2.05   0.040     .0006233    .0267641
                     3  |  -.0069323   .0046527    -1.49   0.136    -.0160514    .0021869
          --------------+----------------------------------------------------------------
          
          You can notice that the signs do not correspond with expected ones because in this case the marginal effect for response=1 is negative (-.0067615) and for response=2 is positive (.0136937). This is why I'm getting confused and this is why I refer as the margins do not match. I'm convinced I'm doing something wrong here but so far I haven't been able to figure it out. My apology for the confusion and thank you again for your time.

          Comment


          • #6
            Your interpretation might be right if using mlogit but it isn’t right for gologit. A positive coefficient for x means that increases in x make it more likely that someone will be in a higher category than the current one. A negative coefficient means that increases in x increase the probability the person will be in the current category or a lower one.

            In short, your interpretation of the coefficients is exactly the opposite of what it should be. People get confused because gologit output looks like mlogit output but the interpretations are very different.

            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            Stata Version: 17.0 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              Thank you for the clarification. I'll take a closer look at it as well as the materials you provide.

              Comment

              Working...
              X