Announcement

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

  • elasticity calculation

    dear all, I now face an easy question that's confusing me. There are three variables as follows:
    Age: the age of mother in a household
    Child: the number of children in a household
    ln_ninc: ln(husband income)
    I use this code to estimate the income impact of fathers on the fertility(the number of children)
    Code:
    areg child ln_ninc, robust a(age)
    And then report the elasticity: the percentage change effect of husband income on the percentage change of fertility.
    There are two ways to get it:
    1.
    Code:
    margins,eydx(ln_ninc)
    2. since the estimated coefficient equals dy/dlnx=dy/dx*x, e=dy/dx*x/y, I can also use this code to calculate the elasticity
    Code:
    local b=_b[ln_ninc]
    sum child
    local y=r(mean)
    dis "e=" `b'/`y'
    The two results are quite similar. But what confused me is that the paper reported this number as _b[ln_ninc]*r(mean) [my guess as the results show]
    Can anyone help explain why I am wrong.
    for your convenience, you can get the paper here: https://core.ac.uk/download/pdf/6543120.pdf
    the data here: https://dataverse.harvard.edu/datase...l:1902.1/21475

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int age float child double ln_ninc
    42 2 11.290756438652245
    49 4  11.27935271816548
    43 1 10.610660904829166
    43 1  9.751559401061966
    42 2 10.308952660644293
    43 0 11.589432699447986
    42 2  11.32506459446695
    46 3 10.400406931127549
    45 1 11.404226048046887
    45 2 11.040999990161794
    42 2 11.245725527459099
    41 2 10.761004448831892
    42 2 10.408526465540385
    40 2 10.916015307290108
    40 3 10.696480068065789
    42 3 10.460643173884725
    49 1 11.010844825456925
    44 3 11.079184331510326
    43 1 10.620009404412524
    41 3  10.50701085558772
    45 0 11.372191049896736
    40 2 11.195471234184778
    41 2 10.487740202378962
    40 2 10.314371286671152
    43 1 10.126631103850338
    47 1  9.187583384853566
    50 0  10.72326738402944
    46 2 11.396739902673568
    40 0 11.082142548877775
    46 3 11.726527641797215
    43 2  10.82774645405946
    44 3 10.968198289528557
    42 2 10.911445472936107
    45 2 10.894384703747138
    45 2 11.049301442688533
    45 3 10.705489138008156
    46 2  10.72326738402944
    40 2 11.088155205804059
    41 2 10.858998997563564
    43 1   9.94515718770752
    44 1  9.135616825780247
    41 1 11.324618028491475
    47 2 10.463131911491967
    49 1   11.2708539037705
    44 4 10.858998997563564
    48 0  11.01613423016804
    49 4 11.242257822677576
    47 3 10.959540226785442
    42 1 10.121015365064702
    40 2 11.745440962083432
    42 3 10.491274217438248
    42 2  9.848978567035735
    40 2  10.82377030567982
    43 8 11.486930504693143
    48 4 10.961277846683982
    44 0  7.824046010856292
    44 3  11.46831505345168
    49 2 11.300746581380709
    40 3  8.699514748210191
    40 4 11.187818399427712
    42 3  11.02679245379461
    40 2 10.856110213657674
    40 5 10.222631954177766
    49 1 11.344506813345266
    43 2 10.336892029333534
    43 3   10.9244805834911
    50 2  10.68311055003235
    48 1  9.128370809108931
    48 2  9.852194258148577
    40 1 10.927771331913476
    50 3  10.46310334047155
    42 0 10.522880544507412
    42 2 11.330611908144274
    42 3  11.09093455490473
    47 2 11.273690640756074
    50 3  9.913437883389296
    40 2 10.308952660644293
    43 5 10.842517771379773
    43 0  9.845593574117226
    40 1 11.048888002702997
    47 4 11.122191321462058
    47 3 10.783114300038692
    41 0 10.776870783399007
    44 0 11.677804108152463
    43 1 10.132056360495403
    40 1 10.915088464214607
    41 1 11.222452835867818
    41 0 11.156250521031495
    49 4 10.491274217438248
    48 2  9.392661928770137
    49 1 11.401993904262946
    40 1 10.596634733096073
    41 2 11.961315953929825
    46 4 11.762601885782415
    47 3 10.641034320392757
    44 3  11.27236867948514
    45 2 11.016545005635734
    40 2 10.961555585888657
    40 1 11.107510355612106
    50 4 10.941995917134532
    end
    label values age agelbl
    label def agelbl 40 "40", modify
    label def agelbl 41 "41", modify
    label def agelbl 42 "42", modify
    label def agelbl 43 "43", modify
    label def agelbl 44 "44", modify
    label def agelbl 45 "45", modify
    label def agelbl 46 "46", modify
    label def agelbl 47 "47", modify
    label def agelbl 48 "48", modify
    label def agelbl 49 "49", modify
    label def agelbl 50 "50", modify
    ------------------ copy up to and including the previous line ------------------

    Listed 100 out of 422427 observations
    Last edited by Liu Qiang; 13 Oct 2018, 01:45.
    2B or not 2B, that's a question!

  • #2
    I can't give any advice regarding your code but what comes to my mind is that if you are interested in the elasticity you can e.g. use a usual regression with the OLS method and have both your variables of interest as logarithms while one of them is the regressand. The interpretation of the OLS estimates of something like
    Code:
    reg lnchild ln_ninc othervars, Options
    would be that a 1% increase in ninc in-/decreases child by xx%.

    Comment


    • #3
      I have not looked at the paper, and if no one has the time to look at it and respond, it may be better to directly contact the authors. Your definition of the elasticity is correct, as easily derived below:

      $$Y= \beta_{0} + \beta_{1} \;\text{ln(X)}$$

      The marginal effect is the first-order derivative:

      $$\frac{\partial Y}{\partial X} =\frac{\partial \left(\beta_{0} + \beta_{1} \;\text{ln(X)}\right)}{\partial X} = \frac{\beta_{1}}{X}$$

      and the elasticity is

      $$\frac{X}{Y}\cdot \frac{\beta_{1}}{X} = \frac{\beta_{1}}{Y}$$



      local b=_b[ln_ninc]
      sum child
      local y=r(mean)
      dis "e=" `b'/`y'
      However, your code using margins is equivalent to

      Code:
      margins,eydx(ln_ninc) atmeans

      Comment


      • #4
        Originally posted by Andrew Musau View Post
        I have not looked at the paper, and if no one has the time to look at it and respond, it may be better to directly contact the authors. Your definition of the elasticity is correct, as easily derived below:

        $$Y= \beta_{0} + \beta_{1} \;\text{ln(X)}$$

        The marginal effect is the first-order derivative:

        $$\frac{\partial Y}{\partial X} =\frac{\partial \left(\beta_{0} + \beta_{1} \;\text{ln(X)}\right)}{\partial X} = \frac{\beta_{1}}{X}$$

        and the elasticity is

        $$\frac{X}{Y}\cdot \frac{\beta_{1}}{X} = \frac{\beta_{1}}{Y}$$





        However, your code using margins is equivalent to

        Code:
        margins,eydx(ln_ninc) atmeans
        Thank you for your reply and nice advice. I have got the answer from the author who's admitted he may have made a mistake and is checking it now. As this paper has been published on a top journal, I have no reason to convince myself with the basic knowledge. But this is quite a small problem that will not influence the main results. I am very honored to get my questions solved with the author's quick reply.
        2B or not 2B, that's a question!

        Comment

        Working...
        X