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

RE: st: Re: destringing


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Re: destringing
Date   Sat, 28 Aug 2004 10:55:47 -0500

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Suzy
> Sent: Saturday, August 28, 2004 10:30 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: Re: destringing

<snip>

> But then , trying to analyze anything with  the dxcode or procode
> variable name returned this type of output:
> 
> . tab dxcode1 if dxcode1==V3000
> V3000 not found
> r(111);
> 
>  I also tried this:
> 
> tab dxcode1 if dxcode1==v3000
> v3000 not found
> r(111);
> 
> And this....
> 
> tab dxcode1 if dxcode1==27500  (just numeric)
> type mismatch
> r(109);
> 
> That's why I then went ahead and used the destring (and force)
> option...which  made the dash and alpha-numerics disappear as missing
> datapoints - but did allow me to read the pure numeric numbers under
> these variable names.
> 

Since dxcode1 is a string variable the value following the if qualifier must
be enclosed in quotes

- tab dxcode1 if dxcode1=="V3000" -

Or if the codes are in lower case:

- tab dxcode1 if dxcode1=="v3000" -

In Stata, capitalization matters V3000 and v3000 would be treated as
different values.


Scott
  

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