I would like to take MEAN and Standard Deviation by Arms for Var1 through Var6
Here is the dataset
| ID | Var1 | Var2 | Var3 | Var4 | Var5 | Var6 | Arm |
| 1 | 5 | 6 | 1 | 9 | 9 | A | |
| 2 | 6 | 1 | 11 | 56 | 12 | B | |
| 3 | 9 | 12 | 22 | A | |||
| 4 | 3 | 6 | 6 | 10 | A | ||
| 5 | 6 | 6 | 3 | 5 | A | ||
| 6 | 15 | 4 | 7 | 6 | 9 | A | |
| 7 | 1 | 4 | B |
PROC MEANS DATA = test NOPRINT COMPLETETYPES;
FORMAT Arm Arm.;
CLASS Arm/PRELOADFMT;
VAR Var1 Var2 Var3 Var4 Var5 Var6;
OUTPUT OUT = test2(keep = Arm N MEAN STD)
N = N MEAN = MEAN STD = STD;
RUN;
It doesn't pick up all Vars. Just the first one
perhaps this fixes it ... if not, explain further
PROC MEANS DATA = test NOPRINT COMPLETETYPES;
FORMAT Arm Arm.;
CLASS Arm/PRELOADFMT;
VAR Var1 Var2 Var3 Var4 Var5 Var6;
OUTPUT OUT = test2 N= MEAN= STD= /autoname;
RUN;
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 save with the early bird rate—just $795!
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.