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

RE: st: Setting a missing value in a generic context


From   David Kantor <dkantor@jhu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: Setting a missing value in a generic context
Date   Tue, 08 Mar 2005 11:54:30 -0500

Thanks to everyone who responded on this issue.

I would concur with Nick that you need to be careful with -capture-, in that it can, as he put it, eat errors other than the ones you are expecting.

-- David

At 11:07 AM 3/8/2005 +0000, you wrote:

Note that the -capture- can eat other
errors too, most obviously that `v'
holds an illegal variable name or that
`v' doesn't exist as a variable. However,
the obvious retort to that is to ensure
this code is used in a context in which
`v' does pick up the name of an existing variable.

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

Seb Buechte

> What I suggest is certainly not elegant yet it is simple and
> should work, too:
>
> capture replace `v'=.
> capture replace `v'=""
[...]
David Kantor
Institute for Policy Studies
Johns Hopkins University
dkantor@jhu.edu
410-516-5404
*
*   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