Table of Contents
Descriptive statistics refer to a set of quantitative measures that summarize and describe the characteristics of a dataset. These statistics provide valuable information about the central tendency, variability, and distribution of the data. SAS (Statistical Analysis System) is a powerful statistical software that offers various tools and procedures to calculate descriptive statistics.
To calculate descriptive statistics using SAS, one can use the PROC MEANS procedure. This procedure allows users to obtain measures such as mean, median, standard deviation, and quartiles for numerical variables. The PROC UNIVARIATE procedure can also be used to generate a comprehensive report with descriptive statistics for multiple variables in a dataset.
To begin, the user must first import the dataset into SAS and ensure that the variables are correctly coded as numerical or categorical. Then, the desired procedure can be called and the necessary variables can be specified. The output will provide a detailed summary of the data, including measures of central tendency, variability, and distribution.
In conclusion, SAS offers a reliable and efficient way to calculate descriptive statistics for a dataset. Its procedures provide a comprehensive overview of the data, allowing users to gain valuable insights and make informed decisions. With its user-friendly interface and powerful analytical capabilities, SAS is a valuable tool for data analysis and research.
Calculate Descriptive Statistics in SAS
Descriptive statistics are values that describe a dataset.
They help us gain an understanding of where of the dataset is located along with how the values are in the dataset.
There are two common ways to calculate descriptive statistics for variables in SAS:
1. Use PROC MEANS to Calculate Summary Statistics
2. Use PROC UNIVARIATE to Calculate Detailed Descriptive Statistics
The following examples show how to use each method in practice with the following dataset in SAS:
/*create dataset*/ data my_data; input team $ points assists; datalines; A 10 2 A 17 5 A 17 6 A 18 3 A 15 0 B 10 2 B 14 5 B 13 4 B 29 0 B 25 2 C 12 1 C 30 1 C 34 3 C 12 4 C 11 7 ; run; /*view dataset*/ proc printdata=my_data;

Example 1. Use PROC MEANS to Calculate Summary Statistics
The following code shows how to use PROC MEANS to calculate summary statistics for the points variable in the dataset:
/*calculate summary statistics for points variable*/ proc meansdata=my_data; var points; run;

The PROC MEANS procedure calculates the following descriptive statistics:
- N: The total number of observations
- Mean: The mean value of points
- Std Dev: The standard deviation of points
- Minimum: The minimum value of points
- Maximum: The maximum value of points
Also note that you can use the class statement to calculate descriptive statistics for one variable, grouped by another variable.
For example, we can use the following code to calculate summary statistics for the points variable, grouped by the team variable:
/*calculate summary statistics for points, grouped by team*/ proc meansdata=my_data; class team; var points; run;

The output displays the summary statistics for the points variable, grouped by each of the unique team values.
Example 2. Use PROC UNIVARIATE to Calculate Detailed Descriptive Statistics
The following code shows how to use PROC UNIVARIATE to calculate detailed descriptive statistics for the points variable:
/*calculate detailed descriptive statistics for points variable*/ proc univariate data=my_data; var points; run;


The PROC UNIVARIATE procedure calculates detailed descriptive statistics for the points variable including the mean, median, mode, standard deviation, variance, range, interquartile range, and more.
We can also use the class statement to calculate these detailed descriptive statistics for the points variable, grouped by the team variable:
/*calculate detailed descriptive statistics for points, grouped by team*/ proc univariate data=my_data; class team; var points; run;
This will produce three groups of output tables that display detailed descriptive statistics for the points variable, grouped by each of the unique team values.
The following tutorials explain how to perform other common tasks in SAS:
Cite this article
stats writer (2024). How do I calculate descriptive statistics using SAS?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-i-calculate-descriptive-statistics-using-sas/
stats writer. "How do I calculate descriptive statistics using SAS?." PSYCHOLOGICAL SCALES, 25 Jun. 2024, https://scales.arabpsychology.com/stats/how-do-i-calculate-descriptive-statistics-using-sas/.
stats writer. "How do I calculate descriptive statistics using SAS?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-do-i-calculate-descriptive-statistics-using-sas/.
stats writer (2024) 'How do I calculate descriptive statistics using SAS?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-i-calculate-descriptive-statistics-using-sas/.
[1] stats writer, "How do I calculate descriptive statistics using SAS?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How do I calculate descriptive statistics using SAS?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
