You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: predict, get_prediction with log or transformed endog #2791
How do we get prediction and similar for models with transformed endog?
example log(y) ~ ... estimated with OLS
related to issue #1449#1480
also related: use Poisson instead, several articles and FAQ
also GLM-Gamma is close to lognormal model
specific point: correcting the prediction of the original so we get E(y | x) or E(y | ?) for population.
We have an explicit expression for the correction under lognormality assumption.
in general we can use a smearing estimate
It's not clear yet how to connect this to the models (especially we don't know which transformation the user has used), but we can provide at least some helper function.
It fits most likely in the topic of various predict functions and methods. (PR #2296 )
see also documentation for Stata boxcox postestimation: smearing is over the estimated residuals for each given exog.
Stata cites the next reference. I only read parts of the second referency joint with Hausman
Abrevaya, Jason. 2002. “Computing Marginal Effects in the Box–Cox Model.” Econometric Reviews 21 (3): 383–93. doi:10.1081/ETC-120015789.
Abrevaya, Jason, and Jerry A. Hausman. 2004. “Response Error in a Transformation Model with an Application to Earnings-Equation Estimation*.” Econometrics Journal 7 (2): 366–88. doi:10.1111/j.1368-423X.2004.00135.x.
question: Does smearing of estimated residuals really make much sense if there is heteroscedasticity, as in Poisson models, or log-linear if the distribution does not correspond to log-normal?
e.g. variance as function of mean (mu) or of exog is mis- or unspecified.
update: smearing in this way doesn't work with heteroscedasticity
Google search finds several closely related items
changed the title [-]ENH: tools predict with log or transformed endog[/-][+]ENH: predict, get_prediction with log or transformed endog[/+]on Nov 8, 2022
I don't know what's currently the quickest way to get params_table or prediction table with inference for this
I went through this recently in the context of margins, nonlinear prediction where both endog and an exog could be transformed nonlinearily
we can do it generically with _get_wald_nonlinear
but for the special case of "mean" prediction of transformed endog we could add bias correction, parametric or smearing.
I'm not sure whether this bias correction should affect asymptotic standard errors and confint (I guess we can keep se unchanged and shift the confint)
bump for 0.15 together with nonlinear prediction methods
It includes an approximation to the retransformed mean for Box-Cox transformation (for lambda not close to zero, i.e. away from log tranform)
comparison to smearing estimate in Monte Carlo
(based on very brief skimming.)
Activity
josef-pkt commentedon Mar 16, 2016
see also documentation for Stata boxcox postestimation: smearing is over the estimated residuals for each given exog.
Stata cites the next reference. I only read parts of the second referency joint with Hausman
Abrevaya, Jason. 2002. “Computing Marginal Effects in the Box–Cox Model.” Econometric Reviews 21 (3): 383–93. doi:10.1081/ETC-120015789.
Abrevaya, Jason, and Jerry A. Hausman. 2004. “Response Error in a Transformation Model with an Application to Earnings-Equation Estimation*.” Econometrics Journal 7 (2): 366–88. doi:10.1111/j.1368-423X.2004.00135.x.
josef-pkt commentedon Mar 16, 2016
question: Does smearing of estimated residuals really make much sense if there is heteroscedasticity, as in Poisson models, or log-linear if the distribution does not correspond to log-normal?
e.g. variance as function of mean (mu) or of exog is mis- or unspecified.
update: smearing in this way doesn't work with heteroscedasticity
Google search finds several closely related items
http://harris.uchicago.edu/sites/default/files/iHEA_Sydney_minicourse.pdf "Modeling Health Care Costs and Counts"
slides that look like a good overview
more recent version, Stata files and data
http://econ.hunter.cuny.edu/parthadeb/teaching/health-econometrics-minicourse/
slides of a talk https://courses.washington.edu/b572/TALKS/2013/ScottCoggeshall-1.pdf for the heteroscedastic case. there should be a article for it.
[-]ENH: tools predict with log or transformed endog[/-][+]ENH: predict, get_prediction with log or transformed endog[/+]josef-pkt commentedon Nov 8, 2022
before I mainly looked at this for mean prediction, mean or plim
However, we also need inference, that is
get_predictionhttps://stats.stackexchange.com/questions/594806/determine-uncertainty-of-regression-prediction-with-logged-explanatory-and-respo
I don't know what's currently the quickest way to get params_table or prediction table with inference for this
I went through this recently in the context of margins, nonlinear prediction where both endog and an exog could be transformed nonlinearily
#7833 (comment)
#5387
we can do it generically with
_get_wald_nonlinearbut for the special case of "mean" prediction of transformed endog we could add bias correction, parametric or smearing.
I'm not sure whether this bias correction should affect asymptotic standard errors and confint (I guess we can keep
seunchanged and shift the confint)bump for 0.15 together with nonlinear prediction methods
josef-pkt commentedon Mar 12, 2025
a reference found by chance
Taylor, Jeremy M. G. 1986. “The Retransformed Mean After a Fitted Power Transformation.” Journal of the American Statistical Association 81 (393): 114–18. https://doi.org/10.2307/2287976.
It includes an approximation to the retransformed mean for Box-Cox transformation (for lambda not close to zero, i.e. away from log tranform)
comparison to smearing estimate in Monte Carlo
(based on very brief skimming.)