-------------------------------------------------------------------------------
help for levpredict
-------------------------------------------------------------------------------

Compute level predictions from log-dependent-variable regression reducing retra > nsformation bias

levpredict newvarname [, Duan PRint]

levpredict is a post-estimation command for use after a linear regression model with a logarithmic dependent variable has been estimated. It generates predictions of the levels of the dependent variable for the estimation sample. These predictions reduce the retransformation bias that arises when predictions of the log dependent variable are exponentiated.

Description

Cameron and Trivedi (2009), in section 3.6.3, "Prediction in logs: The retransformation problem" point out that if a regression model with a logarithmic dependent variable is estimated, predictions of the underlying level variable will be subject to retransformation bias. That is, predict will calculate E[ln y|x], but we wish to calculate E[y|x]. Exponentiating the predicted values from the log model will not provide unbiased estimates of E[y|x], as E[y_i|x_i] = exp(x'beta) E[exp(u_i)], and the second term will be ignored. If u~N[0,sigma^2], E[exp(u)] = exp(0.5 sigma^2). That quantity may be estimated by replacing sigma^2 with its consistent estimate s^2. Alternatively, Duan (1983) shows that for i.i.d. errors (which need not be Normal), E[exp(u)] = 1/n sum(exp(e_i)), where e_i are the residuals.

levpredict computes the predictions of the levels of the dependent variable from a prior model estimated with the log of the dependent variable. It assumes > that you have performed that estimation with some regression-type estimator, and tha > t the dependent variable of the prior model is indeed the log of the variable of inte > rest. By default, levpredict computes the former formula, assuming normally distribut > ed errors, but with the Duan option the latter formula may be used.

It should be kept in mind that an alternative approach to this problem would be to avoid OLS estimation and use glm or poisson regression to estimate the original model instead. The approach implemented by levpredict wil > l improve the mean prediction, but does not ensure that predictions for individua > l cases are particularly good. See Austin Nichols' presentation at the BOS'10 Stata Conference.

Options

Duan specifies that Duan's formula should be used.

PRint specifies that printed output should be produced. In this case, estimates of the mean of the exponentiated predicted values and its mean bias are displayed.

Saved results

levpredict does not save any results at this time. Its primary purpose is to calculate newvarname. See return list.

Examples

. use http://fmwww.bc.edu/ec-p/data/mus/mus03data

. reg ltotexp suppins phylim actlim totchr age female income

. levpredict tenorm, print

. levpredict teduan, duan print

. su totexp ltotexp tenorm teduan if totexp > 0

References

Cameron, A.C. Trivedi, P., 2009. Microeconometrics using Stata. Stata Press.

Duan, N., 1983. Smearing estimate: A nonparametric retransformation method. Journal of the American Statistical Association 78:605-610.

Nichols, A., 2010. Regression for nonnegative skewed dependent variables. BOS'10 Stata Conference. Accessible from http://repec.org/bost10/nichols_boston2010.pdf

Acknowledgements

Development of this routine was stimulated by Cameron and Trivedi's discussion, > from which the computational logic and example were derived. I thank Maarten Buis for helpful comments.

Author

Christopher F Baum, Boston College, USA baum@bc.edu