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

st: -nsplit- is a new command on SSC


From   Dan Blanchette <[email protected]>
To   [email protected]
Subject   st: -nsplit- is a new command on SSC
Date   Mon, 6 Dec 2004 10:03:30 -0500 (EST)

The maintainer of the SSC archive Kit Baum has made available
my program -nsplit-.

-nsplit- generates new numeric variables based on the supplied
digit pattern of a larger numeric variable.  So if you had the
numeric variable MonthYear:

.list MonthYear

MonthYear
122004
 51996
 32002

. nsplit MonthYear, digits(2 4) generate(month year)

.list MonthYear month year

MonthYear month year
122004     12   2004
 51996      5   1996
 32002      3   1994

-nsplit- can also be used to split up complex id variables or whatever integer
value numeric variable you may have.

I would also like to acknowledge Nick Cox for helping out with the code.

It's not much of a "stocking stuffer" but it is free:

. ssc install nsplit

Best,


Dan Blanchette
Applications Analyst Programmer
Carolina Population Center UNC-CH
[email protected]



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