TABULATE Procedure

VAR Statement

Identifies numeric variables to use as analysis variables.
Alias: VARIABLES
Tip: You can use multiple VAR statements.
Specifying Style Elements for ODS Output

Syntax

Required Argument

analysis-variable(s);
identifies the analysis variables in the table. Analysis variables are numeric variables for which PROC TABULATE calculates statistics. The values of an analysis variable can be continuous or discrete.
If an observation contains a missing value for an analysis variable, then PROC TABULATE omits that value from calculations of all statistics except N (the number of observations with nonmissing variable values) and NMISS (the number of observations with missing variable values). For example, the missing value does not increase the SUM, and it is not counted when you are calculating statistics such as the MEAN.
Interaction:If a variable name and a statistic name are the same, enclose the statistic name in single or double quotation marks.

Optional Arguments

STYLE=<style-element-name|<PARENT>>[style-attribute-name=style-attribute-value<… style-attribute-name=style-attribute-value>]
specifies a style element for analysis variable name headings. For more information about the arguments of this option, see STYLE= .
Note: The use of STYLE= in the VAR statement differs slightly from its use in the PROC TABULATE statement. In the VAR statement, inheritance is different for rows and columns. For rows, the parent heading is located to the left of the current heading. For columns, the parent heading is located above the current heading.
Alias:S=
Restriction:This option affects only the HTML, RTF, and Printer destinations.
Tip:To override a style element that is specified in the VAR statement, you can specify a style element in the related TABLE statement dimension expression.
WEIGHT=weight-variable
specifies a numeric variable whose values weight the values of the variables that are specified in the VAR statement. The variable does not have to be an integer. If the value of the weight variable is
Weight Value
PROC TABULATE Response
0
Counts the observation in the total number of observations
Less than 0
Converts the value to zero and counts the observation in the total number of observations
Missing
Excludes the observation
To exclude observations that contain negative and zero weights from the analysis, use EXCLNPWGT. Note that most SAS/STAT procedures, such as PROC GLM, exclude negative and zero weights by default.
Restriction:To compute weighted quantiles, use QMETHOD=OS in the PROC statement.
Note:Prior to Version 7 of SAS, the procedure did not exclude the observations with missing weights from the count of observations.
Tips:When you use the WEIGHT= option, consider which value of the VARDEF= option is appropriate. See the discussion of VARDEF=divisor .

Use the WEIGHT option in multiple VAR statements to specify different weights for the analysis variables.