The UNIVARIATE Procedure

OUT= Output Data Set in the OUTPUT Statement

PROC UNIVARIATE creates an OUT= data set for each OUTPUT statement. This data set contains an observation for each combination of levels of the variables in the BY and CLASS statements, or a single observation if you do not specify a BY or CLASS statement. Thus the number of observations in the new data set corresponds to the number of groups for which statistics are calculated. Without a BY or CLASS statement, the procedure computes statistics and percentiles by using all the observations in the input data set. With a BY statement, the procedure computes statistics and percentiles by using the observations within each BY group. With a CLASS statement, the procedure computes statistics and percentiles by using the observations that correspond to each level of the CLASS variables within each BY group.

The variables in the OUT= data set are as follows:

  • BY statement variables. The values of these variables match the values in the corresponding BY group in the DATA= data set and indicate which BY group each observation summarizes.

  • CLASS statement variables. The values of these variables match the CLASS levels within a BY group that each observation summarizes.

  • variables created by selecting statistics in the OUTPUT statement. The statistics are computed using all the nonmissing data, or they are computed for each CLASS level within each BY group if you specify BY and/or CLASS statements.

  • variables created by requesting new percentiles with the PCTLPTS= option. The names of these new variables depend on the values of the PCTLPRE= and PCTLNAME= options.

If the output data set contains a percentile variable or a quartile variable, the percentile definition assigned with the PCTLDEF= option in the PROC UNIVARIATE statement is recorded in the output data set label. See Example 3.8.

Table 36 lists variables available in the OUT= data set.

Table 36: Variables Available in the OUT= Data Set

Variable Name Description
Descriptive Statistics
CSS Sum of squares corrected for the mean
CV Percent coefficient of variation
KURTOSIS | KURT Measurement of the heaviness of tails
MAX Largest (maximum) value
MEAN Arithmetic mean
MIN Smallest (minimum) value
MODE Most frequent value (if not unique, the smallest mode)
N Number of observations on which calculations are based
NMISS Number of missing observations
NOBS Total number of observations
RANGE Difference between the maximum and minimum values
SKEWNESS | SKEW Measurement of the tendency of the deviations to be larger in one direction than in the other
STD | STDDEV Standard deviation
STDMEAN | STDERR Standard error of the mean
SUM Sum
SUMWGT Sum of the weights
USS Uncorrected sum of squares
VAR Variance
Quantile Statistics
MEDIAN | Q2 | P50 middle value (50th percentile)
P1 1st percentile
P5 5th percentile
P10 10th percentile
P90 90th percentile
P95 95th percentile
P99 99th percentile
Q1 | P25 Lower quartile (25th percentile)
Q3 | P75 Upper quartile (75th percentile)
QRANGE Difference between the upper and lower quartiles (also known as the inner quartile range)
Robust Statistics
GINI Gini’s mean difference
MAD Median absolute difference
QN 2nd variation of median absolute difference
SN 1st variation of median absolute difference
STD_GINI Standard deviation for Gini’s mean difference
STD_MAD Standard deviation for median absolute difference
STD_QN Standard deviation for the second variation of the median absolute difference
STD_QRANGE Estimate of the standard deviation, based on interquartile range
STD_SN Standard deviation for the first variation of the median absolute difference
Hypothesis Test Statistics
MSIGN Sign statistic
NORMAL Test statistic for normality. If the sample size is less than or equal to 2000, this is the Shapiro-Wilk W statistic. Otherwise, it is the Kolmogorov D statistic.
PROBM Probability of a greater absolute value for the sign statistic
PROBN Probability that the data came from a normal distribution
PROBS Probability of a greater absolute value for the signed rank statistic
PROBT Two-tailed p-value for Student’s t statistic with n minus 1 degrees of freedom
SIGNRANK Signed rank statistic
T Student’s t statistic to test the null hypothesis that the population mean is equal to mu 0


Last updated: April 10, 2023