Bookmark and Share

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


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: strgroup
Date   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! 

Nick 
[email protected] 

Liao, Junlin

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.

Junlin


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: Monday, February 21, 2011 2:39 PM
To: '[email protected]'
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()-.

Nick
[email protected]

Liao, Junlin

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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index