Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: strgroup
Nick Cox <email@example.com>
RE: st: strgroup
Mon, 21 Feb 2011 21:13:24 +0000
Joking apart, it remains a factual point that many Stata users do not use Excel -- and may not even use machines on which Excel is installed and/or available.
At some point we all tend to use what we find familiar, naturally. But what horrifies me about Excel includes the apparent lack of an audit trail facility. The point of this thread is to make lots of irreversible changes to a dataset!
I always admire people who can figure out programs to solve such messes. But sometimes that there are typos and stuff that are just difficulty to find a way to generalize. I get most raw data in Excel anyway. Sometimes I get files where data is labeled in Excel. It's just natural for me to use Excel to generate codes to quickly update labels in Stata or deal with situations like this one. Use Excel to write code is a fairly easy trick to learn.
From: firstname.lastname@example.org [mailto:email@example.com] On Behalf Of Nick Cox
Sent: Monday, February 21, 2011 2:39 PM
Subject: RE: st: strgroup
This answer presupposes that the original poster has a liking for using, MS Excel, which seems unnecessarily pessimistic. My suggestion is that instead of testing for equality you use -strpos()- and/or -subinstr()-.
I had the same experiences before. One thing to look for is spaces trailing at beginning or end of string. For this kind of situation, I would use Excel to run a pivot table to find out all necessary changes and use Excel to generate the codes. Then paste the codes to a do file. Everything get fixed instantly.
* For searches and help try: