Dear Statalist Members

When comparing the output of the margins [eydx] for semielasticity (proportional effects) of a GLM model with log link and another with identity link I found that they are very close. The estimates of course could differ. With the identity link function no transformation is done. With the log link the linear index is exponentiated. See how the estimates by class origin of the advantages of the white group in the children's income were for Brazil.
Code:
 
GLM model with family(gamma) link(log)
 
Average marginal effects                          Number of obs   =      30414
Model VCE    : OIM
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 |
  social top |    .535371   .0523935    10.22   0.000     .4326816    .6380604
     skilled |   .5341033   .0568641     9.39   0.000     .4226518    .6455549
 small assets|   .4788623   .0274684    17.43   0.000     .4250253    .5326994
      worker |   .3075652   .0313738     9.80   0.000     .2460737    .3690567
   destitute |    .353975    .025128    14.09   0.000     .3047249     .403225
------------------------------------------------------------------------------
 
 
GLM model with family(gamma) link(identify)
 
Average marginal effects                          Number of obs   =      30414
Model VCE    : OIM
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 |
  social top |    .567763   .0560234    10.13   0.000     .4579592    .6775669
     skilled |   .5688268   .0608277     9.35   0.000     .4496066     .688047
 small assets|   .4061208    .024772    16.39   0.000     .3575686    .4546731
      worker |   .3342984   .0340144     9.83   0.000     .2676314    .4009654
   destitute |   .3144392   .0246612    12.75   0.000     .2661042    .3627742
“GLM with a log link models the logarithm of the expected value of Y, conditional on X”, as explain Partha Deb and Edward C. Norton. I make this comparison to assess whether the semielasticity [margins, eydx] estimates made from the previous results of a GLM model with a log link would be distorted or not. It seems not. If the margins command [with eydx] had strictly calculated the logarithm from previous estimates already in a logarithmic scale the compression of the differences would be very large. Just calculate the logarithm of a value already in logarithm to show the degree of compression that occurs with its average. In the estimate presented no compression occurred. It appears that the margins command identifies the situation and uses the predicted average income retransformed to the original metric. As it is in the “Expression” posted at the output for both models: Predicted mean income, predict().
Note that a similar procedure cannot be done with OLS models with a logged dependent variable. “OLS regression with a log-transformed dependent variable models the expected value of the logarithm of Y conditional on X”, as explain Partha Deb and Edward C. Norton. As the dependent variable is already in log, there will be a strong compression of the estimated value.

A comment is welcome,

José Alcides