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

RE: st: retransformation


From   Todd Wagner <[email protected]>
To   [email protected]
Subject   RE: st: retransformation
Date   Wed, 04 Sep 2002 10:06:48 -0700

The predlog command works if you can assume homoskedastic errors. You will have to create your own smearing estimator if you want to correct for groupwise heteroskedasticity. Also note that you should use the predlog command with the raw dependent variable (not logged).

Below is some code you could use.

*ln(y) with smearing estimator; homoskedastic errors
reg lncost x1 x2 x3 x4 x5 size2 size3, robust
outreg using escale, bdec(3) replace br
predict resid, resid
predict lny, xb
gen eresid=exp(resid)
egen emean2=mean(eresid)
replace lny=((exp(lny))*emean2)
drop eresid resid emean2

*heteroskedastic smearing estimator, correcting for organizational size
gwhet lncost, i(size_3) *tests to see if groupwise heteroskedasticity exists

reg lncost x1 x2 x3 x4 x5 size_2 size_3, robust
predict resid2, resid
predict lnyhse, xb
gen eresid=exp(resid)
egen emean=mean(eresid), by (size_3)
replace lnyhse=((exp(lnyhse))*emean)
drop eresid resid emean

All the caveats of M&M still apply.

Todd


At 11:55 AM 9/4/2002 -0400, you wrote:

You might to check out Gary King's program called Clarify (GKing.harvard.edu).
It allows you to run a log transformed regression and get predictions in the
raw scale with empirical standard errors based on simulations. It may also
work in this context.

--Michael

>===== Original Message From Chris Bojke <[email protected]> =====
>Judy,
>
>Having read the Manning and Mullahy article then I guess you know that
>you can avoid the need for retransforming for predictions of Y, by using
>GLM regression on the raw scale outcome measure. And (of course) GLM
>regression is very much a part of Stata.
>
>Since I guess you want to persist with doing a log transformation of y
>before regressing and then trying to get predictions of Y then the
>technique you need is called 'smearing' (I don't think M&M actually use
>that term in their excellent article). I've done a 'findit smearing' in
>Stata and it seems that there is something in STB August 9th 2002 (an
>auspicious time to ask your question then!) which will do the trick,
>called predlog.
>
>For further background reading 'Duan' seems to have done a lot of work
>on this subject
>
>
>Hope this is of help
>
>Chris
>
>"Shinogle, Judy" wrote:
>>
>> Does anyone have a program to do the log retransformation for
heteroscedastic errors?
>> (Similar to what is in Manning and Mullahy "Estimating log models: to
transform or not?
>> J. Health Economics 20: 461-494 (2001))
>>
>> In reading the article it looks like lnOLS-Het but not sure what that is?
>>
>> *
>> * For searches and help try:
>> * http://www.stata.com/support/faqs/res/findit.html
>> * http://www.stata.com/support/statalist/faq
>> * http://www.ats.ucla.edu/stat/stata/

________________________________________
Michael Ganz, MS, PhD
Assistant Professor
Dept. of Maternal and Child Health
Harvard School of Public Health
[email protected]
http://www.hsph.harvard.edu/faculty/ganz
Ph. 617-432-2382
Fax 617-432-3755

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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