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

RE: st: Re: destringing


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   RE: st: Re: destringing
Date   Sat, 28 Aug 2004 10:55:47 -0500

> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Suzy
> Sent: Saturday, August 28, 2004 10:30 AM
> To: [email protected]
> 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index