[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: R: st: R: linear regression question

From   Austin Nichols <>
Subject   Re: R: st: R: linear regression question
Date   Tue, 17 Mar 2009 16:46:25 -0400

Galina, Laszlo, et al:
If one is discussing marginal effects, 100*beta% is not an
approximation; it is the marginal effect.  But the marginal effect is
an approximation to any discrete change.  (I am not disagreeing with
anything said in this thread so far, just elaborating.)

The marginal effect of a one-unit change in X on Y in a loglinear
model is 100*beta% using calculus, but the calculus answer will be
inadequate for approximating discrete changes in X when beta is large
in absolute value (which in turn is often caused by adopting units for
X that mean that a one-unit change in X cannot be considered marginal)
and 100*beta% is less similar to 100*(exp(beta)-1)%  Note that it is
easy to be led astray in nonlinear calculations--ask yourself what the
marginal effect of an additional week worked is in these models:

webuse psidextract, clear
reg lwage wks, nohe
loc w=_b[wks]
g pwks=wks/52
reg lwage pwks, nohe
loc p=_b[pwks]
di `w', `p'/52, exp(`w')-1, (exp(`p')-1)/52

The last number shown is the "marginal" effect of a 52-week increase,
using Laszlo's formula, divided by 52, to give the incorrect
answer--the correct answer of course divides by 52 first (I am sure
Laszlo would never make this error of interpretation, but it is quite
possible that a naive user of Laszlo's formula might).  Laszlo's
formula is for a one-unit discrete change in X, which is at least as
valuable for interpreting coefficients, and often more valuable, but
is not what is usually meant by a marginal effect (see e.g. -help
mfx-), though at least some authors conflate the two.

Whenever the coefficient is large, the interpretation of the marginal
effect is complicated by the fact that the calculus answer is probably
a poor approximation to plausible discrete changes in X, and even a
coefficient of 0.065 can be large for this purpose...

reg lwage ed, nohe
loc r = _b[ed]
* Predictions of effect of four-year increase in educ
* in terms of percentage increase in wage:
di `r'*4, (1+`r')^4-1, (exp(`r')-1)*4, (exp(`r'*4)-1)

In these cases, of course, one is well-advised to calculate the effect
of a discrete change rather than rely on the marginal effect.  I.e.
the last answer above (.2979877), given by thoughtful application of
Laszlo's formula, is the best answer, and the naive approach gives an
answer seven eighths as big.

The issue, presumably, is that people want to have the SE as well, and
100*beta has the SE given (100*se), together with the confidence
interval, p-value, etc., whereas 100*(exp(beta)-1) needs -nlcom- to
calculate those, which makes tabulation look like more work, but note:

reg lwage ed, nohe
nlcom exp(_b[ed])-1
esttab, b(%10.7f) se(%10.7f) nostar transform(exp(@)-1 exp(@))

using -estout- (ssc install estout).

2009/3/17 dr kardos laszlo <>:
> dear carlo,
> that is not exactly what i was suggesting. the way i see this, thoroughly
> checking that the base is natural is not enough. 100*beta% is practically
> always different from 100*(exp(beta)-1)%. one can use the former and go the
> extra step judging each time whether the deviance from the real thing is
> tolerable. i know i wouldn't. there is simply no gain in simplicity or
> anything.
> best regards,
> laszlo
> Carlo Lazzaro wrote:
>> Dear Laszlo,
>> thanks for your remark. The potential misleading arises because the use of
>> natural log is the reference in econometrics textbook. However, as you
>> suggested, a thorough check of this requirement should be made, in order
>> to
>> avoid bewildering results.
>> Kind Regards,
>> Carlo
>> -----Messaggio originale-----
>> Da:
>> [] Per conto di dr kardos
>> laszlo
>> Inviato: martedi` 17 marzo 2009 8.34
>> A:
>> Oggetto: Re: st: R: linear regression question
>> unless i got something wrong,
>> the relative change in y associated with a unit change in x in such models
>> works out as antilog(beta) on the appropriate base. in this case, because
>> galina explicitly mentioned natural log, and using carlo's example, it is
>> exp(.2) = 1.2214, a 22.14% increase. try with base-10 and you will get
>> something completely different.
>> the approximation 100*beta% works better and better as beta approaches
>> zero (and as the log-transformation base approaches 1, but that's not
>> typical in practice). in the stata journal article referred to below,
>> beta=.0741516 and exp(beta)=1.07697, arguably close to 1.07415. in other
>> cases, the difference might be to an extent you do not want to ignore.
>> laszlo
>> Galina Hayes wrote:
>>> Thanks very much everyone, very helpful.
>>> Galina
>>> ----- Original Message -----
>>> From: "Maarten buis" <>
>>> To:
>>> Sent: Sunday, March 15, 2009 11:48:52 AM GMT -05:00 US/Canada Eastern
>>> Subject: Re: st: R: linear regression question
>>> --- On Sun, 15/3/09, Carlo Lazzaro wrote:
>>>> your thread seems to refer to a log-linear model, where
>>>> only the dependent variable (i.e., Y) is log-transformed.
>>>> In a log-linear model, a unit-change in the independent
>>>> variable X (i.e., DeltaX=1)is associated with a 100*Beta% change in Y.
>>> This is one possible way of interpreting such a model. An alternative way
>>> is discussed in: Roger Newson (2003) "Stata
>>> Tip 1: The eform() option with regress" The Stata Journal,
>>> 3(4): 445.
>>> Both interpretations are correct, they are just different
>>> ways of looking at the same model.
>>> Hope this helps,
>>> Maarten
*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index