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]
Re: st: Programming help
From
Sergiy Radyakin <[email protected]>
To
[email protected]
Subject
Re: st: Programming help
Date
Wed, 5 Jan 2011 17:37:35 -0500
Sergio,
1) what do you want your flag to be if there is a partial overlap?
E.g. claim1 starts 10dec and lasts till 20dec, claim 2 starts 15 dec
and lasts till 25dec.
2) is cid assigned chronologically? can there be duplicates (two
claims with the same date).
3) if periods coincide how do you want to resolve the flag? (c1:
10th-20th and c2: 10th-20th,
should the flag for c1 be 1 or for c2 be 1?)
4) in the example you illustrate the claims form chains, so that one
claim starts next day
after another ends. is that a specific pattern you are looking for?
Best, Sergiy Radyakin
On Wed, Jan 5, 2011 at 4:47 PM, Sergio Prada <[email protected]> wrote:
> 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/
>
*
* 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/