My data has dimension of 80x200
patients in rows and variables in column.
I want to calculate the %RSD of each variable.
%RSD= (standard deviation of each variable / mean of variable)*100
The data looks like this:
ID,gender,AL,BK,MS,DF
2,F,13.4,7.3,-15.2,9.2
3,M,12.1,5.1,17.2,8.85
5,M,10.8,2.9,49.6,8.5
7,F,9.5,0.7,82,8.15
Thank you
This is essentially what SAS calls the CV (coefficient of variation) except it is not multiplied by 100.
proc summary data=have;
var al bk ms df;
output out=cv cv=/autoname;
run;
This is essentially what SAS calls the CV (coefficient of variation) except it is not multiplied by 100.
proc summary data=have;
var al bk ms df;
output out=cv cv=/autoname;
run;
My data has 200 variables. I need that on all of them.
Use a list of consecutive variables names, such as
al--bk
where al is the first variable name and bk is the last variable name; the double dash indicates that the variables in the list are consecutive.
proc summary data=have;
var _numeric_;
output out=cv cv=/autoname;
run;
Using _numeric_ will run it on all numeric variables.
@Job04 wrote:
My data has 200 variables. I need that on all of them.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.