I was hoping someone can help me with a problem. I have a list of ~20,000 patients who come from ~300 different hospitals. I want to flag hospitals that have certain characteristics for these patients, such as less than 20% mortality and a mean length of stay less than 5 days.
I was trying to do something as below:
proc freq data=v_gb noprint; tables died * hospid / out=m_gb; run;
proc means data=v_gb noprint; by hospid; var los; output out=los_gb; run;
data lv_gb ;
merge v_gb (in=t) m_gb los_gb;
by hospid;
run;
However, I am not getting the results that I want, i.e. mean los and percent died per hospid.