Statalist


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

st: Re: to check if a variable already exists


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: to check if a variable already exists
Date   Tue, 7 Oct 2008 00:40:29 +0200

-h confirm new-

HTH
Martin
_______________________
----- Original Message ----- From: "Jacob Wegelin" <jwegelin@vcu.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, October 07, 2008 12:20 AM
Subject: st: to check if a variable already exists



Is there a way to check whether a variable is already defined, already exists? I'd like to write code of the following sort:


if (variable called performance is not yet defined) {
gen performance=.
}
replace performance=5 if name=George

Thanks for any ideas

Jake

Jacob A. Wegelin
jwegelin@vcu.edu Assistant Professor
Department of Biostatistics
Virginia Commonwealth University
730 East Broad Street Room 3006
P. O. Box 980032
Richmond VA 23298-0032
U.S.A. http://www.people.vcu.edu/~jwegelin
*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index