Announcement

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

  • Please help with the margins, dydx result of 12.29 interpretation

    Dear Statalist,

    I would appreciate your help interpreting my margins, dydx(*) output of 12.86.
    I am using a logit model as I have a binary dependent variable (if participants voted in favor of a particular policy). The independent variables in that specific regression are return (a continuous variable that indicates the stock market return) and another continuous variable that measures the participants' distance to the spectrum center.

    Code:
    logit vote diff return, vce(cluster CASE)
    
    Iteration 0:   log pseudolikelihood = -177.43585  
    Iteration 1:   log pseudolikelihood = -171.60007  
    Iteration 2:   log pseudolikelihood = -171.59334  
    Iteration 3:   log pseudolikelihood = -171.59334  
    
    Logistic regression                                     Number of obs =    257
                                                            Wald chi2(2)  =  10.94
                                                            Prob > chi2   = 0.0042
    Log pseudolikelihood = -171.59334                       Pseudo R2     = 0.0329
    
                                     (Std. err. adjusted for 136 clusters in CASE)
    ------------------------------------------------------------------------------
                 |               Robust
        vote | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
    diff     |   .0548298   .0374937     1.46   0.144    -.0186565     .128316
    return|   51.75872   19.76173     2.62   0.009     13.02643      90.491
     _cons|  -.3261903   .1789603    -1.82   0.068    -.6769461    .0245654
    ------------------------------------------------------------------------------

    Code:
    
    logit vote diff return, vce(cluster CASE) or
    
    Iteration 0:   log pseudolikelihood = -177.43585  
    Iteration 1:   log pseudolikelihood = -171.60007  
    Iteration 2:   log pseudolikelihood = -171.59334  
    Iteration 3:   log pseudolikelihood = -171.59334  
    
    Logistic regression                                     Number of obs =    257
                                                            Wald chi2(2)  =  10.94
                                                            Prob > chi2   = 0.0042
    Log pseudolikelihood = -171.59334                       Pseudo R2     = 0.0329
    
                                     (Std. err. adjusted for 136 clusters in CASE)
    ------------------------------------------------------------------------------
                 |               Robust
        vote | Odds ratio   std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          diff |   1.056361   .0396069     1.46   0.144     .9815164    1.136912
           return |   3.01e+22   5.95e+23     2.62   0.009       454261    1.99e+39
           _cons |   .7216678   .1291499    -1.82   0.068     .5081665     1.02487
    ------------------------------------------------------------------------------
    Note: _cons estimates baseline odds.

    Code:
    margins, dydx(*)
    
    Average marginal effects                                   Number of obs = 257
    Model VCE: Robust
    
    Expression: Pr(vote), predict()
    dy/dx wrt:  diff return
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          diff |   .0130217   .0087526     1.49   0.137    -.0041331    .0301766
           return |   12.29236   4.440897     2.77   0.006     3.588361    20.99636
    ------------------------------------------------------------------------------
    As you can see, the marginal effect is 0.013 for distance, which means (I believ) that for a 1 unit increase in the distance, the probabiliy of a positive vote increases by 13 percentage points.
    However, I am unsure how to interpret the return coefficient: if the stock market return increases by 1 unit, then the probability of a positive vote increases by 1229 percentage points?

    I would be most grateful for any help or guidance.

    Professor Williams' site on marginal effects for continuous variables (https://www3.nd.edu/~rwilliam/stats3/Margins02.pdf) has listed marginal effects of 1.84 (page 12 - middle of the page) but I found no interpretation.

    Thank you very much!

  • #2
    The dydx has a similar interpretation as the linear probability model (if you use regress rather than logit you'll get coefficients nearly identical to the margins from logit). A one unit change in diff increases the probability by 0.013 (so if the mean is 0.6, then the changed implies a value of 0.613). If you want to know the % change, then use eydx.

    The return has a small mean near zero I suspect. A change of 1 is a 100% change in the return. So you'd be asking about a change of 0.01 or some such. As you are using logit, the change will not be constant across all changes. Use marginsplot to see it.

    A perhaps better way to get what you want is this:

    Say means are diff = 10 and return = 0.

    margins, at(diff = (10 11) return = (0 0.01))


    Comment


    • #3
      Thank you very much for your comment and insight!
      But how would I interpret the obtained dy/dx return of 12.29?

      Comment


      • #4
        Dear Richard Williams, in your document titled Marginal Effects for Continuous Variables, found here: https://www3.nd.edu/~rwilliam/stats3/Margins02.pdf, on page 12, there are results in the margins command "margins, dydx(*)" and "margins, dydx(*) atmeans" that are greater than 1.

        May I please kindly ask you for an explanation of the interpretation:
        Is it: if education increases by 1 unit, then income increases by 184 percentage points. One additional unit of job experience increases income by 65 percentage points. Being black decreases income by 255 percentage points?

        Code:
        margins, dydx(*)
        Average marginal effects Number of obs = 500
        Model VCE : OLS Expression : Linear prediction, predict() dy/dx w.r.t. : educ jobexp black
        
        Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval]
        educ | 1.840407 .0467507 39.37 0.000 1.748777 1.932036
        jobexp | .6514259 .0350604 18.58 0.000 .5827087 .7201431
        black | -2.55136 .4736266 -5.39 0.000 -3.479651 -1.623069
        I would be most grateful for an explanation.

        Thank you very much in advance!

        Comment


        • #5
          change in prob is roughly 0.0129 for a 0.1% change in the return.

          You need a small change in the variables, since the logit model is not linear. The margin will be different at every level of the covariates.

          do that at command I suggested and you'll see it there.

          Comment


          • #6
            Matthew Berg , in the example of mine that you cite, margins is being run after OLS regression, not logistic regression. You shouldn't be talking about percentage point changes. In this case the marginal effects are the same as the slope coefficients and should be interpreted in the same way, e.g. each additional year of education is associated with an average of $1,840 dollars in additional income. The next few examples in that handout talk about interpretation when you add interaction or squared terms to a linear model.
            -------------------------------------------
            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
              George Ford Thank you very much! Working on it!
              Last edited by Matthew Berg; 09 Aug 2023, 01:51.

              Comment


              • #8
                Richard Williams Thank you for the clarification. May I please kindly ask you for your interpretation of the obtained dy/dx return of 12.29 following my logit model? Thank you very much in advance!

                Comment


                • #9
                  The trick with interpreting any regression-like coefficient is to know what the unit of your variables is. I suspect your variable return is measured as a proportion not a percentage. In principle, there is nothing wrong with that. In practice, it is often inconvenient because now a unit change represents going from 0% stock return to 100% stock return. In real life you will be quite unlikely to see such a difference, so the "effect" is a gross extrapolation (mind you, it is not wrong in a strickt sense, just not very useful), and thus you can get effects like 12.29. The simplest solution is to change your return variable to be measured in percentages instead of proportions, i.e. multiply your variable by 100. If you add your new variable your marginal effect will be the effect of a percentagepoint change in stock return instead of a 100 percentage points change in stock return.

                  If your return variable is already measured in percentages, then an alternative reason for these unrealistic effects could be missing values that are incorrectly coded. Look for values like 999, 998, 997 or -999, etc. These are typical values data providers use to represent missing values in data that is supposed to be readable by different software packages. These need to be recoded to a Stata missing value: . or .a, .b, .c, etc. (notice the dot). If you don't do that, then Stata will assume that 999 means 999, which is not what you want.
                  ---------------------------------
                  Maarten L. Buis
                  University of Konstanz
                  Department of history and sociology
                  box 40
                  78457 Konstanz
                  Germany
                  http://www.maartenbuis.nl
                  ---------------------------------

                  Comment


                  • #10
                    It is hard to interpret any coefficient unless you know how the variable is scaled. What are the means and variances of your x variables? If, say, a variable ranges from 0 to 1, it is often much easier to interpret its effects if you multiple it by 100 so it ranges from 0 to 100. As is, I don’t see anything odd about the value of the coefficient, but I might if I knew how the variable was scaled.

                    Also, as Maarten says, make sure everything is coded cleanly and correctly.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

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

                    Comment


                    • #11
                      Maarten Buis Thank you so very much! Indeed my returns were not percentages. Now since replacing everything else makes way more sense!

                      Comment


                      • #12
                        Hello,

                        I believe that my query fits the interpreting ‘margins with percentages’ discussion that has occured on this thread.

                        My main independent variable is a ratio of price to income for a product, which is expressed as %, call it the relative income price (RIP). I calculate it as:

                        RIP= (price/income) * 100

                        I have two models estimated in a pooled cross sectional framework. The first is a logit model that predicts the probability of participation as a function of several factors, one of which is the relative income price (RIP). I estimate this in Stata as follows:

                        logit participation RIP x2 x3 x4 etc

                        I am interested in the RIP participation elasticity. To my understanding, to obtain an estimate of this, I run the following after my regression command:

                        margins eyex (RIP)

                        When I do this, Stata returns -.2448162 as the elasticity estimate.

                        Question: does this mean that a 1% increase in RIP leads to a -0.25% decrease in the likelihood of participation? I am concerned that because RIP is calculated as a ratio multiplied 100 (in other words, a percentage), I should be accounting for this. If I should, I do not know how and would appreciate guidance.

                        My second question relates to my second model:

                        I am similarly interested in the RIP elasticity in the context of a glm model that has a logged dependent variable. The logged dependent variable represents the intensity of consumption (number consumed per day).

                        In Stata, I run:

                        glm ln(y) RIP x1 x2 x3 etc, family(gaussian) link(log)

                        To calculate the elasticity from reg of ln(y) on RIP, I type the following post estimation command:

                        margins, dyex(RIP)

                        Stata then returns -.1547769

                        Does the fact that RIP is a percentage mean that dyex can be interpreted as a 1% increase in RIP decreases y(intensity/consumption) by 0.15%?


                        Thank you!


                        Sam

                        Comment

                        Working...
                        X