Announcement

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

  • interpretation of coefficients for log transformed dependent variable panel data

    Hello everyone,

    I am a masters student analyzing the inventory trends for the selected firms. I have transformed my dependent variable into natural logarithm form and kept the explanatory variables in unlogged form. As per the web resource of princeton university, "When the dependent variable but not an independent variable is logged, a one-unit change in the independent variable is associated with a 100 times the coefficient percent change in the dependent variable."

    The above interpretation is for linear regression. I want to know if this holds true for panel data models i.e. using command xtreg for fixed and random effects model and xtmixed command for mixed effect models.

    The link to the website of Princeton university is as below:

    http://dss.princeton.edu/online_help...stata/log.html

  • #2
    Nitin:
    welcome to the list.
    Yes, it holds, but works only when coefficient values are small (say, <|0.2|). As a general rule for log-linear regression (panel or not), exponentiating the coefficients is the way to go, as the difference between non-exponentiating and exponentiating get wider the higher is the coefficient value, as you can see in the following toy-example:
    Code:
    .
    di 0.2
    .2///if you do not exponentiate the coefficient of the predictor, one unit change in the predictor gives an expected increase in the -depvar- by 20%
    
    . di exp(0.2)-1
    .22140276///if you exponentiate the coefficient of the predictor, one unit change in the predictor gives an expected increase in the -depvar- by 22,14%. This result is more precise and outperforms the previous one.
    You can read about this topic in detail in http://www.wiley.com/WileyCDA/WileyT...470380039.html, pages 142-144.

    As a closing out remark, please note that from Stata 13 onwards, -xtmixed- has been replaced with -mixed-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      "When the dependent variable but not an independent variable is logged, a one-unit change in the independent variable is associated with a 100 times the coefficient percent change in the dependent variable."
      Princeton University notwithstanding, it is important to note that this is an approximation, and one that actually only works well when the coefficient is close to zero.

      The underlying model is:
      Code:
      log y = b0 + b1*x
      So an increase of 1 unit in x is associated with an increase of b1 in log y. To say that log y has increased by b1 is to say that y has increased by a factor of exp(b1). Now, for b1 close to zero, exp(b1) is approximately equal to 1 + b1, so increasing by a factor of exp(b1) is approximately the same as increasing by a factor of (1+b1), which is an increase of 100*b1 percent.

      But this approximation breaks down as b1 moves away from zero:
      Code:
      . forvalues i = 5(5)50 {
        2.     display %3.2f `i'/100 _col(10) exp(`i'/100)
        3. }
      0.05     1.0512711
      0.10     1.1051709
      0.15     1.1618342
      0.20     1.2214028
      0.25     1.2840254
      0.30     1.3498588
      0.35     1.4190675
      0.40     1.4918247
      0.45     1.5683122
      0.50     1.6487213
      So for b1 = 0.05, the actual increase is by about 5.13%--close enough. At b1 = 0.10, it's 10.5%--still OK. But even by the time we get to b1 = 0.20, the actual increase is 22.1%, and out at b1 = 0.50, the actual increase is 64.9%, which is rather far from the mark.

      The rule of thumb I use is to go with the approximation up to b1 = 0.15, but to actually calculate exp(b1) beyond that.

      Comment


      • #4
        Carlo and Clyde,

        Both your answers are great and very helpful.

        However, in the same context (Iinear form for the IV and logged form for the DV), I was wondering what the procedure was when one has a negative coefficient value where b1 > 0.15.

        In my specific case, I obtain a -1.581 coefficient for the impact of union density on logged Gini coefficient

        I have read some suggestions here: https://stats.stackexchange.com/ques...gged-outcome-v

        From what I understand the solution would be as follows: (exp(-1.581*1)-1) = -.7942


        I would be grateful to have some feedback on this,

        Phillippe
        Last edited by Phillippe Scrimger; 12 Jul 2017, 12:51.

        Comment


        • #5
          Yes, it makes no difference whether the coefficient is positive or negative.

          Comment


          • #6
            Originally posted by Clyde Schechter View Post
            Yes, it makes no difference whether the coefficient is positive or negative.
            So what you are saying is simply use the value of: exp(-1.581) = .2058

            And then conclude that: a one unit increase in union density produces a 0.2% decrease in the gini coefficient.

            Last edited by Phillippe Scrimger; 12 Jul 2017, 13:28.

            Comment


            • #7
              So your outcome variable "increases" by a factor of exp(-1.581) = .2058, which is actually a decrease. The difference is therefore a decline from its original value to original value*.2058, which would be a decrease of (100-20.58)%, or 79.42%.

              Comment


              • #8
                Originally posted by Clyde Schechter View Post
                So your outcome variable "increases" by a factor of exp(-1.581) = .2058, which is actually a decrease. The difference is therefore a decline from its original value to original value*.2058, which would be a decrease of (100-20.58)%, or 79.42%.
                Gotchya.

                This is great. Thank you very much.

                Comment


                • #9
                  Philippe:
                  I find useful to include -1 after -exp()- so to have an immediate feeling about the direction od change (ie, increase/decrease).
                  In your case:
                  Code:
                  . di exp(-1.581)-1
                  -.79423077
                  gives back a clear picture of a 79.42% reduction (as Clyde pointed out).
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Good morning,

                    The method described above is clear. However, when using this method in the context where variables are scaled between 0 and 1 [0,1], should I interpret a 79.42% reduction as a 7.94 % reduction?

                    Consider the two models below. In the first model, I want to estimate the effect of international trade as a percentage of GDP (inttrade_wi, scaled [0,1]) on the log income share of the top 1 % (original variable = share1percentmarket, scaled [0,1]). The Coefficient I get is 0.8034. When I exp(.8034), I get a 2.2322 which translates to a 123 % increase (if I'm correct). I find this to be a highly unrealistic result. In the second model presented just under, I scaled the inttrade_wi variable to vary between 1 and 100 (named changes to inttrade_scaled_wi). When I do this, the coefficient becomes 0.008. If I apply the method discussed earlier in this forum (100*.008), I get a percent change that is and 0.8% increase, which is appears way more reasonable.

                    I apologize if my inquiry is not clear.


                    Code:
                    . xtpcse log_share1percentmarket uniondensim_bw log_militancy_bw leftpart_bw centrepa
                    > rt_bw inttrade_bw iptrade_bw fingdp_bw uniondensim_wi log_militancy_wi leftpart_wi
                    > centrepart_wi inttrade_wi iptrade_wi fingdp_wi, corr(ar1)
                    
                    Prais-Winsten regression, correlated panels corrected standard errors (PCSEs)
                    
                    Group variable:   id                            Number of obs     =        300
                    Time variable:    year                          Number of groups  =         10
                    Panels:           correlated (balanced)         Obs per group:
                    Autocorrelation:  common AR(1)                                min =         30
                                                                                  avg =         30
                                                                                  max =         30
                    Estimated covariances      =        55          R-squared         =     0.9189
                    Estimated autocorrelations =         1          Wald chi2(14)     =     256.85
                    Estimated coefficients     =        15          Prob > chi2       =     0.0000
                    
                    ----------------------------------------------------------------------------------
                                     |           Panel-corrected
                    log_share1perc~t |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                    -----------------+----------------------------------------------------------------
                      uniondensim_bw |  -.1386422   .3488037    -0.40   0.691    -.8222848    .5450005
                    log_militancy_bw |  -.0781578   .0253801    -3.08   0.002     -.127902   -.0284137
                         leftpart_bw |  -.0862158   .0470399    -1.83   0.067    -.1784123    .0059807
                       centrepart_bw |  -.1267358   .0529388    -2.39   0.017     -.230494   -.0229777
                         inttrade_bw |   .6677908    .165454     4.04   0.000     .3435069    .9920746
                          iptrade_bw |  -1.092711   .1253148    -8.72   0.000    -1.338323    -.847098
                           fingdp_bw |    .268244   .4400841     0.61   0.542     -.594305    1.130793
                      uniondensim_wi |  -.4932417    .274948    -1.79   0.073     -1.03213    .0456465
                    log_militancy_wi |   .0021109   .0033721     0.63   0.531    -.0044982      .00872
                         leftpart_wi |   .0052043   .0157839     0.33   0.742    -.0257316    .0361402
                       centrepart_wi |   .0254329   .0173963     1.46   0.144    -.0086633     .059529
                         inttrade_wi |   .8034779   .1142161     7.03   0.000     .5796185    1.027337
                          iptrade_wi |   .1413413   .2085065     0.68   0.498     -.267324    .5500066
                           fingdp_wi |   1.189045   .6891417     1.73   0.084    -.1616481    2.539738
                               _cons |  -1.682351   .1821633    -9.24   0.000    -2.039384   -1.325317
                    -----------------+----------------------------------------------------------------
                                 rho |   .6647044
                    ----------------------------------------------------------------------------------


                    Code:
                    xtpcse log_share1percentmarket uniondensim_bw log_militancy_bw leftpart_bw centrepa
                    > rt_bw inttrade_scaled_bw iptrade_bw fingdp_bw uniondensim_wi log_militancy_wi leftp
                    > art_wi centrepart_wi inttrade_scaled_wi iptrade_wi fingdp_wi, corr(ar1)
                    
                    Prais-Winsten regression, correlated panels corrected standard errors (PCSEs)
                    
                    Group variable:   id                            Number of obs     =        300
                    Time variable:    year                          Number of groups  =         10
                    Panels:           correlated (balanced)         Obs per group:
                    Autocorrelation:  common AR(1)                                min =         30
                                                                                  avg =         30
                                                                                  max =         30
                    Estimated covariances      =        55          R-squared         =     0.9189
                    Estimated autocorrelations =         1          Wald chi2(14)     =     256.85
                    Estimated coefficients     =        15          Prob > chi2       =     0.0000
                    
                    ------------------------------------------------------------------------------------
                                       |           Panel-corrected
                    log_share1percen~t |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                    -------------------+----------------------------------------------------------------
                        uniondensim_bw |  -.1386423   .3488038    -0.40   0.691    -.8222851    .5450006
                      log_militancy_bw |  -.0781578   .0253801    -3.08   0.002     -.127902   -.0284137
                           leftpart_bw |  -.0862158   .0470399    -1.83   0.067    -.1784123    .0059808
                         centrepart_bw |  -.1267358   .0529388    -2.39   0.017     -.230494   -.0229776
                    inttrade_scaled_bw |   .0066779   .0016545     4.04   0.000     .0034351    .0099207
                            iptrade_bw |   -1.09271   .1253148    -8.72   0.000    -1.338323   -.8470979
                             fingdp_bw |   .2682439   .4400841     0.61   0.542    -.5943051    1.130793
                        uniondensim_wi |  -.4932417    .274948    -1.79   0.073     -1.03213    .0456465
                      log_militancy_wi |   .0021109   .0033721     0.63   0.531    -.0044982      .00872
                           leftpart_wi |   .0052043   .0157839     0.33   0.742    -.0257316    .0361402
                         centrepart_wi |   .0254329   .0173963     1.46   0.144    -.0086633     .059529
                    inttrade_scaled_wi |   .0080348   .0011422     7.03   0.000     .0057962    .0102734
                            iptrade_wi |   .1413413   .2085065     0.68   0.498     -.267324    .5500066
                             fingdp_wi |   1.189045   .6891417     1.73   0.084     -.161648    2.539738
                                 _cons |  -1.682351   .1821633    -9.24   0.000    -2.039384   -1.325317
                    -------------------+----------------------------------------------------------------
                                   rho |   .6647044
                    ------------------------------------------------------------------------------------
                    Last edited by Phillippe Scrimger; 13 Jul 2017, 12:24.

                    Comment


                    • #11
                      Phillipe, you have to think about what your variables mean. When you transform them, or rescale them, the meaning changes.

                      The marginal effect is always the estimate of the change in outcome variable associated with a 1-unit change in the predictor variable. When your variable is scaled as a proportion from 0 to 1, that means a change going all the way from 0 at the bottom to 1 at the top. When your variable is scaled from 0 to 100 as a percentage, then a unit change means a change from, say, 5% to 6%, or 87% to 88% or something like that. So a unit change when your variable is scaled as a proportion is going to have a much larger effect than a unit change when your variable is scaled as a percentage. So your calculations are correct in both instances. The change you calculated for the proportion model is not unreasonably large, given that in that situation a unit change means going all the way from the bottom to the top of the scale, not just a tiny 1/100th of the way.

                      Comment


                      • #12
                        That explains everything. Again, thank you Clyde!
                        Last edited by Phillippe Scrimger; 14 Jul 2017, 10:45.

                        Comment


                        • #13
                          Hello.
                          I had a similar problem and found this thread very useful. Thank you.

                          I have a related question:
                          My dependent variable is the natural logarithm of firm profits in US dollars.
                          I have made the calculations suggested above and identified the % increase/decrease in firm profits for one unit increase in X.
                          Is there a way to calculate how many US dollars the firm profits variable increases/decreases for one increase in X, rather than the % increase/decrease in US dollars?

                          Any inputs or suggestions on this would be greatly appreciated.

                          Sincerely,
                          Erik
                          Last edited by Erik Aadland; 17 Dec 2018, 03:31.

                          Comment


                          • #14
                            If your original model used the log of profits as the outcome variable, then that model cannot estimate the change in profits associated with a unit increase in X because, under that model, there is no such thing. When the log of profits is the outcome variable, then the actual change in profits associated with a unit increase in X is different depending on the starting value of profits.

                            For example, let's say your model says that a unit increase in X is associated with a 2% increase in profits. Then if we are starting from profits = 100, a unit increase in X will be associated with an increase of 2 in profits. But if we are starting from profits = 1000, then a unit increase in X will be associated with an increase of 20 in profits. So the thing you are trying to estimate is simply undefined in a log-transformed model.

                            Comment


                            • #15
                              Thank you, Clyde.
                              I received an informal suggestion elsewhere that I might get at it by calculating the predicted margins for X with other variables atmeans, and then exponentiate the predicted margins?
                              Is this something worth trying, or just plain wrong?

                              Thanks again.

                              Best,
                              Erik
                              Last edited by Erik Aadland; 17 Dec 2018, 08:42.

                              Comment

                              Working...
                              X