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

st: matching a long list of codes


From   baum <[email protected]>
To   [email protected]
Subject   st: matching a long list of codes
Date   Wed, 03 Jul 2002 09:11:22 -0400

The better way to handle this sort of thing is to put the codes you list in a dataset by themselves , and then merge that dataset onto the one from which you want to select the codes. Then where the merge finds the code in both the main dataset and the code dataset (_merge==3) your dani can be set to one (e.g.
gen dani = (_merge==3) will do it). There was a recent thread on this method, pointing to a FAQ on the Stata web site re group characteristics.

Kit Baum

--On Friday, June 28, 2002 2:33 -0400 statalist-digest <[email protected]> wrote:


Subject: st: using eqany

Hi,

I am using -eqany- command to select the cases where an 'id' variable is
equal to a group of numbers:

# delimit ;
egen dani=eqany(cod_mod), v(209940 210328     233098    233288    236117
236190    236448    238642    238675     238717    238758    240333
262196    262956    262964    275446     275453    275529    275735
275792    275800    286468    305607     305771    309302    309898
325548    327387    329565    340323     355974    356071    356089
372524    372565    372714    373266     394254    395434    411736
421339    421396    427427    427864     437343    437368    437376
452581    452623    452656    452805     452920    452938    467142
469700    478065    502054    504993     508267    515668    520064
521013    536219    536714    547927     554105    565176    567750
570648    576371    576439    579110     579151    579573    579771
580811    581744    583591    587626     594697    594895    600692
615906    621037    643841    647057     649673    668897    680785
685016    692442    694570    732321     753616    764969    777656
779041    781336    785097    811091     876524    900704    909549
919308    920025    926758    1023977    1102078   1127638   1136951
1147776   1172782);


The command gives me the following error: "varlist not allowed r(101)".
When I reduce the numlist it is performed with no problem. Does this
happens because the numlist is to large??, Is there any way to set a
larger numlist or any other alternative??

I hope someone can help me with this very basic question =)
Many thanks,

Daniel

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