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

Re: st: Re: multiple )))brackets, is there a more efficient way?


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: Re: multiple )))brackets, is there a more efficient way?
Date   Tue, 25 May 2004 12:19:41 -0400

Now that you mention it, I vote for Michael Blasnik's suggestion:


sort nation
merge nation using nationcodes
This is the better way to do this, especially if the set of nations is large. It embodies the notion that the mapping of nation to origin is an entity in its own rite; it is data, not code. This is more maintainable. Further, if you need to do it in several places, you need only repeat the -merge- operation, rather than a long segment of code. (That long segment of code could be made into a program, but I would still prefer the -merge- method, on principle.)

P.S., I would put -,nokeep- on that -merge- -- in case nationcodes has more nations the in-memory data.

-- David

David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

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