Summarize the observations in a data set by several categories.
Calls Received by Technical Support on January 31, 2005 Percent Average Number within Length of Hour Status of Problems of Calls Hour Calls 9:00 Automated Troubleshooting 10 15% 0:05:19 Resolved on Initial Call 44 68% 0:05:38 Tracked to Specialist 11 17% 0:09:20 ----- -------- ------- -------- 9:00 65 100% 0:06:13 10:00 Automated Troubleshooting 16 21% 0:09:26 Resolved on Initial Call 52 68% 0:06:53 Tracked to Specialist 8 11% 0:12:21 ----- -------- ------- -------- 10:00 76 100% 0:08:00 11:00 Automated Troubleshooting 12 16% 0:11:44 Resolved on Initial Call 48 64% 0:07:08 Tracked to Specialist 15 20% 0:13:48 ----- -------- ------- -------- 11:00 75 100% 0:09:12 12:00 Automated Troubleshooting 5 9% 0:10:07 Resolved on Initial Call 37 66% 0:08:22 Tracked to Specialist 14 25% 0:11:08 ----- -------- ------- -------- 12:00 56 100% 0:09:13 1:00 Automated Troubleshooting 5 8% 0:04:20 Resolved on Initial Call 43 70% 0:05:53 Tracked to Specialist 13 21% 0:10:39 ----- -------- ------- -------- 1:00 61 100% 0:06:47 2:00 Automated Troubleshooting 13 15% 0:07:44 Resolved on Initial Call 64 74% 0:07:57 Tracked to Specialist 10 11% 0:15:21 ----- -------- ------- -------- 2:00 87 100% 0:08:46 3:00 Automated Troubleshooting 13 15% 0:09:59 Resolved on Initial Call 61 72% 0:06:46 Tracked to Specialist 11 13% 0:07:29 ----- -------- ------- -------- 3:00 85 100% 0:07:21 4:00 Automated Troubleshooting 3 4% 0:08:00 Resolved on Initial Call 57 75% 0:07:39 Tracked to Specialist 16 21% 0:06:13 ----- -------- ------- -------- 4:00 76 100% 0:07:21 ========================= ======== ======= ========= Total for Day 581 100% 0:07:53 |
This report summarizes phone calls to technical support by the hour the call was received and by the status of the call. As shown in the example the status of each call is classified into one of three groups. For each combination of hour and status, the report presents the number of calls and the average length of each call. The percentage of each status grouping is computed within each hour.
The first two columns of the report correspond to variables in the PHONDATA data set. These two variables define the categories for which statistics are computed. The N statistic is presented in the third column. It is equal to the number of observations represented in the row. The fourth column is a computed column that is based on the N statistic computed in column 3. The fifth column is the MEAN statistic computed on an analysis variable in the data set.
PROC TABULATE can produce a report similar to the one that PROC REPORT produced, as shown in Figure 3.1.
Calls Received by Technical Support on January 31, 2005 ------------------------------------------------------------------------------- | |Number|Percent|Average | | | of |within | Length | | |Calls | Hour |of Calls | |-----------------------------------------------------+------+-------+---------| |Hour |Status | | | | |--------------------------+--------------------------| | | | |9:00 |Automated Troubleshooting | 10| 15| 0:05:19 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 11| 17| 0:09:20 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 44| 68| 0:05:38 | | |--------------------------+------+-------+---------| | |Total for Hour | 65| 100| 0:06:13 | |--------------------------+--------------------------+------+-------+---------| |10:00 |Status | | | | | |--------------------------| | | | | |Automated Troubleshooting | 16| 21| 0:09:26 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 8| 11| 0:12:21 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 52| 68| 0:06:53 | | |--------------------------+------+-------+---------| | |Total for Hour | 76| 100| 0:08:00 | |--------------------------+--------------------------+------+-------+---------| |11:00 |Status | | | | | |--------------------------| | | | | |Automated Troubleshooting | 12| 16| 0:11:44 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 15| 20| 0:13:48 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 48| 64| 0:07:08 | | |--------------------------+------+-------+---------| | |Total for Hour | 75| 100| 0:09:12 | |--------------------------+--------------------------+------+-------+---------| |12:00 |Status | | | | | |--------------------------| | | | | |Automated Troubleshooting | 5| 9| 0:10:07 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 14| 25| 0:11:08 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 37| 66| 0:08:22 | | |--------------------------+------+-------+---------| | |Total for Hour | 56| 100| 0:09:13 | |--------------------------+--------------------------+------+-------+---------| |1:00 |Status | | | | | |--------------------------| | | | | |Automated Troubleshooting | 5| 8| 0:04:20 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 13| 21| 0:10:39 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 43| 70| 0:05:53 | | |--------------------------+------+-------+---------| | |Total for Hour | 61| 100| 0:06:47 | ------------------------------------------------------------------------------- |2:00 |Automated Troubleshooting | 13| 15| 0:07:44 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 10| 11| 0:15:21 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 64| 74| 0:07:57 | | |--------------------------+------+-------+---------| | |Total for Hour | 87| 100| 0:08:46 | |--------------------------+--------------------------+------+-------+---------| |3:00 |Status | | | | | |--------------------------| | | | | |Automated Troubleshooting | 13| 15| 0:09:59 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 11| 13| 0:07:29 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 61| 72| 0:06:46 | | |--------------------------+------+-------+---------| | |Total for Hour | 85| 100| 0:07:21 | |--------------------------+--------------------------+------+-------+---------| |4:00 |Status | | | | | |--------------------------| | | | | |Automated Troubleshooting | 3| 4| 0:08:00 | | |--------------------------+------+-------+---------| | |Tracked to Specialist | 16| 21| 0:06:13 | | |--------------------------+------+-------+---------| | |Resolved on Initial Call | 57| 75| 0:07:39 | | |--------------------------+------+-------+---------| | |Total for Hour | 76| 100| 0:07:21 | |-----------------------------------------------------+------+-------+---------| |Total for Day | 581| 100| 0:07:53 | ------------------------------------------------------------------------------- |
The following program produces the report shown in Figure 3.1.
A Closer Look |
As demonstrated in the previous sections, either PROC REPORT or PROC TABULATE can summarize data by categories. Each procedure has strengths and weaknesses.
In this example, you might prefer PROC REPORT for these reasons:
You might prefer PROC TABULATE for these reasons:
□ | Easier to specify the calculation of percentages. PROC REPORT includes percentage statistics, but the denominator for these calculations is based on the total number of observations presented in the report. To compute percentages using other denominator definitions requires the use of COMPUTE blocks. The options in PROC TABULATE allow you to base your percentage calculations on the combinations of classification variables or report dimensions that are appropriate for the information you want to convey, without adding programming statements. |
□ | Less coding required to produce summary rows and columns. The placement of the keyword ALL in a PROC TABULATE TABLE statement summarizes all of the categories for class variables in the same parenthetical group or dimension. With PROC REPORT, you must include BREAK and RBREAK statements to summarize information. |
PROC REPORT reference, usage information, and additional examples. See “The REPORT Procedure” in the “Procedures” section of Base SAS 9.1 Procedures Guide.
PROC TABULATE reference, usage information, and additional examples. See “The TABULATE Procedure” in the “Procedures” section of Base SAS 9.1 Procedures Guide.
3.149.241.48