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

st: Re: transforming predictions from loglinear models

From   "Christer Thrane" <>
To   <>
Subject   st: Re: transforming predictions from loglinear models
Date   Fri, 26 Aug 2005 18:47:34 +0200

Wooldridge shows you how to do this--se example 6.7 at:



Professor Christer Thrane
Department of Social Science
Lillehammer University College
2626 Lillehammer, Norway

+ 47 61 28 81 70 (fax)
+ 47 61 28 82 47 (phone, work)
+ 47 61 25 53 04 (phone, home)

E-mail, work:
E-mail, home:

----- Original Message ----- From: <>
To: <>
Sent: Friday, August 26, 2005 10:49 AM
Subject: st: transforming predictions from loglinear models


I want to estimate a simple log-linear OLS regression in Stata and then
use the model to generate predictions. Say the model looks like this:

regress ln_y ln_x1 ln_x2

where all the variables are in logs. After running the model, I'd like
to predict values of y over different values of x1, holding x2 fixed at
the mean. The problem is that my predicted y is in log form, which I
want to transform to y. One solution is to simply take exp(prediction of
ln_y), but this has been shown to result in a biased predictor. The
following article discusses various techniques for dealing with this,
focusing specifically on a Laplace conversion:

van Garderen, Kees Jan, 2001.
"Optimal prediction in loglinear models," Journal of Econometrics,
Elsevier, vol. 104(1), pages 119-140

Does anyone know if any such techniques have been implemented in Stata?
Would predictnl do the trick, as in:

predictnl yhat = exp(_b[cons] + _b[ln_x1]*ln_x1 + _b[ln_x2]*ln_x2],
Many thanks for any input,


* For searches and help try:

*   For searches and help try:

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