Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Reshape command with dates


From   "Hugh Colaco" <[email protected]>
To   statalist <[email protected]>
Subject   st: Reshape command with dates
Date   Thu, 30 Oct 2008 07:29:13 -0400

Hi,

I have a string variable (Id) with about 500 observations. I want to
create a date sequence for each Id ranging from July 1, 2002 to Dec
31, 2006 as below:-


Id       Dates

A43   20020701
"        20020702
"        20020703

"           "
"           "

A43     20061231
D98     20020701
"         20020702
"         20020703

"              "
"              "


D98    20061231


I want the 498 other Id to be in the same format.

I suppose the best way to do this is to create a new variable for each
date and then use -reshape long- to get it in the above format. Am I
right? My ultimate goal is to merge another file into this one based
on Id and dates.


Thanks,

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