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

RE: st: another data cleaning question [correction]


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: another data cleaning question [correction]
Date   Mon, 24 Jun 2002 10:25:53 +0100

> I suggest that any test be in terms of the first three
> characters of the string equivalent.
> 
> list if string(cropcode) != substr(string(varcode,1,3))

Better as 

list if string(cropcode) != substr(string(varcode),1,3) 

> 
> More generally, whenever codes are pseudo-numeric, there
> are several advantages to holding them as strings.
 
Nick 
n.j.cox@durham.ac.uk 
*
*   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