Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Data within a time period

2 views
Skip to first unread message

Charles

unread,
Feb 7, 2010, 12:22:46 PM2/7/10
to
I am working with a large healthcare data set and was trying to
calculate the variation between POC blood glucose values and serum
blood glucose values and how it’s affected by Hct. For each of the
tests I have a patient ID #, test date/time and value. However I have
1000 patients, 20,000 Hct values, and 50,000 serum blood glucose
values and 90,000 POC blood glucose values. What I am trying to do is
find all instances in which all 3 fall within the same 30min time
period. But I am not sure how to even begin.

Thanks,
Charles

Rich Ulrich

unread,
Feb 7, 2010, 3:52:17 PM2/7/10
to


Eventually, you may come to questions of whether there are
two or more tests of one kind within a narrow time from - Do
two tests match the same XX test, before and after?

But for starters, you could use LAG to create a file that
has all three tests in each record.

Start with a sorted file, by ID and date/time.
On a "new ID", create LastHTC, LastSER, LastPOC.
Set one of them to its current-record value and the other
two to Missing, along with the Times.

On each latter record for the same ID, pick up LastXX
and its time.

Then shorten the file dramatically by dropping every
record that does not have 3 times. And drop every
record where the times are not within 30 minutes (3 tests).

Then there may be a problem of partial duplicates -- I would
consider it necessary to know about it, whether it is considered
a problem or not.
If tests are not taken around midnight (to be checked), it
would be safe to look for whether aggregation ever finds
two records with the same ID and Date (Day only).

What to do in cases of duplication depends on how often it
happens and what the designn protocol said (or what someone
decides it needs to say now).


--
Rich Ulrich

Charles

unread,
Feb 8, 2010, 10:02:43 PM2/8/10
to

Rich

Thanks for the suggestion, i'll start with the LAG and go from there.

Thanks,
Charles

0 new messages