ARCHIVED: In SAS, how can I find summary statistics such as the median, skewness, kurtosis, and quantiles?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

In SAS, you can use the UNIVARIATE, MEANS, or SUMMARY procedures to obtain summary statistics such as the median, skewness, and kurtosis. The UNIVARIATE procedure provides a variety of summary statistics for each variable listed in the VAR statement without special options. If the VAR statement is omitted, PROC UNIVARIATE will return statistics for all variables in the data set, for example:

  DATA sample;
  INPUT id 1-2 school 3-4 wages 5-6;
  DATALINES;
  011243
  021633
  030834
  041448
  051642
  RUN;
 
  PROC UNIVARIATE;
  VAR school wages;
  RUN;

The MEANS and SUMMARY procedures also provide similar statistics, although specific statistics to be displayed should be listed as options. SUMMARY requires the PRINT option so that the statistics are displayed on the screen. Unlike in the UNIVARIATE and MEANS procedures, the VAR statement may not be omitted in the SUMMARY procedure. The following examples of the MEANS and SUMMARY procedures produce exactly the same statistics:

  PROC MEANS MEAN STD MEDIAN KURTOSIS SKEWNESS MEDIAN Q1 Q3;
  VAR school wages;
  RUN;
  PROC SUMMARY PRINT MEAN STD MEDIAN KURTOSIS SKEWNESS MEDIAN Q1 Q3; 
  VAR school wages;
  RUN;

If you have questions about using statistical and mathematical software at Indiana University, contact the UITS Research Applications and Deep Learning team.

This is document afrc in the Knowledge Base.
Last modified on 2023-05-09 14:40:11.