Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# RE: st: interpreting cofficient on interaction of two logged variables

 From "D'Souza, Anna - ERS" To "statalist@hsphsun2.harvard.edu" Subject RE: st: interpreting cofficient on interaction of two logged variables Date Tue, 21 Aug 2012 21:11:19 +0000

```Thank you David H., and from before David G. and Maarten.

I mustn't have been thinking clearly when I wrote the first question this morning - of course Log (ab)=Log a + Log b.... no references needed. Sorry.

The main question I have is #2 - I would like to find STATA code that calculates the average marginal effects of log x1 on log y - across all values of log x1. The coefficient on the interaction term that STATA provides is the marginal effect of log x1 on log y evaluated at the mean of log x2 (of course to get the total marginal effect of log x1 we need to add the coefficient on log x1 as well). Is there a way to have STATA calculate (and perhaps plot) the total marginal effect of log x1 on log y (against all values of x2)?

Anna

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of David Hoaglin
Sent: Tuesday, August 21, 2012 4:25 PM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: interpreting cofficient on interaction of two logged variables

Dear Anna,

Others have commented on the mathematics of the log function.

I assume that the interaction predictor is in that model for a good reason, either from the theory underlying the model or because you (or
others) have found that it makes a useful contribution in actual sets of data.  The justification for including the interaction term should come from one of these sources.

After you have decided to transform x1 and x2 by taking their logarithms (for any of a variety of reasons), they are simply predictors in the model (that happen to be measured in the log scale).
Their interaction represents (or summarizes) a nonlinearity in the relation of log(y) to log(x1) and log(x2).  The slope of log(y) against log(x1) varies with the value of log(x2), and similarly for the slope of log(y) against log(x2).

Viewed in another way, the model describes a particular type of quadratic surface in the variables log(x1) and log(x2).  By replacing
log(x1) and log(x2) by suitable linear combinations of those two variables, it should be possible to eliminate the interaction term, in trade for separate quadratic terms in log(x1) and log(x2), though that may not improve the interpretability of the model.

David Hoaglin

On Tue, Aug 21, 2012 at 8:40 AM, D'Souza, Anna - ERS <ADSOUZA@ers.usda.gov> wrote:
> Hello,
>
> I am interested in estimating the following model: log y = b0 + b1 log
> x1 + b2 log x2 + b3 (log x1 * log x2) + e
>
> Question 1: Does anyone have a reference that describes the interaction of logged variables? I am looking for a justification as to why to use "log x1 * log x2" vs. log (x1 * x2).
>
> Question 2: What is the best way to calculate the (i) average marginal effect on x1, and (ii) the marginal effect of x1 evaluated at the mean of x2 in STATA?
>
> Thank you,
>
> Anna
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```