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: RE: Saving first-stage y_hat from xtivreg2


From   [email protected]
To   [email protected]
Subject   Re: st: RE: Saving first-stage y_hat from xtivreg2
Date   Mon, 14 Mar 2011 19:57:34 +0000

Hi Mark,

Thanks for the tip. I should have said that I tried it, but it didn't work. 

I entered:

xtivreg2 y1 x1 x2 x3 (y2 = z1), gmm2s kernel barlett bw(1) fe first savefirst

estimates restore _xtivreg2_y2

predict pred_y2


But the fitted values of y2 were not produced

Have I missed a step?

Many thanks, May







------------------

-----Original Message-----
From: "Schaffer, Mark E" <[email protected]>
Sender: [email protected]
Date: Mon, 14 Mar 2011 18:18:05 
To: <[email protected]>
Reply-To: [email protected]: st: RE: Saving first-stage y_hat from xtivreg2

May,

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> [email protected]
> Sent: 14 March 2011 17:39
> To: [email protected]
> Subject: st: Saving first-stage y_hat from xtivreg2
> 
> Hi, I have an issue getting stata to predict first-stage 
> y2_hat. Can someone help please?
> 
> My data are panel. 
> 
> My model is:
> 
>  xtivreg2 y1 x1 x2 x3 (y2 = z1), gmm2s kernel barlett bw(1) fe first
> 
> So first stage is:
> y2 x1 x2 x3 z1
> 
> How do I get predicted y2 please?

Have a look at the -savefirst- option as described in -help ivreg2-.

Cheers,
Mark

> 
> Tried "predict pred_y2, equation(first)" but this doesn't work. 
> 
> Thanks!
> 
> May 
> 
> 
> 
> ------------------
> 
> *
> *   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/
> 


-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.


*
*   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