|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Data management problem
Dear Statalisters:
I have two data sets containing dates of participation in two related programs, program 1
and program 2. But the complication is that the program 1 data set lists dates if the
participant is enrolled in *either* program 1 or program 2. Dates in the program 2 data
set indicate definite participation in program 2.
The best explanation is an example. Here is program participation dates from the program
1 data set. (Date variables have display format %dD_m_Y and I added the program variable
to make this explanation clearer):
beg1 end1 program
01 Jul 02 30 Nov 02 1
01 Jul 03 30 Jun 05 1
And the same individual for the program 2 data set:
beg2 end2 program
01 Jul 02 30 Nov 02 2
01 Oct 03 31 Dec 04 2
01 May 05 31 May 05 2
I want to combine these records to obtain a data set that looks like:
beg end program
01 Jul 02 30 Nov 02 2
01 Dec 02 30 Jun 03 0
01 Jul 03 30 Sep 03 1
01 Oct 03 31 Dec 04 2
01 Jan 05 30 Apr 05 1
01 May 05 31 May 05 2
01 Jun 05 30 Jun 05 1
(where the 0 indicates the individual did not participate in either program during that
period).
There are, of course, many individuals with varying dates of participation in one or both
programs. Any suggestions as to how one might solve this problem?
Dave Harless
*
* 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/