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

Re: Re: st: proceeding beyond roctab 2000 error msg - correction


From   "Tonya Cropper" <tonya_cropper@ksgphd.harvard.edu>
To   "Statalist" <statalist-digest@hsphsun2.harvard.edu>
Subject   Re: Re: st: proceeding beyond roctab 2000 error msg - correction
Date   Tue, 1 Jun 2004 07:55:18 -0400

Thank you. The capture command worked great!  It solved the problem.  What
is _rc ? Return code?  Does every command have a _rc? I really need to buy
the [P] manual.

Thanks again,

Tonya


      From   Gary Longton <glongton@fhcrc.org>
      To   statalist@hsphsun2.harvard.edu
      Subject   Re: st: proceeding beyond roctab 2000 error msg - correction
      Date   Mon, 31 May 2004 18:28:31 -0700


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

2 lines of code in my earlier reply somehow ended up on one line.Here's
another attempt in hopes that it won't happen again, along with a couple of
other minor changes.****Use -capture- to suppress the error message and
capture the return code.see help for -capture-, or the manual [P] capture,
[U] chapt 21.The captured return code (nonzero if there was an error) can
then be used to write an appropriate result record for the conditions
resulting in an error. You don't say how you are generating your result
file, but if you were using, say, the -postfile- commands, this might look
something like:*************************sysuse auto, cleartempname
pfilepostfile `pfile' rep78 auc se badrecord using captest, replaceforvalues
i = 1/5 {capture roctab foreign weight if rep78 == `i'if _rc ~= 0 {post
`pfile' (`i') (.) (.) (1)}else {post `pfile' (`i') (`r(area)') (`r(se)')
(0)}}postclose `pfile'**************************- GaryTonya Cropper wrote:

Dear Statlisters,

I am using the  roctab command (Receiver Operating Characteristic (ROC)
analysis) and I get a
"outcome does not vary   r(2000) " error message.

I understand why I get the message.  I am performing the roctab command in a
three tier loop that includes various if statement conditions based on
different values of other variables.  I append observations to a file of
each resulting  std error and area.  To isolate and remove the
variables/conditions will cause me to forgo the loop and perform dozens of
roctab commands individually.  I would like to know is there any possible
way to proceed beyond the error message when the outcome does not vary?

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