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. 


 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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