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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 546 views
  • 1 like
  • 3 in conversation