# SAS Standard Deviation – Ways of Measure Standard Deviation

Job-ready Online Courses: Click, Learn, Succeed, Start Now!

In our previous article, we discuss SAS Cross Tabulation and SAS Frequency Distribution. Now we will be looking at another statistical procedure today, that is SAS Standard Deviation. We will discuss two types of procedure in which we can apply standard deviation to our data.

Moreover, we will see different ways to measure SASÂ Standard Deviation; SAS PROC MEANS & SASÂ PROC SURVEYMEANS.

## SAS Standard Deviation

SAS Standard deviation (SD) is a measure of how varied is the data in aÂ given dataset. Mathematically, it tells youÂ the closeness of each data point with the mean of the dataset.

If the value of standard deviation is close to 0, it indicates that the data points are very close to the mean of the data set and a high standard deviation indicates that the data is spread and the data points are spread out over a wide range of values.

Example of SAS Standard Deviation

## Ways of Measuring SAS Standard Deviation

Here, we will discussÂ two types ofÂ Standard deviation in SAS programming language.

### a. SAS Standard Deviation Using PROC MEANS

We saw SAS PROC MEANS in the earlier tutorial to find arithmetic mean of our data. You canÂ measure the Standard Deviation using proc means, you have to choose theÂ STDÂ option in the PROC step. It will displayÂ the Standard Deviation values for each numeric variable in the dataset.

Syntax-

`PROC MEANS DATA = dataset STD;`

Example-
To do this let us use PROC SQL procedure. Let us group the data using â€˜typeâ€™ and â€˜makeâ€™ of cars and calculate the standard deviation for selected variables using the STD option with the PROC means step.

```PROC SQL;
create table CARS1 as
SELECT make,type,horsepower,cylinders,weight
FROM
SASHELP.CARS
WHERE make in ('Audi','BMW')
;
RUN;
PROC MEANS DATA=CARS1 STD;
Run;```

SAS Standard Deviation Using PROC MEANS

### b. SAS Standard Deviation Using PROC SURVEYMEANS

In this statement, you identify the data set to be analyzed, specify the variance estimation method, and provide sample design information.

Syntax-

```PROC SURVEYMEANS options statistic-keywords;
By variables;
Class variables;
Var variables;```

Example-

```PROC SURVEYMEANS DATA=CARS1 STD;
Class type;
Var type horsepower;
ods output statistics=rectangle;
Run;
PROC PRINT DATA=rectangle;
Run;```

Â
The images below shows the output of the code above. It shows a distribution of data for variable â€˜Horsepowerâ€™ for 95% confidence interval which means that there is a probability that the spread of the data is within 95% of this.Â

SAS Standard Deviation Using PROC SURVEYMEANS

i. Using BYÂ option to group standard deviation
We grouped data to find meaning in the proc means tutorial, we can do the same for standard deviation also.

Example-

```PROC SURVEYMEANS DATA=CARS1 STD;
Var Â horsepower;
BY make= â€˜BMWâ€™;
Run;
proc print data=CARS1;
run;```

BY option to group standard deviation

This was allÂ in SAS Standard Deviation Tutorial. Hope you like our explanation.

## Conclusion

Hence, you understood What is SAS Standard Deviation and how we can calculate standard deviation using two procedures the SAS PROC MEANS procedure and the SAS PROC SURVEYMEANS procedure.

Also, the use of BY statement for better analysis of our data. We will learn more interesting statistical procedures in the coming tutorials. For any queries post your doubts in the comments section below.

We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google