Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: help log linear

From   David Gottschlich <[email protected]>
To   [email protected]
Subject   Re: st: help log linear
Date   Sun, 22 Feb 2004 18:40:06 -0500

I seem to have gotten this a long time after you sent it, so you may have the answer already (and please forgive me if I giving the wrongly simple answer to a complex question), but....

predict logy
will give you the predicted result for each independent x; of course, this will be in log space.

If you used the natural log, then
generate predicty=exp(logy)
will convert the predictions back to real space

generate predicty=10^logy
works if you used the common log.

For most (many?) applications, it's more common to use the form
y=a ln(x) + b
ln(y)=a x + b

If you are using the second form, of course you cannot force y to equal zero unless you can reach negative infinity from your function.


[email protected] wrote:


I am having a bit of difficulties figuring out how to predict a y
in a log linear model. I cannot determine the following items:

1)obtaining fitted values of logy(i) from the regression of logy
on each independent x
2)for each observation i, creating a variable equal to exp(logy(i))
3)performing a regression through the origin

Any other information that could be provide to assist in running a
log linear regression would be greatly appreciated.

I could not find anything in my manual about it.

Thank you,
* For searches and help try:

*   For searches and help try:

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