Announcement

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

  • Marginal effects in probit model - age and age2

    Hey everyone,

    I am doing probit regressions with Stata 14.1 and I want to get average marginal effects for the variables age and age squared. I tried two different ways:

    1)
    Code:
    probit y c.age c.age2 x3 x4 ...
    margins, dydx(*)
    2)
    Code:
    probit y c.age##c.age x3 x4 ...
    margins, dydx(*)
    In 1) i get two different results for age and age2, whereas I only have one result for age (in total) in 2).

    Why is there only one result in 2) and which notification would be appropriate to identfy an effect that is u-shaped for age?

    Thanks a for any suggestions! :-)

  • #2
    (1) is not legitimate. (2) is the way to go

    Code:
    . sysuse auto
    (1978 Automobile Data)
    
    . probit foreign c.mpg##c.mpg
    
    Iteration 0:   log likelihood =  -45.03321  
    Iteration 1:   log likelihood = -39.273692  
    Iteration 2:   log likelihood = -39.258883  
    Iteration 3:   log likelihood =  -39.25888  
    
    Probit regression                               Number of obs     =         74
                                                    LR chi2(2)        =      11.55
                                                    Prob > chi2       =     0.0031
    Log likelihood =  -39.25888                     Pseudo R2         =     0.1282
    
    ------------------------------------------------------------------------------
         foreign |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             mpg |   .0934728   .1933909     0.48   0.629    -.2855663    .4725119
                 |
     c.mpg#c.mpg |    .000054   .0039903     0.01   0.989    -.0077668    .0078748
                 |
           _cons |  -2.606064   2.261608    -1.15   0.249    -7.038733    1.826606
    ------------------------------------------------------------------------------
    
    
    . margins
    
    Predictive margins                              Number of obs     =         74
    Model VCE    : OIM
    
    Expression   : Pr(foreign), predict()
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _cons |   .2972403   .0486994     6.10   0.000     .2017913    .3926893
    ------------------------------------------------------------------------------
    
    
    . margins, at(mpg==21)
    
    Adjusted predictions                            Number of obs     =         74
    Model VCE    : OIM
    
    Expression   : Pr(foreign), predict()
    at           : mpg             =          21
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _cons |    .267857   .0630984     4.25   0.000     .1441864    .3915276
    ------------------------------------------------------------------------------

    Comment


    • #3
      Thanks for your reply!

      If I get one marginal effect for age and age2, how can I interpret this?

      My dependant variable is participation in further training. I get a negative average marginal effect for age and age2 (let's say -0.22), that is significant.

      Can I interpret like this: If age increases by one year, the probability of taking part in further training decreases c. p. on average by 0.22 percentage points.

      How is the quadratic term involved in this??

      Comment


      • #4
        The easiest way to do this is by using factor variable notation to do the estimate and then predictive margins as Stephen explained.
        margins, at(mpg=(21 22)) will give you the predicted value for mgp at 21 and 22. With a non-linear model (like profit) and a non-linear rhs variable (like x and x-squared) the impact of a one unit change will vary with the level of the change so you might want to do predictive margins for the entire range of your x variable.

        Comment


        • #5
          How is the quadratic term involved in this??
          -margins- understands factor variable notation, and so the prediction involved uses the correct formula -- based on all the terms in the model including main effect and its square. Phil's suggestion to look at the whole range can be accomplished by the following. Use the help for -margins- and -marginsplot- too.

          Code:
          . sysuse auto
          (1978 Automobile Data)
          
          . probit foreign c.mpg##c.mpg
          
          Iteration 0:   log likelihood =  -45.03321  
          Iteration 1:   log likelihood = -39.273692  
          Iteration 2:   log likelihood = -39.258883  
          Iteration 3:   log likelihood =  -39.25888  
          
          Probit regression                               Number of obs     =         74
                                                          LR chi2(2)        =      11.55
                                                          Prob > chi2       =     0.0031
          Log likelihood =  -39.25888                     Pseudo R2         =     0.1282
          
          ------------------------------------------------------------------------------
               foreign |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   mpg |   .0934728   .1933909     0.48   0.629    -.2855663    .4725119
                       |
           c.mpg#c.mpg |    .000054   .0039903     0.01   0.989    -.0077668    .0078748
                       |
                 _cons |  -2.606064   2.261608    -1.15   0.249    -7.038733    1.826606
          ------------------------------------------------------------------------------
          
          . su mpg
          
              Variable |        Obs        Mean    Std. Dev.       Min        Max
          -------------+---------------------------------------------------------
                   mpg |         74     21.2973    5.785503         12         41
          
          
          . margins, at(mpg=(12(1)41))
          
          Adjusted predictions                            Number of obs     =         74
          Model VCE    : OIM
          
          Expression   : Pr(foreign), predict()
          
          1._at        : mpg             =          12
          
          2._at        : mpg             =          13
          
          3._at        : mpg             =          14
          
          4._at        : mpg             =          15
          
          5._at        : mpg             =          16
          
          6._at        : mpg             =          17
          
          7._at        : mpg             =          18
          
          8._at        : mpg             =          19
          
          9._at        : mpg             =          20
          
          10._at       : mpg             =          21
          
          11._at       : mpg             =          22
          
          12._at       : mpg             =          23
          
          13._at       : mpg             =          24
          
          14._at       : mpg             =          25
          
          15._at       : mpg             =          26
          
          16._at       : mpg             =          27
          
          17._at       : mpg             =          28
          
          18._at       : mpg             =          29
          
          19._at       : mpg             =          30
          
          20._at       : mpg             =          31
          
          21._at       : mpg             =          32
          
          22._at       : mpg             =          33
          
          23._at       : mpg             =          34
          
          24._at       : mpg             =          35
          
          25._at       : mpg             =          36
          
          26._at       : mpg             =          37
          
          27._at       : mpg             =          38
          
          28._at       : mpg             =          39
          
          29._at       : mpg             =          40
          
          30._at       : mpg             =          41
          
          ------------------------------------------------------------------------------
                       |            Delta-method
                       |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   _at |
                    1  |   .0698902   .0746504     0.94   0.349     -.076422    .2162023
                    2  |   .0835187   .0721787     1.16   0.247     -.057949    .2249864
                    3  |   .0990725   .0685299     1.45   0.148    -.0352436    .2333887
                    4  |    .116667   .0641047     1.82   0.069     -.008976    .2423099
                    5  |   .1363935   .0595545     2.29   0.022     .0196688    .2531182
                    6  |   .1583141   .0557889     2.84   0.005     .0489699    .2676582
                    7  |   .1824554    .053839     3.39   0.001     .0769329    .2879779
                    8  |   .2088048   .0544779     3.83   0.000     .1020302    .3155794
                    9  |    .237306    .057782     4.11   0.000     .1240553    .3505567
                   10  |    .267857   .0630984     4.25   0.000     .1441864    .3915276
                   11  |   .3003093   .0694473     4.32   0.000      .164195    .4364236
                   12  |   .3344687   .0759274     4.41   0.000     .1856538    .4832836
                   13  |   .3700977   .0819112     4.52   0.000     .2095547    .5306407
                   14  |   .4069203   .0871062     4.67   0.000     .2361954    .5776452
                   15  |   .4446279   .0915651     4.86   0.000     .2651636    .6240922
                   16  |   .4828868   .0956674     5.05   0.000     .2953822    .6703914
                   17  |   .5213472   .1000482     5.21   0.000     .3252562    .7174381
                   18  |   .5596522   .1054493     5.31   0.000     .3529755     .766329
                   19  |   .5974484   .1124974     5.31   0.000     .3769575    .8179394
                   20  |   .6343952   .1214906     5.22   0.000     .3962781    .8725123
                   21  |    .670174   .1322935     5.07   0.000     .4108834    .9294645
                   22  |   .7044969   .1443857     4.88   0.000     .4215061    .9874876
                   23  |   .7371133   .1570025     4.69   0.000      .429394    1.044833
                   24  |   .7678156   .1692897     4.54   0.000     .4360139    1.099617
                   25  |   .7964425   .1804229     4.41   0.000     .4428201    1.150065
                   26  |   .8228804   .1896863     4.34   0.000     .4511021    1.194659
                   27  |   .8470642   .1965189     4.31   0.000     .4618943    1.232234
                   28  |   .8689745   .2005363     4.33   0.000     .4759305    1.262018
                   29  |   .8886344   .2015373     4.41   0.000     .4936284     1.28364
                   30  |   .9061053   .1994962     4.54   0.000     .5150999    1.297111
          ------------------------------------------------------------------------------
          
          
          . marginsplot
          
            Variables that uniquely identify margins: mpg
          Graph not shown here, but you'll see a non-linear relationship




          Comment


          • #6
            Thanks a lot to both of you!

            I did as you suggested.. the predictive margins and the marginsplot for the entire range of the age variable made the inversed u-shape clear.

            Comment

            Working...
            X