Solved

SAS - Finding the mean and standard deviation in SAS

Posted on 2014-09-23
2
319 Views
Last Modified: 2016-02-13
Experts,

I have 14,00 records which I have calc;ulated a percentage.  How canI calculate the mean percentage of these records and then the standard deviation.  I am not sure if this is correct.  If possible I would like to  select all of those where the standard deviation is greater than 2 times the standard deviation.

I would like to do this in SAS.   Any ideas!!
0
Comment
Question by:morinia
  • 2
2 Comments
 
LVL 11

Assisted Solution

by:theartfuldazzler
theartfuldazzler earned 500 total points
ID: 40339335
Hi

Assuming your database is called "dsname" and the percentage variable name is "perc1" then

proc sql;
  create table test2 as
    select * from dsname
	having Perc1 >= mean(Perc1)+2*std(Perc1);

Open in new window

0
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 500 total points
ID: 40339349
To calculate the mean and std dev use:

proc sql;
  create table test2 as
    select mean(perc1) as MeanPerc, std(Perc1) as StdDevPerc from dsname
;

Open in new window

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question