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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.