The MEANS Procedure

# Example 11: Identifying an Extreme Value with the Output Statistics

Procedure features:

CLASS statement

OUTPUT statement options:

 statistic keyword MAXID
Other features:
 PRINT procedure
Data set: CHARITY

This example

• identifies the observations with maximum values for two variables

• creates new variables for the maximum values

• displays the output data set.

 `options nodate pageno=1 linesize=80 pagesize=60;`
 `proc means data=Charity n mean range chartype;`
 ` class School Year;`
 ` var MoneyRaised HoursVolunteered;`
 ``` output out=Prize maxid(MoneyRaised(name) HoursVolunteered(name))= MostCash MostTime max= ; ```
 ``` title 'Summary of Volunteer Work by School and Year'; run;```
 ```proc print data=Prize; title 'Best Results: Most Money Raised and Most Hours Worked'; run;```

 ``` Summary of Volunteer Work by School and Year 1 The MEANS Procedure N School Year Obs Variable N Mean Range ----------------------------------------------------------------------------- Kennedy 1992 15 MoneyRaised 15 29.0800000 39.7500000 HoursVolunteered 15 22.1333333 30.0000000 1993 20 MoneyRaised 20 28.5660000 23.5600000 HoursVolunteered 20 19.2000000 20.0000000 1994 18 MoneyRaised 18 31.5794444 65.4400000 HoursVolunteered 18 24.2777778 15.0000000 Monroe 1992 16 MoneyRaised 16 28.5450000 48.2700000 HoursVolunteered 16 18.8125000 38.0000000 1993 12 MoneyRaised 12 28.0500000 52.4600000 HoursVolunteered 12 15.8333333 21.0000000 1994 28 MoneyRaised 28 29.4100000 73.5300000 HoursVolunteered 28 19.1428571 26.0000000 ----------------------------------------------------------------------------- ```

 ``` Best Results: Most Money Raised and Most Hours Worked 2 Most Most Money Hours Obs School Year _TYPE_ _FREQ_ Cash Time Raised Volunteered 1 . 00 109 Willard Tonya 78.65 40 2 1992 01 31 Tonya Tonya 55.16 40 3 1993 01 32 Cameron Amy 65.44 31 4 1994 01 46 Willard L.T. 78.65 33 5 Kennedy . 10 53 Luther Jay 72.22 35 6 Monroe . 10 56 Willard Tonya 78.65 40 7 Kennedy 1992 11 15 Thelma Jay 52.63 35 8 Kennedy 1993 11 20 Bill Amy 42.23 31 9 Kennedy 1994 11 18 Luther Che-Min 72.22 33 10 Monroe 1992 11 16 Tonya Tonya 55.16 40 11 Monroe 1993 11 12 Cameron Myrtle 65.44 26 12 Monroe 1994 11 28 Willard L.T. 78.65 33 ```

 Previous Page | Next Page | Top of Page