Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# st: a way to calculate marginal products of transformed variables in post-estimation

 From Megan Sheahan To statalist@hsphsun2.harvard.edu Subject st: a way to calculate marginal products of transformed variables in post-estimation Date Sun, 4 Nov 2012 12:16:52 -0500

```Hello,

I am running a regression which includes a number of variables that
have been transformed to logs. For example:

variable name lN_ha = log(N_ha)

Both the y and continuous x variables in my model are in log form. In
post estimation, I would like to recover the marginal products of
N_ha. Using the margins command, however, Stata provides elasticities,
not the marginal products. Is there a way to tell Stata that (1) your
variables are transformed so that it can provide the true marginal
products of the log transformed variable automatically and/or (2) NOT
transform the variables into a new variable but tell Stata that you
want the variable as a log in the regression (e.g., like using L. for
lagged variables or i. for categorical variables).

For reference, here is the syntax for the regression I am running.

regress lyield_ha c.lN_ha#i(1 2 3)zone_comb c.lN_ha#c.lN_ha#i(1 2
3).zone_comb c.lN_ha#c.lP_ha#i(1 2 3).zone_comb c.lN_ha#i(1 2
3).soil_group_megan c.lN_ha#c.lrain_stress#i(1 2 3).zone_comb lseed_ha
c.lseed_ha#c.lseed_ha lhectares c.lhectares#c.lhectares lmasset_ha
c.lmasset_ha#c.lmasset_ha lrain_stress i.manure i.hybrid
c.lrain_stress#hybrid i.legume i.crop_per_field i.dist i.FAO_class
i.year, cluster(hhid)