Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Programming help


From   Sergio Prada <[email protected]>
To   [email protected]
Subject   st: Programming help
Date   Wed, 5 Jan 2011 16:47:05 -0500

Hi, I am seeking help with some basic programming.
I am using Stata 10.1 for Windows.
I have claims data (unique identifier of claim is cid) for different
patients (unique identifier for patient is pid) and service start and
thru dates.
My data looks like

pid  cid        from_dt    thru_dt
D1  1   08 Nov 08          13 Nov 08
D1  2   13 Nov 08          31 Dec 08
D1  3   05 Dec 08          06 Dec 08
D1  4   07 Dec 08          13 Dec 08
D1  5   14 Dec 08          20 Dec 08
D1  6   21 Dec 08          27 Dec 08
D1  7   28 Dec 08          31 Dec 08
D2  1   14 Dec 08          31 Dec 08
D2  2   21 Dec 08          27 Dec 08
D2  3   31 Dec 08          31 Dec 08

for each pid (e.g. D1) I need to flag cases in which a claim period is
within other claim period. For instance, for patient D1 cid 3 is
within the time period of cid 2, as are cids 4, 5, 6 and 7.  And for
Patient D2, cids 2 and 3 are within the time period covered by cid1.

So at the end I'd like to have a flag variable

pid  cid        from_dt    thru_dt         flag
D1  1   08 Nov 08          13 Nov 08      0
D1  2   14 Nov 08          31 Dec 08     0
D1  3   05 Dec 08          06 Dec 08     1
D1  4   07 Dec 08          13 Dec 08     1
D1  5   14 Dec 08          20 Dec 08     1
D1  6   21 Dec 08          27 Dec 08     1
D1  7   28 Dec 08          31 Dec 08     1
D2  1   14 Dec 08          31 Dec 08     0
D2  2   14 Dec 08          27 Dec 08     1
D2  3   31 Dec 08          31 Dec 08     1

Thanks,

Sergio

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index