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

st: Case conversion in stringvars (and 2 cmds with same name)


From   "Friederich,SJ" <S.J.Friederich@lse.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Case conversion in stringvars (and 2 cmds with same name)
Date   Tue, 17 Sep 2002 20:23:44 +0100

Dear all,
 
I have corporate announcements data where records of a string var are inconsistently capitalised, which makes analysis difficult. To illustrate, the following records should really appear as one and the same:

Annual Report and Accounts 
Annual Reports and Accounts 
Annual report and accounts 
Annual reports and Accounts
Annual reports and accounts 

I can globally replace 'reports' by 'report' in a text editor but would like to automate case conversion in Stata if I could - say, convert everything to lower case (or just the first word capitalised, or every word in the header). -renvars- does this but for variable names, not observations. -mixcase-, on the other hand, seems just the job, but it was written by Bill Gould nearly ten years ago (it was part of dm13.1) so I doubt it would run smoothly three or four versions of Stata later. Is anyone aware of an update to this routine or an alternative way of doing the same?
 
As part of my search for this, I think I came across two ado files that do something quite similar and bear the same name but are clearly distinct in their syntax (ie the later one doesn't look like an update of the earlier one). The first instance of -replstr- was written by Bill G (dm 13.1 again) while the second (dated 1999) is authored by Wim Van Putten (-findit replstr- brings this up).
 
Many thanks,
 
Sylvain
 
 
 

	 

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