1

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.

flag

1 Answer

3

Assuming the 'died' variable is 1 for dead, 0 for alive...

Use a PROC SUMMARY...

proc summary data=v_gb nway ;
  class hospid ;
  var died los ;
  output out=v_gb_sum (where=(died <= 0.2 and los <= 5)) mean= ;
run ;
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.