Chapter Contents |
Previous |
Next |
Statements with the Same Function in Multiple Procedures |
Tip: | You can use a WEIGHT statement and a FREQ statement in the same step of any procedure that supports both statements. |
FREQ variable; |
Required Arguments |
The sum of the frequency variable represents the total number of observations.
Procedures That Support the FREQ Statement |
Note: PROC
FORMS does not calculate statistics. In PROC FORMS, the
value of the frequency variable affects the number of form units that are
printed for each observation.
Example |
The following PROC MEANS step does not use a frequency variable:
options nodate pageno=1 linesize=64 pagesize=40; data track; input Course Speed Hours @@; datalines; 30 4 8 50 7 20 75 10 30 30 8 10 80 9 22 20 8 25 83 11 6 20 6 20 ;
proc means data=track maxdec=2 n mean; var course speed; title 'Average Course and Speed'; run;Without a frequency variable, each observation has a frequency of 1, and the total number of observations is 8.
The second PROC MEANS step uses Hours as a frequency variable:
proc means data=track maxdec=2 n mean; var course speed; freq hours; title 'Average Course and Speed'; run;When you use Hours as a frequency variable, the frequency of each observation is the value of Hours, and the total number of observations is 141 (the sum of the values of the frequency variable).
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.