Previous Page | Next Page

The TABULATE Procedure

VAR Statement


Identifies numeric variables to use as analysis variables.
Alias: VARIABLES
Tip: You can use multiple VAR statements.

VAR analysis-variable(s) </ option(s)>;


Required Arguments

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.

Options

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= in the PROC TABULATE statement.

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.   [cautionend]

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.
Featured in: Specifying Style Elements for ODS Output
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...
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.
Tip: When you use the WEIGHT= option, consider which value of the VARDEF= option is appropriate. (See the discussion of VARDEF= .)
Tip: Use the WEIGHT option in multiple VAR statements to specify different weights for the analysis variables.

Note:   Before Version 7 of SAS, the procedure did not exclude the observations with missing weights from the count of observations.  [cautionend]

Previous Page | Next Page | Top of Page