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!
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.
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.
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.
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 16. Read more here about why you should contribute and what is in it for you!
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.