BookmarkSubscribeRSS Feed
BrandonBayles
Fluorite | Level 6
Hello new to SAS. Using one PROC MEAN step I'm trying to do the following two things.... calculate the total score and percent for each
student using the code seen below and calculate the student's score and percentage for each of the five domain categories. But the output is not quite what it needs to be. Every time I run the code I get a data set the excludes the means as seen in the first picture. Any help would be great. Thanks. AAAA.PNG111111111111111.PNG
PROC MEANS DATA = COMBINED MEAN SUM NONOBS;
     VAR Scores ;
     CLASS Student DomainNum;
     ID Form ;
     OUTPUT OUT=COMBINED_TABLE (DROP= _TYPE_ _FREQ_) SUM=score MEAN = score;
RUN;
5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

Rename your mean variable in your Output Statement. Right now, you try to name two variables to 'score', so only the first one catches on.

BrandonBayles
Fluorite | Level 6

That helped but my table is still not quite there. Here is what it now looks like.....1111111111.PNG

PeterClemmensen
Tourmaline | Level 20

And what is wrong with this? Please be more specific 🙂

BrandonBayles
Fluorite | Level 6

Sorry, I misspoke. This worked thank you. 

Astounding
PROC Star
At least one step closer: add NWAY to the end of the first statement:

PROC MEANS ... NONOBS NWAY;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1543 views
  • 1 like
  • 3 in conversation