Announcement

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

  • Firthlogit postestimation

    Hello,
    I'll need help with the estimation of marginal effects using firthlogit.

    I'm working with dummy as dependent variable that has an inflated number of 0 over 1 (almost 90%).
    I'm using the firthlogit to implement a penalized maximum likelihood estimation method for reducing bias in the distribution suggested by Coveney (2015).
    However when I tried to estimate marginal effects but the results are very weird.

    For instance, Odd ratios from estimations in are positive but marginal effect comes all negative.

    Thanks



  • #2
    Odds ratios are always positive. The "null value" of the odds ratio is 1, not 0. Odds ratios < 1 correspond to negative marginal effects, those > 0 correspond to positive marginal effects.

    If your outputs appear to contradict that, then to get more concrete advice, please post back showing the actual output of both -firthlogit- and -margins- along with the commands you used to get those. In doing that, please be sure to place the output between code delimiters so that it is easily readable. If you are not familiar with using code delimiters, you will find them explained in Forum FAQ #12.

    Comment


    • #3
      Questions like this come up periodically. The results are probably fine, you are just misinterpreting what they are. See especially posts 4 and 5 of

      https://www.statalist.org/forums/for...hood-estimates
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

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

      Comment


      • #4
        Thank you all for the feed back.
        I manage to solve the issue using ​​​​​​:

        Code:
        margins Variable, expression(invlogit(predict(xb)))

        Comment


        • #5
          For more on analyzing rare events, you might want to see

          https://www3.nd.edu/~rwilliam/stats3/RareEvents.pdf
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

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

          Comment


          • #6
            Hi Richard. Just a question: why might I want to use the xb over pr after a firthlogit (e.g. firthlogit y x1 x2 x3) regression command? I am in a similar boat as OP and need some feedback. My main issue is that I am not sure if I should be using the regular margins command after firthlogit versus adding the express xb (for predicting if Y=1). My Y is a binary variable, as well as both my independent (main variables). Examples of what I see are the following:

            When I type the written command:

            Code:
             margins, dydx(gangm) expression(invlogit(predict(xb)))
            I get this output:

            Code:
            Average marginal effects                        Number of obs     =     23,919
            Model VCE    : OIM
            
            Expression   : invlogit(predict(xb))
            dy/dx w.r.t. : gangm
            
            ------------------------------------------------------------------------------
                         |            Delta-method
                         |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                   gangm |   .0362728   .0170578     2.13   0.033       .00284    .0697055
            ------------------------------------------------------------------------------
            When I type the regular, command

            Code:
             margins, dydx(gangm)
            I get this output (below), which is completely separate from when I include the (invlogit(predict(xb)))

            Code:
            Average marginal effects                        Number of obs     =     23,919
            Model VCE    : OIM
            
            Expression   : Linear prediction, predict()
            dy/dx w.r.t. : 1.gangm
            
            ------------------------------------------------------------------------------
                         |            Delta-method
                         |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                   gangm |
                    YES  |   .1707991   .0803539     2.13   0.034     .0133084    .3282898
            ------------------------------------------------------------------------------
            Note: dy/dx for factor levels is the discrete change from the base level.
            For context, I have provided a picture of my model. Any feedback is appreciated.

            Code:
            firthlogit report i.gangm intim3 i.vrace i.gender i.landtype i.V2127B
            
            initial:       penalized log likelihood = -15636.338
            rescale:       penalized log likelihood = -15636.338
            Iteration 0:   penalized log likelihood = -15636.338  
            Iteration 1:   penalized log likelihood = -14384.739  
            Iteration 2:   penalized log likelihood = -14218.414  
            Iteration 3:   penalized log likelihood = -14184.754  
            Iteration 4:   penalized log likelihood = -14178.379  
            Iteration 5:   penalized log likelihood = -14177.756  
            Iteration 6:   penalized log likelihood =  -14177.72  
            Iteration 7:   penalized log likelihood =  -14177.72                                                   Number of obs     =     23,919
                                                            Wald chi2(13)     =     113.78
            Penalized log likelihood =  -14177.72           Prob > chi2       =     0.0000
            
            -------------------------------------------------------------------------------------------------
                                     report |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            --------------------------------+----------------------------------------------------------------
                                      gangm |
                                       YES  |   .1707991   .0803539     2.13   0.034     .0133084    .3282898
                                     intim3 |  -8.328734   1.414964    -5.89   0.000    -11.10201   -5.555456
                                            |
                                      vrace |
                                     BLACK  |   .1322671   .0438009     3.02   0.003     .0464189    .2181153
                         AM/ ALASKA NATIVE  |  -.0211212   .1271436    -0.17   0.868    -.2703181    .2280757
                                     ASIAN  |    -.00106   .0968429    -0.01   0.991    -.1908686    .1887486
                           HAWAIIAN,
                          PACIFIC ISLANDER  |  -.1307301   .2592881    -0.50   0.614    -.6389255    .3774653
                                     OTHER  |  -.0839671   .0839718    -1.00   0.317    -.2485487    .0806145
                                  HISPANIC  |   .0880073   .0447727     1.97   0.049     .0002543    .1757602
                                            |
                                     gender |
                                    FEMALE  |   .1152622   .0333234     3.46   0.001     .0499496    .1805747
                                            |
                                   landtype |
                                     RURAL  |   .1329574   .0386626     3.44   0.001       .05718    .2087348
                                            |
                                     V2127B |
                                   Midwest  |   .0342033   .0470017     0.73   0.467    -.0579183     .126325
                                     South  |   .1370015   .0456354     3.00   0.003     .0475577    .2264453
                                      West  |   -.059097   .0473682    -1.25   0.212    -.1519369    .0337429
                                            |
                                      _cons |  -.5266472   .0473121   -11.13   0.000    -.6193773   -.4339171
            Last edited by Jason Campos; 02 May 2021, 20:10.

            Comment

            Working...
            X