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

st: RE: edit command


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: edit command
Date   Thu, 8 May 2003 09:04:05 +0100

Jorge Tuesta Eg�squiza

> I am trying to verify the validity of some data... so i am
> running a do-
> file, where i am trying to identify the errors by screening
> them using
> the "edit" command.  The problem is that when there are no errors
> (meaning "no observations"), the do-file stops anyway just
> after the
> first "edit" command in the do-file.   Probably there is an
> option or a
> command that allows the do-file to continue running when the "edit
> command" detects no observations.

You could make the -edit- conditional on there being something to
edit, say

(Stata 8)

qui count if <condition>
if r(N) > 0 edit

(Stata 7)

qui count if <condition>
if r(N) > 0 { edit }

Nick
[email protected]

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