STANDARD 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 WEIGHT.

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. The table below shows what the action will be based on the weight value.
Weight Value
PROC STANDARD Action
0
Counts the observation in the total number of observations
Less than 0
Converts the weight value to zero and counts the observation in the total number of observations
Missing
Excludes the observation from the calculation of mean and standard deviation
To exclude observations that contain negative and zero weights from the calculation of mean and standard deviation, use EXCLNPWGT. Note that most SAS/STAT procedures, such as PROC GLM, exclude negative and zero weights by default.
Tip:When you use the WEIGHT statement, consider which value of the VARDEF= option is appropriate. See VARDEF=divisor and the calculation of weighted statistics in Keywords and Formulas for more information.

Details

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