BookmarkSubscribeRSS Feed
NPConcorida
Calcite | Level 5

How do I present in a table the mean and standard deviation of 34 variables X1-X34 ordered
from the highest to the lowest value of the mean?

1 REPLY 1
Reeza
Super User

https://gist.github.com/statgeek/d4c36ea88523d49e135a7aa494c29846

 

In this example, I sort by N, but hopefully you can see how to extend it to MEAN instead.

 

*generate fake data;
data have;
    array a(17);

    do i=1 to 100;

        do j=1 to 17;
            a(j)=rand('bernoulli', 0.27);

            if rand('bernoulli', 0.1)=1 then
                call missing(a(j));
        end;
        output;
    end;
run;

*Summary statistics;
proc means data=have stackods n sum mean maxdec=1;
    var a1-a17;
    ods output summary=want;
run;

*sort by N, descending count, and print;
proc sort data=want;
    by descending n;
run;

proc print data=want label noobs;
    label variable='Defect Categories';
run;

@NPConcorida wrote:

How do I present in a table the mean and standard deviation of 34 variables X1-X34 ordered
from the highest to the lowest value of the mean?


 

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!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 461 views
  • 0 likes
  • 2 in conversation