Statalist


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

st: RE: Cragg-Donald-Stock-Yogo critical values (was RE: Date: Wed, 2 Apr 2008 18:36:19 -0400)


From   "Raymond Guiteras" <[email protected]>
To   <[email protected]>
Subject   st: RE: Cragg-Donald-Stock-Yogo critical values (was RE: Date: Wed, 2 Apr 2008 18:36:19 -0400)
Date   Wed, 2 Apr 2008 19:42:03 -0400

Thanks Mark, I will give that a shot.

Best,
Raymond

PS - Yes, sorry about the lack of subject line. I realized I'd forgotten to
write it about 1 millisecond after hitting "send".

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Schaffer, Mark E
Sent: Wednesday, April 02, 2008 7:26 PM
To: [email protected]
Subject: st: Cragg-Donald-Stock-Yogo critical values (was RE: Date: Wed, 2
Apr 2008 18:36:19 -0400)

Raymond,

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Raymond Guiteras
> Sent: 02 April 2008 23:37
> To: [email protected]
> Subject: st: Date: Wed, 2 Apr 2008 18:36:19 -0400
> 
> Dear Statalist,
> 
> I am using the excellent --ivreg2-- to test for weak 
> instruments. I would like to use the Stock-Yogo critical 
> values that are displayed but do not see an ereturn scalar or 
> matrix that corresponds to these values. Is there a way to 
> extract these?

This facility doesn't exist, though it's a good suggestion and worth
considering for a future version.

That said, you can easily extract the code for the critical values from
ivreg2.ado and create your own Stata program to look them up.  Near the
bottom is a block of code that starts

program define cdsy, rclass

and ends with (surprise)

end

Copy this block of code into a file called cdsy.ado
(Cragg-Donald-Stock-Yogo), save it in your personal ADO folder, and you
have an rclass program that finds the critical value and leaves it in
r(cv).  A typical call would be

cdsy, type(xxx) k2(yyy) nendog(zzz)

where

type() can be "ivbias5" (or 10, 20, 30), "ivsize10" (or 15, 20, 25),
"limlsize10" (or 15, 20, 25), "fullrel5" (or 10, 20, 30), "fullmax5" (or
10, 20, 30).

k2() is the number of excluded exogenous variables

nendog() is the number of endogenous regressors

Thus

. cdsy, type(ivbias5) k2(6) nendog(2)

. return list

scalars:
                 r(cv) =  15.72

Or after a call to -ivreg2-,


. cdsy, type(ivbias5) k2(`e(exexog_ct)') nendog(`e(endog_ct)')

. return list

scalars:
                 r(cv) =  15.72

Cheers,
Mark

NB: You should try to use a more informative subject line next time.
Postings to Statalist with the subject "Date: Wed, 2 Apr 2008 18:36:19
-0400" are not designed to attract wide interest!

> I am using the following version of ivreg2: 
> e(version) :
> "02.2.08", which I believe is the most recent. I apologize in 
> advance if I am missing something obvious or if this has been 
> discussed before; my search of the archives & online help did 
> not turn up an answer to this question.
> 
> Many thanks,
> Raymond
> 
> PS - I attempted to post this yesterday evening (EDT) but as 
> far as I can tell it did not make it to the list (i.e. it has 
> not yet shown up in either archive). I apologize if this is 
> (or becomes) a duplicate post.
> 
> *
> *   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/
> 


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


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