The HPSUMMARY Procedure

OUTPUT Statement

OUTPUT <OUT=SAS-data-set> <output-statistic-specifications> </ AUTONAME> ;

The OUTPUT statement writes statistics to a new SAS data set. You can use multiple OUTPUT statements to create several OUT= data sets.

Optional Arguments

OUT= SAS-data-set

names the new output data set. If SAS-data-set does not exist, then PROC HPSUMMARY creates it. If you omit the OUT= option, then the data set is named DATA$n$, where $n$ is the smallest integer that makes the name unique.

output-statistic-specifications

specifies the statistics to store in the OUT= data set and names one or more variables that contain the statistics. The form of the output-statistic-specification is

statistic-keyword <(variable-list)>=<names>

where

statistic-keyword

specifies which statistic to store in the output data set. Table 9.4 lists the statistic-keywords that are available in the OUTPUT statement.

Table 9.4: Statistics Keywords in the OUTPUT Statement

Descriptive Statistic Keywords:

CSS

RANGE

CV

SKEWNESS | SKEW

KURTOSIS | KURT

STDDEV | STD

LCLM

STDERR

MAX

SUM

MEAN

SUMWGT

MIN

UCLM

MODE

USS

N

VAR

NMISS

 

Quantile Statistic Keywords:

MEDIAN | P50

Q3 | P75

P1

P90

P5

P95

P10

P99

P20

P30

P40

P60

P70

P80

Q1 | P25

QRANGE

Hypothesis Testing Keywords:

PROBT | PRT

T


By default the statistics in the output data set automatically inherit the analysis variable’s format, informat, and label. However, statistics computed for N, NMISS, SUMWGT, USS, CSS, VAR, CV, T, PROBT, PRT, SKEWNESS, and KURTOSIS do not inherit the analysis variable’s format because this format might be invalid for these statistics (for example, dollar or datetime formats). If you omit a variable-list and names, then PROC HPSUMMARY allows the statistic-keyword only once in a single OUTPUT statement, unless you also use the AUTONAME option.

The definitions of the keywords and the formulas for the associated statistics are listed in the section Keywords and Formulas.

variable-list

specifies the names of one or more numeric analysis variables whose statistics you want to store in the output data set. By default, statistics are stored for all numeric analysis variables.

names

specifies one or more names for the variables in output data set to contain the analysis variable statistics. The first name contains the statistic for the first analysis variable; the second name contains the statistic for the second analysis variable; and so on. The default value is the analysis variable name. If you specify the AUTONAME option, then the default is the combination of the analysis variable name and the statistic-keyword. If you use the CLASS statement and an OUTPUT statement without an output-statistic-specification, then the output data set contains five observations for each combination of classification variables: the value of N, MIN, MAX, MEAN, and STD. If you use the WEIGHT statement or the WEIGHT option in the VAR statement, then the output data set also contains an observation with the sum of weights (SUMWGT) for each combination of classification variables.

If you specify variable-list, then PROC HPSUMMARY uses the order in which you specify the analysis variables to store the statistics in the output data set variables. You can use the AUTONAME option to request that PROC HPSUMMARY generate unique names for multiple variables and statistics.

AUTONAME

requests that PROC HPSUMMARY create a unique variable name for an output statistic when you do not assign the variable name in the OUTPUT statement. This action is accomplished by appending the statistic-keyword to the input variable name. For example, the following statement produces the x_Min variable in the output data set:

output min(x)=/autoname;

AUTONAME activates the SAS internal mechanism that automatically resolves conflicts in the variable names in the output data set so that duplicate variables do not generate errors. As a result, the following statement produces two variables, x_Min and x_Min2, in the output data set:

output min(x)= min(x)=/autoname;