BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Job04
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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;
--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

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;
--
Paige Miller
Job04
Quartz | Level 8

My data has 200 variables. I need that on all of them. 

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Reeza
Super User
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. 


 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1406 views
  • 1 like
  • 3 in conversation