?
Solved

SAS - Finding the mean and standard deviation in SAS

Posted on 2014-09-23
2
Medium Priority
?
362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 11

Assisted Solution

by:theartfuldazzler
theartfuldazzler earned 2000 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 2000 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

771 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