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

Re: st: -nsplit- is a new command on SSC


From   [email protected]
To   [email protected]
Subject   Re: st: -nsplit- is a new command on SSC
Date   Mon, 6 Dec 2004 13:11:21 EST

I downloaded your new program and  tried it out on some dates that were 
formatted as: modayyr; e.g. 12302004.   The worked perfectly. Thanks - a very 
useful program. 

Joe  Hilbe

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