Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: AW: predict residuals in Stata 10


From   Marco Buur <[email protected]>
To   [email protected]
Subject   Re: st: AW: predict residuals in Stata 10
Date   Wed, 31 Mar 2010 11:47:55 +0200

This is very useful, thanks!!
It appears that duan option doesn't work after xtreg.

.  levpredict X, duan
option res not allowed
r(198);


Manually coding it seems to me that we correct E(exp(u)) after antilog
transormation which fits with u - fixed and random effect component in
case of xtreg. With Predlog i got simular results

predict resid,u
gen resid2 = exp(resid)
su resid2, meanonly
scalar meanres = r(mean)


Regards
Marco

On Tue, Mar 30, 2010 at 6:07 PM, Martin Weiss <[email protected]> wrote:
>
> <>
>
> Maybe - ssc d levpredict- by Kit Baum is helpful to you.
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Marco Buur
> Gesendet: Dienstag, 30. März 2010 18:01
> An: [email protected]
> Betreff: Re: st: AW: predict residuals in Stata 10
>
> Thank you
> I am not sure which residualds I should use in Duan smearing antilog
> transfomation: "ue"(combined),  "u"(random error) or "e"(overall
> error)
> Your help is highly appreciated.
>
> Marco
>
> On Thu, Mar 25, 2010 at 11:49 AM, Martin Weiss <[email protected]> wrote:
>>
>> <>
>>
>> Everything depends on which residual you are talking about:
>>
>>
>> *************
>> //     Setup
>> vers 10.1
>> webuse nlswork, clear
>>
>> gen age2 = age*age
>> gen ttl_exp2 = ttl_exp*ttl_exp
>> gen tenure2 = tenure*tenure
>> gen byte black = race==2
>>
>> xtset idcode
>>
>> //    Fixed-effects model
>> xtreg ln_w grade age* ttl_exp* /*
>>  */  tenure* black not_smsa south, fe
>>
>> predict comb, ue
>> predict error, e
>> *************
>>
>>
>> The panel case is obviously not just an extension of -regress- where you
> can
>> indeed use the syntax -predict res, res-. Look at -help xtreg
> postestimation
>> ,mark(predict)- to see all available -predict- options after -xtreg-...
>>
>>
>> HTH
>> Martin
>>
>> -----Ursprüngliche Nachricht-----
>> Von: [email protected]
>> [mailto:[email protected]] Im Auftrag von Marco Buur
>> Gesendet: Donnerstag, 25. März 2010 10:35
>> An: [email protected]
>> Betreff: st: predict residuals in Stata 10
>>
>> Dear Stata members,
>>
>> I would like to predict residuals after xtreg  command (Stata 10) in
>> order to use meanonly residuals for Duan smearing antilog
>> transformation
>>
>> predict res, res
>>
>> but it doesn't work in Stata 10
>>
>> Any hint?
>>
>> Thanks
>> Marco
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/statalist/faq
>> *   http://www.ats.ucla.edu/stat/stata/
>>
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/statalist/faq
>> *   http://www.ats.ucla.edu/stat/stata/
>>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index