Announcement

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

  • is there a difference between elasticities and percentage changes?

    Hello Dears,
    I want to figure out why we use log transformations for estimating fiscal multipliers?
    Is there any difference between elasticities and percentage changes?
    Do we need to multiple by 100 to change it in percentage form?
    for instance,
    ln_gdp=100*log(GDP)
    ln_spending=100*log(spending)

  • #2
    See the definition of an elasticity.

    Comment


    • #3
      Dear Andrew Musau, thank you for the suggestion. I am a bit confused with some replication codes I refer to (https://doi.org/10.1111/jmcb.12784: Supplementary Material) and (panel data example: https://sites.google.com/site/oscarj...al-projections).
      If both the dependent variable and the independent variable(s) are log-transformed, I guess they predict elasticities. and the interpretation is if x changes by 1 percent, y will change by the B-coefficient percent.
      But, the papers I refer to first they transform their variables to logarithmic values and multiple by 100 to get percentage values. My question is, if both the dependent variable and the independent variable(s) are log-transformed, do we need to multiple by 100? or do the values we found indicate percentage changes?
      ln_gdp=100*log(GDP)
      ln_spending=100*log(spending)

      Comment


      • #4
        They would do that if they wanted to rescale other coefficients in the regression. From the definition linked in #2, the elasticity is a unit-free measure as the units cancel out when we divide the change by the amount.

        $$\text{x-elasticity of y}:\;\epsilon= \frac{\partial y/ y}{\partial x/x}$$

        So below, note that the coefficient on lnweight is the same if I multiply the logs by 100 or not.

        Code:
        sysuse auto, clear
        gen lnprice1= ln(price)
        gen lnprice2= 100*ln(price)
        gen lnweight1= ln(weight)
        gen lnweight2= 100*ln(weight)
        regress lnprice1 mpg lnweight1
        regress lnprice2 mpg lnweight2
        Res.:

        Code:
        . regress lnprice1 mpg lnweight1
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(2, 71)        =     13.16
               Model |  3.03547535         2  1.51773767   Prob > F        =    0.0000
            Residual |  8.18805773        71  .115324757   R-squared       =    0.2705
        -------------+----------------------------------   Adj R-squared   =    0.2499
               Total |  11.2235331        73  .153747029   Root MSE        =    .33959
        
        ------------------------------------------------------------------------------
            lnprice1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 mpg |  -.0166605   .0119907    -1.39   0.169    -.0405694    .0072483
           lnweight1 |   .4403911    .260462     1.69   0.095    -.0789554    .9597377
               _cons |   5.481685   2.292476     2.39   0.019     .9106176    10.05275
        ------------------------------------------------------------------------------
        
        . 
        . regress lnprice2 mpg lnweight2
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(2, 71)        =     13.16
               Model |  30354.7486         2  15177.3743   Prob > F        =    0.0000
            Residual |  81880.5916        71  1153.24777   R-squared       =    0.2705
        -------------+----------------------------------   Adj R-squared   =    0.2499
               Total |   112235.34        73  1537.47041   Root MSE        =     33.96
        
        ------------------------------------------------------------------------------
            lnprice2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 mpg |  -1.666051   1.199073    -1.39   0.169    -4.056935    .7248335
           lnweight2 |   .4403913   .2604621     1.69   0.095    -.0789554     .959738
               _cons |   548.1684   229.2477     2.39   0.019     91.06147    1005.275
        ------------------------------------------------------------------------------
        
        .

        Comment


        • #5
          Dear Andrew Musau, thank you for ur brief guidance.
          Here is the data for Jorda (https://sites.google.com/site/oscarj...al-projections)


          use http://data.macrohistory.net/JST/JSTdatasetR5.dta
          sort ifs year /* ifs indicates the country */
          xtset ifs year, yearly
          /******************** Some Data transformations ***************/
          gen lgdpr = 100*ln(rgdppc*pop) /* convert to RGDP and take log */
          gen lcpi = 100*ln(cpi)


          gen dlcpi = d.lcpi
          gen dlgdpr = d.lgdpr
          gen dstir = d.stir
          gen lstir = l.stir

          /* Generate LHS variables for the LPs */

          foreach x in lgdpr lcpi stir {
          forv h = 0/4 {
          *gen `x'`h' = f`h'.`x' - l.`x' // Use for cumulative IRF
          gen `x'`h' = f`h'.`x' - l.f`h'.`x' // Use for usual IRF

          }
          }

          ********************************************
          * Set Sample if only interested in post-WW2
          ********************************************
          *keep if year>=1950

          ************************************************** ************
          * Compute LPs. Note: a loop is more elegant but tricky to code
          * because I am using Cholesky identification and controls vary
          * by regression
          ************************************************** ************


          ** Real GDP to STIR

          eststo clear
          cap drop b u d Years Zero
          gen Years = _n-1 if _n<=6
          gen Zero = 0 if _n<=6
          gen b=0
          gen u=0
          gen d=0
          qui forv h = 0/4 {
          xtreg lgdpr`h' l(1/3).dlgdpr l(1/3).dlcpi l(1/3).dstir, fe cluster(iso)
          replace b = _b[l.dstir] if _n == `h'+2
          replace u = _b[l.dstir] + 1.645* _se[l.dstir] if _n == `h'+2
          replace d = _b[l.dstir] - 1.645* _se[l.dstir] if _n == `h'+2
          eststo
          }
          nois esttab , se nocons keep(L.dstir)
          twoway ///
          (rarea u d Years, ///
          fcolor(gs13) lcolor(gs13) lw(none) lpattern(solid)) ///
          (line b Years, lcolor(blue) ///
          lpattern(solid) lwidth(thick)) ///
          (line Zero Years, lcolor(black)), legend(off) ///
          title("Response of GDPR to 1pp shock to STIR (Cholesky)", color(black) size(medsmall)) ///
          ytitle("Percent", size(medsmall)) xtitle("Year", size(medsmall)) ///
          graphregion(color(white)) plotregion(color(white))

          May you please look @ figure 1 ********************************

          clear
          cap drop _all
          cap graph drop _all

          /********************* READ IN THE DATA ***********************/
          use http://data.macrohistory.net/JST/JSTdatasetR5.dta

          sort ifs year /* ifs indicates the country */
          xtset ifs year, yearly

          /******************** Some Data transformations ***************/
          gen lgdpr = ln(rgdppc*pop) /* convert to RGDP and take log */
          gen lcpi = ln(cpi)


          gen dlcpi = d.lcpi
          gen dlgdpr = d.lgdpr
          gen dstir = d.stir
          gen lstir = l.stir

          /* Generate LHS variables for the LPs */

          foreach x in lgdpr lcpi stir {
          forv h = 0/4 {
          *gen `x'`h' = f`h'.`x' - l.`x' // Use for cumulative IRF
          gen `x'`h' = f`h'.`x' - l.f`h'.`x' // Use for usual IRF

          }
          }

          ********************************************
          * Set Sample if only interested in post-WW2
          ********************************************
          *keep if year>=1950

          ************************************************** ************
          * Compute LPs. Note: a loop is more elegant but tricky to code
          * because I am using Cholesky identification and controls vary
          * by regression
          ************************************************** ************


          ** Real GDP to STIR

          eststo clear
          cap drop b u d Years Zero
          gen Years = _n-1 if _n<=6
          gen Zero = 0 if _n<=6
          gen b=0
          gen u=0
          gen d=0
          qui forv h = 0/4 {
          xtreg lgdpr`h' l(1/3).dlgdpr l(1/3).dlcpi l(1/3).dstir, fe cluster(iso)
          replace b = _b[l.dstir] if _n == `h'+2
          replace u = _b[l.dstir] + 1.645* _se[l.dstir] if _n == `h'+2
          replace d = _b[l.dstir] - 1.645* _se[l.dstir] if _n == `h'+2
          eststo
          }
          nois esttab , se nocons keep(L.dstir)
          twoway ///
          (rarea u d Years, ///
          fcolor(gs13) lcolor(gs13) lw(none) lpattern(solid)) ///
          (line b Years, lcolor(blue) ///
          lpattern(solid) lwidth(thick)) ///
          (line Zero Years, lcolor(black)), legend(off) ///
          title("Response of GDPR to 1pp shock to STIR (Cholesky)", color(black) size(medsmall)) ///
          ytitle("Percent", size(medsmall)) xtitle("Year", size(medsmall)) ///
          graphregion(color(white)) plotregion(color(white))

          may you please look @figure 2.
          in the IRFs they have 100 times differences. May you please explain to me why?
          I thank you a lot.
          Best
          Attached Files

          Comment


          • #6
            I will not spend much time on this because I believe that I have answered your question in #4. Only 2 variables are logged:


            gen lgdpr = 100*ln(rgdppc*pop) /* convert to RGDP and take log */
            gen lcpi = 100*ln(cpi)
            The variable "dstir" is defined as:

            gen dstir = d.stir
            which is the first difference of the variable "stir". The regression is:

            xtreg lgdpr`h' l(1/3).dlgdpr l(1/3).dlcpi l(1/3).dstir, fe cluster(iso)
            and what is graphed is the variable l.dstir (lagged dstir) and its confidence interval.

            xtreg lgdpr`h' l(1/3).dlgdpr l(1/3).dlcpi l(1/3).dstir, fe cluster(iso)
            replace b = _b[l.dstir] if _n == `h'+2
            replace u = _b[l.dstir] + 1.645* _se[l.dstir] if _n == `h'+2
            replace d = _b[l.dstir] - 1.645* _se[l.dstir] if _n == `h'+2
            eststo
            }
            nois esttab , se nocons keep(L.dstir)
            twoway ///
            (rarea u d Years, ///
            fcolor(gs13) lcolor(gs13) lw(none) lpattern(solid)) ///
            (line b Years, lcolor(blue) ///
            As I said in #4, if you multiply the logged variables by some factor, e.g., 100, you are rescaling the coefficients of other variables in the regression. "l.dstir" is another variable in the above regression, so its coefficient is rescaled (multiplied by 100) as a result of multiplying the logged variables by 100. That's the technical aspect. For specifics, email the authors.
            Last edited by Andrew Musau; 30 May 2022, 13:47.

            Comment

            Working...
            X