Chapter Contents |
Previous |
Next |
The FREQ Procedure |
The WEIGHT statement specifies a numeric variable with a value that represents the frequency of the observation. The WEIGHT statement is most commonly used to input cell count data. See the "Inputting Frequency Counts" section for more information. 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 an 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.
If any value of the weight variable is negative, PROC FREQ displays the frequencies (as measured by the weighted values) but does not compute percentages and other statistics. If you create an output data set using the OUT= option 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 when there are negative weights.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.