Dear Statusers,
I'm trying to generate a new dataset and I would sincerely appreciate
suggestions or how to approach the problem.
I have records on individuals start and end date on a program participation
on a long format (table 1) and I'm trying to reshape it to a wide format in
order to generate a table similar to TABLE 2. Table 2 takes the value of one
for the monthly intervals encompassed between the start and end date
available on tabe 1 and zero for the remaining periods.
TABLE 1
serial bclmstdt bclmeddt
2 May 99 Jul 99
20 Jul 99 Nov 99
23 Aug 99 Feb 00
26 Oct 99 Dec 99
30 May 99 Jun 99
30 Dec 99 Feb 00
TABLE 2
Serial May-99 Jun-99 Jul-99 Aug-99 Sep-99 Oct-99 Nov-99 Dec-99
Jan-00 Feb-00
2 1 1 1 0 0 0 0 0 0
20 1 1 1 1 1 1 0 0 0
23 0 0 1 1 1 1 1 1 1
26 0 0 0 0 1 1 1 0 0
30 1 1 0 0 0 0 1 1 1
I would sincerely appreciate if you could help me on this.
Many thanks,
Joao Pedro
*
* 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/