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.

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

 From Nick Cox To statalist@hsphsun2.harvard.edu Subject Re: st: a way to calculate marginal products of transformed variables in post-estimation Date Sun, 4 Nov 2012 19:09:48 +0000

```The short answer to both questions is No. Stata doesn't recognise or
remember that a variable is transformed; at most a user knows that.
Nor can you use functions on the fly in the way that you can use time
series operators.

I don't understand precisely what you are trying to do, so I can't be
more constructive.

Nick

On Sun, Nov 4, 2012 at 5:16 PM, Megan Sheahan <megan.sheahan@gmail.com> wrote:
> 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)
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```