BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mtgkooks
Fluorite | Level 6

Hi everyone!

I'm starting with a dataset like this:

 

  Question         Name          Unit          Score

  ------------         --------          -----           -------

  111                  John            1               2.5

  112                  John            1               3

  113                  John            1               2

  111                  Sarah           2              2.5

  112                  Sarah          2              3.5

  113                  Sarah          2              1

  111                  Jennifer       1              1.5

  112                  Jennifer       1              4

  113                  Jennifer       1              3.5

 

And I'm hoping, using iterative data step code, to generate a table that looks like this:

 

  Question          Mean_Score          Median_Score          Min_Score          Max_Score          SEM_Score          Conf95_Score          Std_Dev_Score

  ------------          -----------------          -------------------          --------------           ---------------          ----------------           ------------------           ---------------------

  111                   2.16667                 2.5                            1.5                       2.5                       0.2722                   0.533                        0.4714

  112                   3.5                         3.5                            3                          4                          0.2357                   0.462                        0.4082

  113                   2.16667                 2                               1                          3.5                       0.5932                   1.163                        1.0274

 

Any assistance you can provide would be greatly appreciated!

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
AMSAS
SAS Super FREQ

Here's the link to PROC MEANS
Go take a look at that, and the examples, and you can probably get the results you are looking for.

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

What is iterative about that?

 

If you want to calculate statistics use PROC MEANS.

Looks like you want to use QUESTION as a BY or CLASS variable.

AMSAS
SAS Super FREQ

Here's the link to PROC MEANS
Go take a look at that, and the examples, and you can probably get the results you are looking for.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 1093 views
  • 1 like
  • 3 in conversation