Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: implementing a pattern to match numbers with ranges


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: implementing a pattern to match numbers with ranges
Date   Sat, 13 Sep 2008 16:59:37 +0100 (BST)

--- - <mc_allister@gmx.de> wrote:
> I have many numbers with 4 digits, like 0100, 2044,... (this variable
> is called "SIC"). Now I want to match this number to a two-digit
> number (this new variable is called "Industry").
> 
> The matching should be like this:
> 
>         0100-0799,2048-2048=03
>         2000-2046,2050-2063,2070-2079,2090-2095,2098-2099=23
>         2064-2068,2086-2087,2096-2097=47
>         2080-2085='08'

I don't see a regular pattern you can exploit, so you'll probably have
to do a -recode-, see: -help recode-

-- Maarten



-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index