Chapter Contents


The TABULATE Procedure

VAR Statement

Identifies numeric variables to use as analysis variables.

Tip: You can use multiple VAR statements.

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

Required Arguments

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, 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.


STYLE=<style-element-name | <PARENT>><[style-attribute-specification(s)>]
specifies a style element for analysis variable name headings. For information on the arguments of this option and how it is used, see STYLE= in the PROC TABULATE statement.

Note:   When you use STYLE= in the VAR statement, it differs slightly from its use in the PROC TABULATE statement. In the VAR statement, the parent of the heading is the heading under which the current heading is nested.   [cautionend]
Alias: S=
Restriction: This option affects only the HTML and Printer output.
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 HTML Output

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:   Prior to Version 7 of the SAS System, the procedure did not exclude the observations with missing weights from the count of observations.  [cautionend]

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.