Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Data management problem


From   "David W. Harless" <dwharles@vcu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Data management problem
Date   Tue, 06 May 2008 15:36:19 -0400

n j cox wrote:
No suggestions from me, just a question.

How you do know that the examples refer to the same individual?
Are there identifier variable(s) too?

Nick
n.j.cox@durham.ac.uk
Oh yes, there is an id variable to identify individuals between the two data sets. I guess I should have included that in the message, but I was trying to make the example as simple as possible.

Dave Harless



David W. Harless

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?

*
* 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/
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index