Hello,
I want to create a dummy variable for the patient data.
Patients 10002, 10003, 10004 were dead, and
Patients 10005, 10006, 10007 have survived so far.
-----------------------------------------------
Patient_ID Death_Date
10002 2013-06-04
10003 2011-08-15
10004 2012-12-14
10005
10006
10007
---------------------------------------------
Depending on if Death_Date is present or not, I want to make a new variable DEATH (1= Death, 0=Surived)
so I tried the following:
data w.patient;
set w.patient;
Death=.;
if (Death_Date=".") then Death = 1
if (Death_Date=" ") then Death = 0
run;
However, it is marking all the death
What have I done wrong?
Any advice or help would be appreciated.
Thank you.
P.S Ultimately, I want to make my data set as the following:
-----------------------------------------------
Patient_ID Death_Date Death
10002 2013-06-04 1
10003 2011-08-15 1
10004 2012-12-14 1
10005 0
10006 0
10007 0
---------------------------------------------
... View more