TABULATE Procedure

WEIGHT Statement

Specifies weights for analysis variables in the statistical calculations.
See: For information about calculating weighted statistics and for an example that uses the WEIGHT statement, see Calculating Weighted Statistics.

Syntax

WEIGHT variable;

Required Argument

variable
specifies a numeric variable whose values weight the values of the analysis variables. The values of the variable do not have to be integers. PROC TABULATE responds to weight values in accordance with the following table.
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.
Note: Prior to Version 7 of SAS, the procedure did not exclude the observations with missing weights from the count of observations.
Restrictions:To compute weighted quantiles, use QMETHOD=OS in the PROC statement.

PROC TABULATE will not compute MODE when a weight variable is active. Instead, try using PROC UNIVARIATE when MODE needs to be computed and a weight variable is active.

Interaction:If you use the WEIGHT= option in a VAR statement to specify a weight variable, then PROC TABULATE uses this variable instead to weight those VAR statement variables.
Tip:When you use the WEIGHT statement, consider which value of the VARDEF= option is appropriate. See the discussion of VARDEF=divisor and the calculation of weighted statistics in the Keywords and Formulas section of this document.