11-07-2017 08:23 PM - edited 11-07-2017 08:51 PM
Im pulling this table in SAS EG and this is the code im using
IF RCOC_GRP = 'NEW' THEN;
TRIGGER = 1;
NUMERATOR = COUNTER;
DENOMINATOR = 1;
METRIC = 'NEW Apts ';
IF RCOC_GRP NE 'NEW' THEN DELETE;
KEEP RESID MTH_YR I FAC CLINIC HOME_DEPT TRIGGER NUMERATOR DENOMINATOR METRIC;
where resid= '2972926';
However I want to the sum the NUMERATOR for the same Mth-yr and Clinic but do not want to sum the DENOMINATOR
Example line 26 and 27 have the same Mth_yr, clinic and etc but the FAC are different i want the sum of 26 and 27 to be 174 and denominator to be just 1
Is that something i can do?
11-07-2017 08:26 PM
Why not use one of the summary tasks?
Otherwise, PROC MEANS and SUMMARY are also options to summarize your data:
*Create summary statistics for a dataset by a 'grouping' variable and store it in a dataset; *Generate sample fake data; data have; input ID feature1 feature2 feature3; cards; 1 7.72 5.43 4.35 1 5.54 2.25 8.22 1 4.43 6.75 2.22 1 3.22 3.21 7.31 2 6.72 2.86 6.11 2 5.89 4.25 5.25 2 3.43 7.30 8.21 2 1.22 3.55 6.55 ; run; *Create summary data; proc means data=have noprint; by id; var feature1-feature3; output out=want median= var= mean= /autoname; run; *Show for display; proc print data=want; run;
If you need more specific help, please post data as a data step, I'm not typing data from a picture.
Nothing in your code shows you calculating a SUM either...