SAS OnlineTutor HomeFAQ PageSuggested Learning PathContents+Searchback||next

Creating Enhanced List and Summary Reports
Defining Variable Usage


Specifying Statistics

As you saw in the previous example and practice, the default statistic for analysis variables is SUM. But you might want to display other statistics in your PROC REPORT output. To associate a statistic with an analysis variable, specify it as an attribute in the DEFINE statement.

Here's the previous sample output, which displays the default statistic SUM for the three analysis variables:



Flight
Number
Flight
Origin
Flight
Destination
Mail Freight Revenue
219 LGA LON 2700 2513 $1,111,647.00
271 LGA PAR 5050 4421 $1,969,201.00
821 LGA LON 4438 4284 $2,077,907.00


By specifying MEAN in the DEFINE statement for Revenue, you can display the average revenue for each flight number. The optional column heading Average Revenue clarifies that the MEAN statistic is displayed.


     proc report data=flights.europe nowd headline headskip;
        where dest in ('LON','PAR');
        column flight orig dest mail freight revenue;
        define revenue / mean format=dollar15.2
                         'Average/Revenue';
        define flight / group 'Flight/Number' width=6 center;
        define orig / group width=6 spacing=5 'Flight/Origin'
                      center;
        define dest / group width=11 spacing=5
                     'Flight/Destination' center;
     run;

Flight
Number
Flight
Origin
Flight
Destination
Mail Freight Average
Revenue
219 LGA LON 2700 2513 $158,806.71
271 LGA PAR 5050 4421 $151,477.00
821 LGA LON 4438 4284 $159,839.00


You can use the following statistics in PROC REPORT:



 Statistic  Definition
 CSS  Corrected sum of squares
 USS  Uncorrected sum of squares
 CV  Coefficient of variation
 MAX  Maximum value
 MEAN  Average
 MIN  Minimum value
 N  Number of observations with nonmissing values
 NMISS  Number of observations with missing values
 RANGE  Range
 STD   Standard deviation
 STDERR  Standard error of the mean
 SUM  Sum
 SUMWGT  Sum of the Weight variable values.
 PCTN  Percentage of a cell or row frequency to a total frequency
 PCTSUM  Percentage of a cell or row sum to a total sum
 VAR  Variance
 T  Student's t for testing the hypothesis that the population mean is 0
 PRT  Probability of a greater absolute value of Student's t


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement