|
Jacqueline didn't copy this to the
list.
----- Original Message -----
From: [hidden email]
To: [hidden email]
Cc: [hidden email]
Sent: Monday, February 15, 2010 1:49 PM
Subject: FW: Transform Visit dates for each patients into visit days
for each patients Dear
Hans-Christian, Please
try the syntax below. It should work I have tried it on some dummy
data. Please
excuse my long comments, but I find they help. All
the best. Jacqueline ----------------------------------------- COMMENT
warning - this syntax will only give you the correct data if you sort the data
correctly. COMMENT the
data is sorted by the patients id first and then by their dates of
attendance. SORT CASES
BY PID(A) VIS_DATE(A). COMMENT this
syntax identifies the first occurrence of any patient id number and puts a value
of one for that first attendance. IF
((PID ~= LAG(PID,1))|($CASENUM=1)) FIRST=1. EXECUTE. COMMENT this
puts the date of first visit alongside the first visit indicator
. IF
(FIRST =1) FIRST_date=VIS_DATE. FORMATS
FIRST_date (EDATE). EXECUTE. COMMENT this
bit is still absolutely reliant on the prior sorting . COMMENT This
then looks for repetition of the patient id number and for each row that repeats
the patient id it will repeat that row's dtate of first visit
. IF
(PID =LAG(PID,1)) FIRST_date=LAG(FIRST_date,1). IF
(PID =LAG(PID,2)) FIRST_date=LAG(FIRST_date,2). IF
(PID =LAG(PID,3)) FIRST_date=LAG(FIRST_date,3). IF
(PID =LAG(PID,4)) FIRST_date=LAG(FIRST_date,4). EXECUTE. COMMENT this
calculates the number of days between the date of the visit and the date
allocated for that patient first visit. COMPUTE
VIS_DAY=DATEDIFF(VIS_DATE,FIRST_date,"DAYS"). EXECUTE. Professor
Jacqueline Collier From: John F
Hall [mailto:[hidden email]] Jacquie Can you help this guy
at all? John ----- Original
Message ----- From: [hidden email]
To: [hidden email]
Sent: Monday, February 15,
2010 12:03 PM Subject: Transform Visit
dates for each patients into visit days for each
patients
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. |
| Free forum by Nabble | Edit this page |
