Announcement

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

  • Interpretation of AMEs (average marginal effects) for continuous variables

    Hi,

    I am using a panel dataset (N=237 and T=13).
    vote is my dependent variable: 1 if the respondent voted in an annual leadership election, and 0 otherwise (so I am using nonlinear methods: xtprobit).

    Please could you help me to understand the interpretation of the AME?
    For example, for age, the AME is 0.0028.
    Does this mean that, as age increases, the likelihood of voting increases by 0.28% points?

    Thanks in advance

  • #2
    Yes, correct. On average, a one-unit increase in age increases the probability of respondent voting in annual leadership election by 0.28 percentage points.

    Comment


    • #3
      I know that economists love AMEs for continuous variables but I don't. Here is my attempt to explain them:

      http://www3.nd.edu/~rwilliam/xsoc73994/Margins02.pdf

      Personally I prefer commands like the user-written mcp for illustrating the effects of continuous variables (although I have never tried it after an XT command; hopefully it works). See

      http://www.stata-journal.com/sjpdf.h...iclenum=gr0056

      My summary of the command is at

      http://www3.nd.edu/~rwilliam/xsoc73994/Margins03.pdf
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 16.1MP (2 processor)

      EMAIL: rwilliam@ND.Edu
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Yes, correct. On average, a one-unit increase in age increases the probability of respondent voting in annual leadership election by 0.28 percentage points.
        No, I don't agree with that; or I would say that, it might be more or less true sometimes, but not others. See the first handout I just linked to.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 16.1MP (2 processor)

        EMAIL: rwilliam@ND.Edu
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Sort of. What it literally means is that the average value of the first derivative of the probability of voting with respect to age is 0.0028.

          From that, if the marginal effect remained constant over a 1 unit (year, I suppose) interval of age, then the probability of voting would increase by 0.28%.

          But the marginal effect does not remain constant. Probit is a non-linear function, so the marginal effect actually does vary for all values of age. Depending on where along the probit curve you are, the marginal effect might be nearly constant, or might be rapidly changing.

          Moreover, the AME is an average over many values of age observed in your data set, so it does not represent the actual marginal effect at any particular value of age (or, rather, if it does so, it is by coincidence.)

          With a probit model, in my opinion, it is best not to estimate an average marginal effect. Better, I think is to select a range of interesting/important values of age and estimate the marginal effects at those values of age (using the -at()- option in your -margins- command). At least that way we are talking about a true marginal effect corresponding to some actual value(s) of age. Once we have that, it is important to just call it a marginal effect. It is common casual usage to say that a marginal effect of 0.0028 means the expected outcome increases by 0.0028 with a unit increase of 1 unit of age--but that is no more true than it would be to say that in the next hour we will travel 80 kilometers based on the fact that at this instant our speedometer reading is 80 km/hr.

          Added: Crosed with #2, #3, and #4.

          Comment


          • #6
            Clyde puts it well. The other thing I will add is that how close an approximation the AME is to the effect of a 1 unit change depends on how the variable is scaled. If age is measured in years, it might not be too bad, at least for parts of the possible range (e.g. the more or less linear part of the S curve). But if age is measured in centuries, it could be a terrible approximation. Put another way, if the continuous variable only ranges from 0 to .10, then a 1 unit change would be enormous and the AME may not be all that useful.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            Stata Version: 16.1MP (2 processor)

            EMAIL: rwilliam@ND.Edu
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              Incidentally, Clyde recommends margins with at() commands while I recommend mcp. It is really the same advice; mcp is basically a shell for margins that, in my opinion, makes many tasks easier. But you can get the same results either way.
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              Stata Version: 16.1MP (2 processor)

              EMAIL: rwilliam@ND.Edu
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Originally posted by Richard Williams View Post
                I know that economists love AMEs for continuous variables but I don't. Here is my attempt to explain them:

                http://www3.nd.edu/~rwilliam/xsoc73994/Margins02.pdf

                Personally I prefer commands like the user-written mcp for illustrating the effects of continuous variables (although I have never tried it after an XT command; hopefully it works). See

                http://www.stata-journal.com/sjpdf.h...iclenum=gr0056

                My summary of the command is at

                http://www3.nd.edu/~rwilliam/xsoc73994/Margins03.pdf
                Thank you for your reply Richard Williams - I see now that I should treat continuous variables differently to how I would interpret discrete variables.
                The links you provided have been very useful in understanding this better.
                I wanted to try the commands but they don't seem to be working (I use Stata/SE 14.2). Do you know how I can use them please?
                Code:
                . xtprobit vote gender age i.year, re nolog
                
                
                ------------------------------------------------------------------------------
                      vote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                      gender |   .7376857   .2504018     2.95   0.003     .2469072    1.228464
                         age |  -.0040221   .0078515    -0.51   0.608    -.0194107    .0113665
                       _cons |  -.5646226   .4857567    -1.16   0.245    -1.516688    .3874431
                -------------+----------------------------------------------------------------
                    /lnsig2u |   .5637856   .1298675                      .3092501    .8183212
                -------------+----------------------------------------------------------------
                     sigma_u |   1.325637   .0860785                       1.16722    1.505553
                         rho |    .637328   .0300177                      .5767022    .6938799
                ------------------------------------------------------------------------------
                LR test of rho=0: chibar2(01) = 1098.87                Prob >= chibar2 = 0.000
                
                
                
                . margins, dydx(age)
                
                Average marginal effects                        Number of obs     =      2,130
                Model VCE    : OIM
                
                Expression   : Pr(vote=1), predict(pr)
                dy/dx w.r.t. : age
                
                ------------------------------------------------------------------------------
                             |            Delta-method
                             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                         age |  -.0009769   .0017609    -0.55   0.579    -.0044282    .0024743
                ------------------------------------------------------------------------------
                
                
                . mcp age, show
                command mcp is unrecognized
                r(199);
                
                
                . ssc install mcp
                ssc install: "mcp" not found at SSC, type search mcp
                (To find all packages at SSC that start with m, type ssc describe m)
                r(601);
                
                
                . marginscontplot
                command marginscontplot is unrecognized
                r(199);
                
                . ssc install marginscontplot
                ssc install: "marginscontplot" not found at SSC, type search marginscontplot
                (To find all packages at SSC that start with m, type ssc describe m)
                r(601);

                Comment


                • #9
                  Originally posted by Clyde Schechter View Post
                  Sort of. What it literally means is that the average value of the first derivative of the probability of voting with respect to age is 0.0028.

                  From that, if the marginal effect remained constant over a 1 unit (year, I suppose) interval of age, then the probability of voting would increase by 0.28%.

                  But the marginal effect does not remain constant. Probit is a non-linear function, so the marginal effect actually does vary for all values of age. Depending on where along the probit curve you are, the marginal effect might be nearly constant, or might be rapidly changing.

                  Moreover, the AME is an average over many values of age observed in your data set, so it does not represent the actual marginal effect at any particular value of age (or, rather, if it does so, it is by coincidence.)

                  With a probit model, in my opinion, it is best not to estimate an average marginal effect. Better, I think is to select a range of interesting/important values of age and estimate the marginal effects at those values of age (using the -at()- option in your -margins- command). At least that way we are talking about a true marginal effect corresponding to some actual value(s) of age. Once we have that, it is important to just call it a marginal effect. It is common casual usage to say that a marginal effect of 0.0028 means the expected outcome increases by 0.0028 with a unit increase of 1 unit of age--but that is no more true than it would be to say that in the next hour we will travel 80 kilometers based on the fact that at this instant our speedometer reading is 80 km/hr.

                  Added: Crosed with #2, #3, and #4.
                  Clyde Schechter thank you for your advice. Reading your explanation, it seems better to not compute the AME.
                  How should I find interesting values of age - should I plot a graph, or is there a Stata command which identifies important values?

                  I see now that the ME varies for different ages:

                  Code:
                   . margins, dydx(age)at (age=43)
                  
                  Average marginal effects                        Number of obs     =      3,053
                  Model VCE    : OIM
                  
                  Expression   : Pr(vote=1), predict(pr)
                  dy/dx w.r.t. : age
                  at           : age             =          43
                  
                  ------------------------------------------------------------------------------
                               |            Delta-method
                               |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                           age |  -.0009334   .0018366    -0.51   0.611    -.0045331    .0026663
                  ------------------------------------------------------------------------------
                  
                  . margins, dydx(age)at (age=91)
                  
                  Average marginal effects                        Number of obs     =      3,053
                  Model VCE    : OIM
                  
                  Expression   : Pr(vote=1), predict(pr)
                  dy/dx w.r.t. : age
                  at           : age             =          91
                  
                  ------------------------------------------------------------------------------
                               |            Delta-method
                               |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                           age |  -.0009066   .0017286    -0.52   0.600    -.0042946    .0024814
                  ------------------------------------------------------------------------------
                  Would you be able to tell me why the following returns an error please?
                  Code:
                  . xtprobit vote gender age i.year, re nolog
                  
                  . margins, dydx(age)at (age=25(5)50)
                  (5) invalid statistic
                  r(198);

                  Comment


                  • #10
                    You can tell what is interesting, a computer cannot. So just think about the problem and find values that you find interesting, i.e. help you answer your research question.

                    The option should be at(something) not at (something) (notice the space), so try:
                    Code:
                     
                     margins, dydx(age) at(age=25(5)50)
                    ---------------------------------
                    Maarten L. Buis
                    University of Konstanz
                    Department of history and sociology
                    box 40
                    78457 Konstanz
                    Germany
                    http://www.maartenbuis.nl
                    ---------------------------------

                    Comment


                    • #11
                      Try the following
                      Code:
                      margins, dydx(age)  at(age = (25(5)50) )
                      According to help margins, the numlist in the at() statement needs to be bound by parentheses. The spaces you had between "at" and "(" might have caused a problem too.

                      Comment


                      • #12
                        Let me add that since in post #8 the ssc command reported that mcp and marginscontplot are not located at SSC, the next step is to use the search mcp command which will tell you that it is a Stata Journal command and provide links to the description, from which you will be able to install it.

                        Comment


                        • #13
                          Maarten Buis, I will look into this and consider the most significant ages theoretically

                          Stephen Jenkins, the additional parentheses solved the issue
                          Code:
                          margins, dydx(age) at(age = (25(5)50) )
                          William Lisowski, that helped me to install the correct files so that -marginscontplot- works now

                          Thank you all very much for your help!

                          Comment


                          • #14
                            Originally posted by Richard Williams View Post
                            I know that economists love AMEs for continuous variables but I don't. Here is my attempt to explain them:

                            http://www3.nd.edu/~rwilliam/xsoc73994/Margins02.pdf

                            Personally I prefer commands like the user-written mcp for illustrating the effects of continuous variables (although I have never tried it after an XT command; hopefully it works). See

                            http://www.stata-journal.com/sjpdf.h...iclenum=gr0056

                            My summary of the command is at

                            http://www3.nd.edu/~rwilliam/xsoc73994/Margins03.pdf
                            Dear Richard,
                            Unfortunately, -mcp-cannot work after -xt-. Maybe because we need -predict- option for using -margins- after -xt-.
                            -mcp- is really helpful and simplifies a lot of work. Please let us know if there is any way we can still use -mcp- after -xt- instead of using -margins- and -marginsplot-.

                            Comment


                            • #15
                              Originally posted by Clyde Schechter View Post
                              Sort of. What it literally means is that the average value of the first derivative of the probability of voting with respect to age is 0.0028.

                              From that, if the marginal effect remained constant over a 1 unit (year, I suppose) interval of age, then the probability of voting would increase by 0.28%.

                              But the marginal effect does not remain constant. Probit is a non-linear function, so the marginal effect actually does vary for all values of age. Depending on where along the probit curve you are, the marginal effect might be nearly constant, or might be rapidly changing.

                              Moreover, the AME is an average over many values of age observed in your data set, so it does not represent the actual marginal effect at any particular value of age (or, rather, if it does so, it is by coincidence.)

                              With a probit model, in my opinion, it is best not to estimate an average marginal effect. Better, I think is to select a range of interesting/important values of age and estimate the marginal effects at those values of age (using the -at()- option in your -margins- command). At least that way we are talking about a true marginal effect corresponding to some actual value(s) of age. Once we have that, it is important to just call it a marginal effect. It is common casual usage to say that a marginal effect of 0.0028 means the expected outcome increases by 0.0028 with a unit increase of 1 unit of age--but that is no more true than it would be to say that in the next hour we will travel 80 kilometers based on the fact that at this instant our speedometer reading is 80 km/hr.

                              Added: Crosed with #2, #3, and #4.
                              Dear All:
                              For interpreting the odd ratio (for nonlinear model) and AME/MEM better, can we change the unit of measurement of variables? Say, if I use pgdp(=gdp/population), which is a ratio, one-unit-change of pgdp would be meaningless. So, can I use pgdp*100 instead?
                              I tried this idea with my data, using -xtlogit,fe-, and get these result: (1) signs don't change (2)new coefficient=old one*100.
                              This idea might not be right in the first place, since I am using nonlinear model. Even if it's right, I cannot understand why the new coefficients are 100 times large instead of 100 times smaller...

                              Comment

                              Working...
                              X