Hi - I hope all is well & thank you in advance for your guidance! Looking at Transfer Delays, we are using time variables. Sharing just 2 pieces of code that I thought were relevant. data name2; set name1 ; IF MISSING(ED_HOSPITAL_ARRIVAL_TIME ) OR MISSING(ED_DISCHARGE_TIME)THEN RIGHT_HOURS = .M; ELSE IF ED_HOSPITAL_ARRIVAL_TIME = ED_DISCHARGE_TIME THEN RIGHT_HOURS = 0; ELSE RIGHT_HOURS= mod(24+(ED_DISCHARGE_TIME-ED_HOSPITAL_ARRIVAL_TIME)/3600,24); LABEL RIGHT_HOURS = "Hours (custom): Minutes Elapsed from ED_HOSPITAL_ARRIVAL_TIME to ED_DISCHARGE_TIME"; Run; Note that Right_hours is numeric and in a frequency it looks like this: RIGHT_HOURS Frequency M 2 1.1 1 1.5333333333 1 1.6666666667 1 1.7333333333 1 2.8166666667 1 2.9333333333 1 ) Data name3; set name2 ; Length New_time $10.; if RIGHT_HOURS = .M or RIGHT_HOURS = ' ' then New_Time = 'Missing'; if '0.0000'<=RIGHT_HOURS <'2.0000' then New_Time = 'LT2' ; if '2.0000'<=RIGHT_HOURS then New_Time = '> 2+'; Run; (Note: LT2 (less than 2 hours) > 2 + is greater than 2 hours. ) I need assistance with the next step, which is to calculate median delay by age. I know how to calculate the median, but I am stuck because if I use the New_Time variable, it will not work since it’s character. How should I approach this analysis from your point of view. Please let me know if I need to provide additional information. Thank you! Linda
... View more