Code:
* Example generated by -dataex-. For more info, type help dataex clear input float colorectal str3 hospitalid float MI str3 expected_mi float(date2 date4each MI2) str1 expected float max 0 "12A" 0 "no" 22252 . 0 "" . 112 "12A" 1 "yes" 22253 22253 1 "1" . 0 "13A" 0 "no" 22678 22646 0 "" . 0 "13A" 1 "no" 22665 22619 0 "" . 113 "13A" 0 "no" 22619 22619 0 "0" 0 114 "13A" 0 "no" 22646 22646 0 "0" 0 0 "14A" 1 "yes" 22720 22705 1 "" . 115 "14A" 0 "no" 22734 22734 0 "0" 0 116 "14A" 0 "no" 22705 22705 0 "1" 0 end format %td date2 format %td date4each
I’m trying to create a new dataset where if the patient had a MI within 45 days this will be stored as 1 ON THE SAME LINE THE PATIENT HAD A COLORECTAL PROCEDURE.
COLORECTAL = PT HAD A COLORECTALSURGERY
HOSPITALID = ANY TIME PT ADMITTED TO HOSPITAL AND DATE2 WHEN PATIENT ADMITTED
I can’t seem to do it. I hope to creating something that looks like the 'expected' column...
Comment