Chapter Contents

Previous

Next
The FREQ Procedure

WEIGHT Statement


Treats observations as if they appear multiple times in the input data set.

Tip: Use to input the cell counts of an existing table.
Featured in: Creating an Output Data Set with Table Cell Frequencies


WEIGHT variable;


Required Arguments

variable
specifies a numeric variable whose value represents the frequency of the observation. If you use the WEIGHT statement, PROC FREQ assumes that an observation represents n observations, where n is the value of variable. The value of the weight variable need not be integer but when a value is missing or zero, PROC FREQ ignores the corresponding observation. If a WEIGHT statement does not appear, each observation has a default weight of 1. The sum of the weight variable values represents the total number of observations.


Using Negative Weights
If any value of the weight variable is negative, PROC FREQ displays the frequencies (as measured by the weighted values), but does not compute and display percentages and other statistics. If you create an output data set using OUT= in the TABLES statement, PROC FREQ creates the PERCENT variable and assigns a missing value for each observation. PROC FREQ also assigns missing values to the variables that the OUTEXPECT and OUTPCT options create. You cannot create an output data set using the OUTPUT statement since statistics are not computed.


Chapter Contents

Previous

Next

Top of Page

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