Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: predict residual after treatreg


From   "Shehzad Ali" <sia500@york.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: predict residual after treatreg
Date   Mon, 2 Jun 2008 14:52:10 +0100

Thanks, Martin and Nick. I will use - gen - to get my residuals.

Shehzad


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of n j cox
Sent: 01 June 2008 18:02
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: RE: predict residual after treatreg

Following Martin's suggestion:

1. It is evident that -predict- after -treatreg- does not support 
residual calculation. Thus you are asking for something not provided by 
Stata, as Stata is indeed telling you.

2. I can't comment on why not. But it would seem that

predict predicted
gen residual = y - predicted

is what you need for vanilla flavour residuals. If you want some other 
flavour, the same tactic is indicated: you should use what is provided 
by -predict- as building blocks.

Nick
n.j.cox@durham.ac.uk

Martin Weiss

**********
webuse labor, clear
g byte wc = 0
replace wc = 1 if we > 12

treatreg ww wa cit, treat(wc=wmed wfed) two
db predict
**********

to see the available options under predict...

Alternatively type -h treatreg postestimation-

Shehzad Ali

I am trying to predict residuals after running treatreg command. Here is
what I am doing:

treatreg y x1 x2 x3, treat (x1=x2 x3 x4) twostep

predict r, resid

treatreg command works but predict command gives this error 'option resid
not allowed'.


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index