Please help me with a PROC SUMMARY (only) statement to get the volume by category, weighted volume by category, mean of score by category.
Reason I want to use PROC SUMMARY is because I have other code using the same and PROC SUMMARY produces other metrics.
data test;
length category score wt 8;
input category score wt;
infile datalines dlm=",";
datalines;
1,67,2
1,50,5
1,55,6
2,56,6
2,68,5
3,70,5
4,73,8
run;
A couple of questions:
Can the admin please move this post to the Statistical group
proc summary data=have;
class category;
var wt score;
output out=stats mean(score)=score_mean sum(wt)=wt_volume;
run;
The variable _FREQ_ is the unweighted volume.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.