on 9/8/02 12:00 PM, [email protected] at
[email protected] wrote:
> The
> variable name is siteterm and is stored at string10 type. When I am
> analysisng the data I need to keep and drop certain cancer sites
> however I am having trouble doing this. I have no problem dropping
> variables that are stored as int and byte types for example
> keep if year==1996
> but when I try to do the following
> keep if siteterm==lung
> I have the error "lung not found; r(111)" returned.
You're going to kick yourself. And I know this for a fact, because I once
spent 2 days going crazy over exactly the same problem in another stats
package!
Stata things that the expression `siteterm==lung' is asking it to test if
the variable siteterm has the same value as the variable lung.
To make it clear to Stata that the argument is a string, enclose it in
double quotes.
. keep if siteterm=="lung"
Note that this will not find "Lung" or "lung ", so tabulate your data to
make sure that site is always spelled the way you think it is.
Ronan M Conroy ([email protected])
Lecturer in Biostatistics
Royal College of Surgeons
Dublin 2, Ireland
+353 1 402 2431 (fax 2329)
--------------------
And now, Mr President, how about the global alliance against climate change?
*
* 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/