Announcement

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

  • GLM model with the log link and semi-elasticity [eydx]?

    I have a question about how the command margins estimates semi-elasticity [eydx] from the results of the original model. I am analyzing the temporal evolution of racial discrepancies in the effect of class origin on children's income using a 2014 data survey in Brazil. The class of origin and race are categorical variables. Income differences are being estimated by a Generalized Linear Model, with family (gamma) link (log), which would be a better fit according to the AIC and BIC statistics. Furthermore, the GLM model with the log link exponentiates the linear index and it avoid the retransformation issues of OLS models with a logged dependent variable (Partha Deb and Edward C. Norton). The GLM model with the log link does not use a logged dependent variable.
    When estimating the effects between the cohorts, I use semi-elasticity [margins, eydx], that is, I estimate effects on a logarithmic scale (proportional effects). I do this to avoid a distortion associated with age-income profile differences between the cohorts. However, I was in doubt if I was doing a double logarithmic transformation: the log link and semieslasticity [eydx].
    I reproduce the stylized commands and part of the result:
    Code:
    svy, subpop(id66): glm income i.class##i.cohorts##i.white   covariates, family(gamma) link(log)
    margins class#cohorts, eydx (white)  post
     
    Average marginal effects                          Number of obs   =      30328
    Model VCE    : Linearized
    Expression   : Predicted mean income, predict()
    ey/dx w.r.t. : 1.white
    -----------------------------------------------------------------------------------
                      |            Delta-method
                      |      ey/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ------------------+----------------------------------------------------------------
    1. white          |
        class#cohorts |
              top#48  |   .3981374   .1054612     3.78   0.000     .1914372    .6048376
              top#58  |   .2178773   .1144905     1.90   0.057    -.0065199    .4422745
              top#68  |   .3542466   .0966142     3.67   0.000     .1648863    .5436069
              top#78  |   .2521138    .091253     2.76   0.006     .0732612    .4309663
    -----------------------------------------------------------------------------------
    I was assuming that it would not be a distortion, since semi-elasticity [margins, eydx], would use “Predicted mean”, as it appears in the output.
    Would this choice generate or not distorted estimates?

    Thanks in advance for the comment,

    José Alcides F. Santos,


  • #2
    Dear Statalist Members

    I present a more specific argument about the appropriateness (or not) of using margins to calculate semi-elasticity [eydx] after implementing the GLM model with the log link.
    Generalized Linear Model (GLM) with a log link function models the logarithm of the expected value of Y, conditional on X (Partha Deb and Edward C. Norton).
    Observing the output of the original model estimated by Stata, it is clear that “the logarithm of the expected value of Y” was estimated. I reproduce part of the output:
    Code:
     
    Number of strata   =       728                  Number of obs      =     42272
    Number of PSUs     =      6254                  Population size    =  24188539
                                                    Subpop. no. of obs =     30328
                                                    Subpop. size       =  17302496
                                                    Design df          =      5526
    ----------------------------------------------------------------------------------------
                           |             Linearized
                  income   |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -----------------------+----------------------------------------------------------------
                     class |
                       top |   .5391303   .1025741     5.26   0.000     .3380446    .7402159
                  skilled  |   .4427572   .0834273     5.31   0.000      .279207    .6063075
              small assets |   .0797962   .0474681     1.68   0.093      -.01326    .1728524
                    worker |   .1988137   .0644693     3.08   0.002     .0724286    .3251989
    ----------------------------------------------------------------------------------------
    When applying margins with the dydx option after previous estimates, the marginal effect is estimated in terms of absolute differences, that is, the retransformation is made to the original metric in monetary values. GLM model with the log link does not use a logged dependent variable. It exponentiates the linear index.
    On the other hand, when applying the margins with the eydx [semi-elasticity] option, the result remains in a logarithmic scale (proportional effects).
    As already noted by Clyde Schechter, margins is a post-estimation command that relies on previous estimates and performs none of its own. No original results have been re-estimated. However, with dydx the retransformation was performed; with eydx the logarithmic scale was maintained.
    The opposite reasoning would be to imagine that the margins command estimated the logarithm of a result that was already on the logarithmic scale. The logarithm of the logarithm would be estimated.
    The question remains: Would it be appropriate to estimate semi-elasticity [eydx] after previous estimates made by a GLM model with the log link?

    A comment will be very welcome to the research and to the Stata user “community”,

    José Alcides

    Comment


    • #3
      Dear Statalist Members

      Clyde Schechter's answer to an earlier question [2019] that I asked seems to clarify this problem as well. I have used then a GLM model with the log link and after I used the margins command with elasticity [eyex], since the focal independent variable was continuous: ISEI (International Social-Economic Index of Occupational Status) for the parent status. The eyex option estimates the proportional change in Y [children’s income] for a proportional change in X [parent status].
      This was the model and the command:
      svy, subpop(id66): glm income c.isei##i.cohort i.state [where he lived at 15 years] i.sex i.collor, family(poisson) link(log)
      margins cohort, eyex(isei)
      This was the output:
      Code:
        
       Expression   : Predicted mean income, predict()  
       Model VCE    : Linearized  
       Average marginal effects                         Number of obs   =      25772     
       ------------------------------------------------------------------------------  
                    |            Delta-method  
                    |      ey/ex   Std. Err.      z    P>|z|     [95% Conf. Interval]  
       -------------+----------------------------------------------------------------  
             isei   |  
            cohort  |  
                48  |   .8300628    .052158    15.91   0.000     .7278351    .9322906  
                58  |   .8401456   .0765742    10.97   0.000     .6900629    .9902282  
                68  |   .8403638   .0455364    18.45   0.000     .7511141    .9296136  
                78  |   .6801567   .0286101    23.77   0.000      .624082    .7362315  
       ------------------------------------------------------------------------------
      Question: I am asking whether some distortion could be introduced due to the fact that the original GLM model takes the exponential of the independent variable.
      Clyde Schechter answer: No, you are fine. The -margins- command you wrote is using -predict()- for the "y" in "eyex" and -predict- after -glm- calculates mu, the expected value of income. So you will be getting the rate of relative change in income per unit of relative change in isei --which is exactly the elasticity of income with respect to isei.
      Link: https://www.statalist.org/forums/for...d-linear-model

      José Alcides

      Comment

      Working...
      X