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

st: RE: Re: -charlist- available on SSC


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: -charlist- available on SSC
Date   Tue, 17 Dec 2002 19:16:24 -0000

Kit will no doubt fix this when he can. 

Nick 
[email protected] 

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Don Spady
> Sent: 17 December 2002 19:16
> To: [email protected]
> Subject: st: Re: -charlist- available on SSC 
> 
> 
> Hi
> 
>  I just tried to download (ssc install charlist) charlist 
> and got this
> message:
> ssc install: apparent error in package file for charlist; 
> please notify
> [email protected],
> providing package name
> 
> What is the problem
> 
> Don Spady
> 
> ----- Original Message -----
> From: "Nick Cox" <[email protected]>
> To: <[email protected]>
> Sent: Tuesday, December 17, 2002 12:07
> Subject: st: -charlist- available on SSC
> 
> 
> > Thanks to Kit Baum, the -charlist- program
> > posted and discussed earlier today is now
> > available from SSC. The output and syntax are changed
> > from my original posting.
> >
> > In an up-to-date Stata, type
> >
> > . ssc desc charlist
> >
> > and if desired
> >
> > . ssc inst charlist
> >
> > For explanation of the -ssc- command,
> > please see the first URL under my signature.
> >
> > Briefly, -charlist- shows which characters
> > are present in a string variable.
> >
> > Here is a concocted example of one way
> > in which it might be useful.
> >
> > Stata tells you that something which should be numeric
> > is string, and -destring- won't play:
> >
> > . destring mystuff, replace
> > mystuff contains non-numeric characters; no replace
> >
> > So you ask for a report:
> >
> > . charlist mystuff
> > 123I
> >
> > We see that "I" characters are present.
> > Perhaps whoever typed in the data was
> > distracted, or the OCR software made a mistake,
> > so some "1" (one) characters have been entered
> > as "I" (capital I).
> >
> > . l mystuff  if index(mystuff,"I")
> >
> >        mystuff
> >  12.       I23
> >  57.       I23
> >  73.       I23
> >
> > You decide on appropriate surgery:
> >
> > . replace mystuff = subinstr(mystuff,"I", "1",.)
> > (3 real changes made)
> >
> > . destring mystuff, replace
> > mystuff has all characters numeric; replaced as byte
> >
> > Of course, there are other ways to do
> > this -- and also other examples in which
> > -charlist- may be useful.
> >
> > Nick
> > [email protected]
> > *
> > *   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index