Numbering multiple tests at different time on the same day

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

DB123
Posts: 1
Joined: Thu Mar 21, 2013 7:35 pm

Numbering multiple tests at different time on the same day

Postby DB123 » Thu Mar 21, 2013 7:42 pm

Hi everyone,

I have a data set that has the following:
Unique patient #
Patient Last Name
Patient Test Date
Patient Test Time
Testvalue1
Testvalue2
Etc

Some patents have the same test date but different time. For example, they may have taken a test, then received a medication, then retook the test to see if the medication helped).

I need to create a variable, "Test Order" that lists the first (or only) test for each patient on a given day as 1, and the second as 2, etc.

I want to be able to analyze the baseline or first test data separately from the post-medication test data.

Does anyone know how to do this? I have pasted sample data below along with the desired result.

Thank you!


Id Lastname Date Time DESIRED
RESULT
12345 SMITH 2/1/2007 8:17 AM 1
12345 SMITH 2/12/2007 7:31 AM 1
12345 SMITH 2/13/2007 3:29 AM 1
12345 SMITH 3/14/2007 7:42 AM 1
12345 SMITH 4/9/2007 7:48 AM 1
12345 SMITH 4/11/2007 7:49 AM 1
12345 SMITH 10/10/2007 3:01 AM 1
12345 SMITH 10/10/2007 4:43 AM 2
12345 SMITH 10/10/2007 7:40 AM 3
12345 SMITH 10/10/2007 8:16 AM 4

Who is online

Users browsing this forum: No registered users and 4 guests

cron