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

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 Research Analytics. Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200; staff are available for consultation Monday-Friday 9am-noon and by appointment.

Note:
For details about availability of UITS services during Thanksgiving break, see UITS Thanksgiving break support hours.

This is document afrc in the Knowledge Base.
Last modified on 2015-06-29 00:00:00.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.