Chapter 5: Creating Summarized Output 5.1 Generating Summary Statistics 5.2 Creating a Summary Report with the Summary Tables Task 5.3 Creating and Applying Custom Formats 1 Chapter 5: Creating Summarized Output 5.1 Generating Summary Statistics 5.2 Creating a Summary Report with the Summary Tables Task 5.3 Creating and Applying Custom Formats 2 Objectives 3 Create a summary table. Create a summary report. Export summary data to Excel. Business Scenario Management would like a report that includes a summary of profits for each product line and category. The report should be accessible as an HTML file or an Excel spreadsheet stored on a shared network drive. 4 Summary Statistics Task The Summary Statistics task can be used to calculate summary statistics based on groups within the data. You can produce reports, graphs, and data sets as output. 5 Summary Statistics Task The Summary Statistics task has both a wizard and a standard task dialog box that can be used to set up results. 6 Summary Statistics: Task Roles Use the wizard to assign variables to roles. Compute statistics for each numeric variable in the list. Specify variables whose values define subgroups. 7 8 5.01 Multiple Answer Poll Which variables might be an appropriate choice for the Classification variable role? a. State b. PaymentAmount c. AccountNumber d. Month 9 5.01 Multiple Answer Poll – Correct Answers Which variables might be an appropriate choice for the Classification variable role? a. State b. PaymentAmount c. AccountNumber d. Month 10 Summary Statistics: Statistics and Results Choose statistics and results to include, including a report, graphics, and an output data set. 11 Summary Statistics: Advanced View Converting the task in Advanced View enables additional options to further modify the output. 12 Summarizing Data This demonstration illustrates how to use the Summary Statistics task to summarize data, store the results in a summary table, and export the table to Microsoft Excel. 13 14 Exercise This exercise reinforces the concepts discussed previously. 15 16 Chapter 5: Creating Summarized Output 5.1 Generating Summary Statistics 5.2 Creating a Summary Report with the Summary Tables Task 5.3 Creating and Applying Custom Formats 17 Objectives 18 Access the Summary Tables task. Specify a table layout and statistics. Define headings for columns and rows. Assign a label for missing values. Add titles to the report. Generate the tabular summary report. Business Scenario To better understand customer purchasing, the Orion marketing group would like a report that summarizes total profits for each customer age group and product category. 19 Summary Tables The Summary Tables wizard or task can be used to generate a tabular summary report. 20 Summary Tables Wizard The Summary Tables wizard enables you to select analysis variable(s) and statistics, assign classification variables to define rows and columns, and specify totals. 21 22 5.02 Quiz What would you like to change about the current results? 23 5.02 Quiz – Correct Answer What would you like to change about the current results? Eliminate redundant headers. Display missing values as **. 24 Format Order Type values. Highlight the Total row with a different font and color. Summary Tables: Advanced View Use the Summary Tables task in Advanced View to further modify the labels, fonts, and formats in the table results. 25 Summary Tables: Modifying the Display 26 Summary Tables: Results 27 Creating a Tabular Summary Report This demonstration illustrates how to use the Summary Tables task to generate descriptive statistics and display them in a tabular report. 28 29 Exercise This exercise reinforces the concepts discussed previously. 30 31 Chapter 5: Creating Summarized Output 5.1 Generating Summary Statistics 5.2 Creating a Summary Report with the Summary Tables Task 5.3 Creating and Applying Custom Formats 32 Objectives 33 Create user-defined formats. Apply user-defined formats. Business Scenario Regional managers want to compare profits based on regions, rather than on individual countries. You can create and apply a user-defined format to summarize data based on labels rather than raw data values. Region Africa ZA (South Africa) Asia/Pacific IL (Israel), TR (Turkey), AU (Australia) Europe DE (Germany) North America US (United States), CA (Canada) Formatted values of Order_Type Formatted values of Country 34 Countries User-Defined Formats You can create custom formats to display data values with more descriptive or alternative labels. 35 User-Defined Formats User-defined formatting is a two-step process. 1. Create a format definition. 2. Apply the format to specific column(s). 36 Create Format Tasks Two tasks are available to create a user-defined format. Create Format Create Format from Data Set (new in SAS Enterprise Guide 4.3) 37 Create Format: Options The Create Format: Options window enables you to name the format and determine the type and storage location. 38 Create Format: Define Formats The Define formats window enables you to define a list of labels that apply to discrete data values or ranges. 39 Create Format from Data Set Use the Create Format from Data Set task to create a format based on values in an existing data source. 40 User-Defined Formats User-defined formatting is a two-step process. 1. Create a format definition. 2. Apply the format to specific column(s). 41 Applying Formats in Tasks (Review) You can apply custom formats in the same places that formats defined in SAS can be used. 42 Applying Formats: User Defined Category The User Defined category includes any formats either stored permanently or created during the current SAS Enterprise Guide session. 43 44 5.03 Quiz What are some of the advantages of using user-defined formats? 45 5.03 Quiz – Correct Answer What are some of the advantages of using user-defined formats? Possible Answers: Create the format once and use it wherever it is applicable. Formats can be shared among users. Formats can be applied in tasks, queries, and programs. Formats do not require the creation of additional columns. 46 Creating and Applying User-Defined Formats This demonstration illustrates the creation and application of custom formats to summarize data. 47 48 5.04 Quiz (Live Web Only) 1. Open the e105a1.egp project. 2. Double-click on the Create Format task to open it. 3. Select Define Formats and notice the two labels that are already defined and their corresponding ranges. 4. Add an additional label named Over 50 that includes the values 50 to High. (Select High from the list; do not type it.) What must be changed to eliminate the red Xs over the range definitions? 49 5.04 Quiz – Correct Answer 1. Open the e105a1.egp project. 2. Double-click on the Create Format task to open it. 3. Select Define Formats and notice the two labels that are already defined and their corresponding ranges. 4. Add an additional label named Over 50 that includes the values 50 to High. (Select High from the list; do not type it.) What must be changed to eliminate the red Xs over the range definitions? Change inclusive to exclusive so ranges do not overlap. 50 51 Exercise This exercise reinforces the concepts discussed previously. 52 53 Chapter Review 1. In a wizard, you cannot modify the properties of a column. What is another consideration for using a wizard versus the task dialog box, if both are available? 2. If the task dialog box offers so much more, then why use the wizard? 54 Chapter Review Answers 1. In a wizard, you cannot modify the properties of a column. What is another consideration for using a wizard versus the task dialog box, if both are available? The wizard does not have all the options/choices that are available in the task dialog box. 2. If the task dialog box offers so much more, then why use the wizard? The wizard interface provides selections that can quickly generate a result, often with all the choices you need. If you do need additional options, then you can convert the wizard to Advanced View. 55 Chapter Review 3. In the Summary Statistics task, the analysis variable must be a numeric variable. What type of variable is usually used in the Classification role? 4. Is a format only available in the project that defined it? 56 Chapter Review Answers 3. In the Summary Statistics task, the analysis variable must be a numeric variable. What type of variable is usually used in the Classification role? A categorical variable is used in the Classification role. This is usually a character column such as State or Zip Code. It can be a numeric column such as Year, storing a four-digit year value, or Day_of_Week, storing the values 1 through 7, representing the different weekdays. 4. Is a format only available in the project that defined it? No, a format, if stored in a permanent location, is available to different projects, even different SAS Enterprise Guide users. 57 Chapter Review 5. When you create a character format, are the data values case sensitive? 6. What are the three dimensions in a report from the Summary Tables task? 58 Chapter Review Answers 5. When you create a character format, are the data values case sensitive? Yes, the data values defined in the format must match the case of the stored data value. 6. What are the three dimensions in a report from the Summary Tables task? The dimensions are Columns, Rows, and Pages. 59