You don't need two versions of the same thing
to do this.
. list strvar if mi(real(strvar))
or
. tab strvar if mi(real(strvar))
are examples of what you can do with a problematic
string variable strvar.
Nick
[email protected]
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of
> Joseph McCrary
> Sent: 28 May 2004 13:53
> To: Statalist
> Subject: Re: st: RE: STATA reads numbers as strings
>
>
> A bit late, but...
>
> One thing I've done in the past is read the variable once as
> a string and
> then again as a number. Then you can find those cases for which the
> numeric version of the variable is missing. At that point, look at the
> string version to see what the problem is. I did this when I
> did not want
> to dump a whole lot of cases because of the way DSM codes were entered
> into a database. I was able to go back and fix the variables so that I
> lost many fewer cases.
>
> Joe
>
>
> On Tue, 11 May 2004 17:36:27 +0100, "Nick Cox" <[email protected]>
> said:
> > Some relevant links:
> >
> > http://www.stata.com/support/faqs/data/allstring.html
> >
> > http://www.stata.com/support/faqs/data/newexcel.html
> >
> > http://www.stata.com/support/faqs/res/statalist.html#spell
> >
> > Nick
> > [email protected]
> >
> > [email protected]
> >
> > > I keep trying to import data (csv file) that are all numbers,
> > > but STATA reads
> > > some of them as string. How do I get STATA to read it properly?
> >
> > *
> > * 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/
>
*
* 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/