[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Code and info for log-transformation

From   "Austin Nichols" <>
Subject   Re: st: Code and info for log-transformation
Date   Fri, 16 Nov 2007 22:22:14 -0500

Ziad El-Khatib <>:

It seems the first several lines of my prior post were eaten by the
majordomo.  I have pasted them back in place below.  I recommended you
start with
 ssc inst transint
 h transint

Maarten also had advice for you at
and here is more:

If y in a model like
 y_i = X_i b + e_i
is skewed, it could be that e_i is not skewed (perhaps a var in X is
skewed), and in fact the distribution of errors is perfectly symmetric
and perhaps even normal, but either way, you can still run
 reg y x*
since the Gauss-Markov theorem (that's the reason everyone uses
regression all the time) assumes only Var(e_i)=e for all i, which can
hold for arbitrary patterns of skewness in e_i.

If you are worried about heteroskedasticity, you can
 reg y x*, r
but I guess most folks who claim to be worried about skewness are in
fact worried about influential outliers.

However, if you run
 reg lny x*, r
you are assuming a different model of the form
 ln(y_i) = X_i b + e_i
is valid, with different interpretations, or in other words:
 y_i = exp(X_i b + e_i)
which is also the assumption in Poisson regression, so you could run
 poisson y x*, r
instead of
 reg lny x*, r
and there are various extensions (via -glm- or -nbreg- or -zip- or
-zinb-) or you can -ssc inst lognfit- for a ML estimator, or get the
GMM version of Poisson via
 ssc inst ivpois, replace
 ivpois y x*
which also allows you to add instrumental variables, and has an
updated help file with clickable examples.

On Nov 16, 2007 6:11 PM, Ziad El-Khatib <> wrote:
> Hi Austin
> thank you for your kind reply.
> is it ok to kindly explain more your answer, because i am afraid i did
> not understand it well, i am still trying to learn the terms
> discussions?
> Thank you in advance and best regards
> ziad

On Nov 16, 2007 3:08 PM, Austin Nichols <> wrote:

Ziad El-Khatib <>:
 ssc inst transint
 h transint
to start, but note you need not transform y just because it is skewed.

> > On 11/16/07, Ziad El-Khatib <> wrote:
> > > Dear STATA lister
> > > i am trying to find more info how to write command for
> > > log-transformation because i have skewed data?
> > >
> > > Or if you have any link to recommend to see?
*   For searches and help try:

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