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

st: RE: identifying nonnumeric values in a variable


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: identifying nonnumeric values in a variable
Date   Wed, 19 May 2004 13:40:33 +0100

I think what you have is a string variable; 
_all_ its values to Stata are string, but some have a 
simple numeric interpretation. Try 

. list varx if missing(real(varx)) 

Nick 
n.j.cox@durham.ac.uk 

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of
> jsimons@usd.edu
> Sent: 19 May 2004 13:35
> To: statalist@hsphsun2.harvard.edu
> Subject: st: identifying nonnumeric values in a variable
> 
> 
> I have a dataset that has some errors in it in which a 
> variable has a few string values. I was wondering how i can 
> get Stata to identify these for me.  Essentially, the data is 
> like this:
> 
> id      varx    .......
> 1          10
> 2           2
> 3          5 - 10
> 4            3
> 5            12
> 
> 
> I would like Stata to be able to tell me that the varx for 
> id3 has a value of "5 - 10" so I can then replace it and 
> destring varx. The dataset is rather large and scanning by 
> eye is cumbersome, especially trying to identify the times 
> when "o" was entered instead of "0".
> 
> Any help would be appreciated.
> thanks.
> 
> 
> *
> *   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/
> 

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