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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.