And I always thought it was called a carrot because it was shaped like the vegetable . . .
Thanks for the correction, Nick.
Howie
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Monday, January 05, 2009 3:09 PM
To: statalist@hsphsun2.harvard.edu
Subject: RE: st: data management - string function
Howard's typo here may confuse a few. On carrots, carets, carats, etc.
see e.g.
<http://www.wsu.edu/~brians/errors/carat.html>
While I'm at it, let's recall the physicist R.W. Wood (fl.1900)
The Parrot and the Carrot
The Parrot and the Carrot we may easily confound,
They're very much alike in looks and similar in sound,
We recognize the Parrot by his clear articulation,
For Carrots are unable to engage in conversation.
The cartoon that goes with this poem is worth hunting down.
Nick
n.j.cox@durham.ac.uk
Howard Lempel
BW, carrot (^) tells Stata you are searching for characters at the
beginning of a string only, so you probably want something to the effect
of:
Gen var2 = regexr(var1,^("MR" | "MR." | "Mr" | . . .),)
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/