Statistic Excel Tools

You might also like

You are on page 1of 18
Frequency Distribution and Bar Chart for Categorical Data In this section we show how Excel can be used to construct a frequency distribution and a bar chart for categorical data using Excel's Recommended Charts tool. We illustrate each using the data on soft drink purchases in Table 2.1. Open the DATAfile named Softdrink. Step 1. Select any cell in the data set (cells A1:A51) Step 2. Click INSERT on the Ribbon Step 3. In the Charts group click Recommended Charts; a preview showing the bar chart appears Step 4. Click OK; the bar chart will appear in a new worksheet The worksheet in Figure 2.16 shows the bar chart for the 50 soft drink purchases created using these steps. Also shown are the frequency distribution and PivotTable fields dialog box that were created by Excel in order to construct the bar chart. Thus, using Excel's Recommended Charts tool, you can construct a bar chart and a frequency distribution at the same time. ‘You can easily edit the bar chart to display a different chart title and add axis titles. For instance, suppose you would like to use “bar Chart of Soft drink Purchases” as the chart title and insert “Soft drink” for the horizontal axis title and “frequency” for the vertical axis title. Step 1. Click the Chart Title and replace it with Bar Chart of Soft Drink Purchases Step 2. Click the Chart Elements button +) (located next to the top right comer of the chart) Step 3. When the list of chart elements appears: Click Axis Titles (creates placeholders for the axis titles) Step 4. Click the Horizontal (Category) Axis Title and replace it with Soft Drink Step 5. Click the Vertical (Value) Axis Title and replace it with Frequency ‘The edited bar chart is shown in Figure 2.17. FIGURE 2.16 BAR CHART OF SOFT DRINK PURCHASES CONSTRUCTED USING EXCEL’S RECOMMENDED CHARTS TOOL 2% ® [a r 2 cece ° 6 De Peper 5 7 Pept 8 8 syne 5 9 1 PvotTable Fields 7% 12 Ooo esosestereo 2.) 13 emt Pacnt tt brn ain iy Y res eno sme) FIGURE 2.17 EDITED BAR CHART OF SOFT DRINK PURCHASES CONSTRUCTED USING EXCEL’S RECOMMENDED CHARTS TOOL, PivotChart Fields 7 Tyas 0 ss) ‘seca © = pescarcomE > AUS bart de poate To display a different type of chart, select the bar chart (by clicking anywhere in the chart) to display three tabs (Analyze, Design, and Format) located on the Ribbon under the heading PivotChart Tools. Click the Design Tab and choose the Change Chart Type option to display the Change Chart Type dialog box. If, for example, you wish to display a pie chart, select Pie and then OK to display a pie chart of the soft drink purchases, Frequency Distribution and Histogram for Quantitative Data Excel’s PivotTuble Report is an interactive tool that allows you to quickly summarize dat a variety of ways, including developing a frequency distribution for quantitative data. Once a frequency distribution is created using the PivotTable Report, Excel’s chart tools can then be used to construct the corresponding histogram. But, using Excel's PivotChart Report, ‘we can construct a frequency distribution and a histogram simultaneously. We will illus- trate this procedure using the audit time data in Table 2.4. The label “Audit Time” and the 20 audit time values are entered into cells Al:A21 of an Excel worksheet. The following steps describe how to use Excel’s PivotChart Report to construct a frequency distribution and. a histogram for the audit time data. Refer to Figure 2.18 as we describe the steps involved. FIGURE 2.18 USING EXCEL"S PIVOTCHART REPORT TO CONSTRUCT A FREQUENCY DISTRIBUTION AND HISTOGRAM FOR THE AUDIT TIME DATA, Step 1. Click the Insert tab on the Ribbon Step 2. In the Tables group, click the word PivotTable Step 3. Choose PivotChart from the options that appear Step 4. When the Create PivotTable with PivotChart dialog box appears, Choose Select a table or range Enter Al:A21 in the Table/Range box Choose Existing Worksheet as the location for the PivotTable and PivotChart Enter C1 in the Location box Click OK Step 5. In the PivotTable Field List, go to Choose Fields to add to report Drag the Audit Time field to the Axis Fields (Categories) area Drag the Audit Time field to the Values area Step 6. Click Sum of Audit Time in the Values area Step 7. Click Value Field Settings from the list of options that appears Step 8. When the Value Field Settings dialog appears, ‘Under Summarize value field by, choose Count Click OK Step 9. Close the PivotTable Field List Step 10. Right-click cell C2 in the PivorTable report or any other cell contai audit time Step 11. Choose Group from the list of options that appears Step 12. When the Grouping dialog box appears, Enter 10 in the Starting at box Enter 34 in the Ending at box Enter 5 in the By box Click OK (a PivotChart will appear) Step 13. Click inside the resulting PivotChart Step 14. Click the Design tab on the Ribbon Step 15. In the Chart Layouts group, click the More button (the downward pointing arrow with a line over it) to display all the options Step 16. Choose Layout 8 Step 17. Click the Chart Elements button +| (located next to the top right comer of the chart) Step 18. When the list of chart elements appears: Click Axis Titles (creates placeholders for the axis titles) Step 19. Click the Horizontal (Category) Axis Title and replace it with Audit Time in Days Step 20. Click the Vertical (Value) Axis Title and replace it with Frequeney g an Figure 2.18 shows the resulting PivotTable and PivotChart, We see that the PivotTable report provides the frequency distribution for the audit time data and the PivotChart provides the corresponding histogram. If desired, we can change the labels in any cell in the frequency distribution by selecting the cell and typing in the new label. Crosstabulation Excel's PivotTable Report provides an excellent way to summarize the data for two or more variables simultaneously, We will illustrate the use of Excel’s PivotTable Report by show- ing how to develop a crosstabulation of quality ratings and meal prices for the sample of 300 Los Angeles restaurants. We will use the data in the file named Restaurant; the labels “Restaurant,” “Quality Rating,” and “Meal Price ($)” have been entered into cells A1:C1 of the worksheet as shown in Figure 2.19. The data for each of the restaurants in the sample have been entered into cells B2:C301 FIGURE 2.19 EXCEL WORKSHEET CONTAINING RESTAURANT DATA ra Hi In order to use the Pivot Table report to create a crosstabulation, we need to perform three tasks: Display the Initial PivotTable Field List and PivotTable Report; Set Up the Piv- otTuble Field List; and Finalize the PivotTable Report. These tasks are described as follows. Display the Initial PivotTable Field List and PivotTable Report: Three steps are needed to display the initial PivotTable Field List and PivotTable report. Step 1. Click the Insert tab on the Ribbon Step 2. In the Tables group, click the icon above the word PivotTable Step 3. When the Create PivotTable dialog box appears, Choose Select a Table or Range Enter A1:C301 in the Table/Range box Choose New Worksheet as the location for the PivotTable Report Click OK ‘The resulting initial PivotTable Field List and PivotTable Report are shown in Figure 2.20. Set Up the PivotTable Field List: Each of the three columns in Figure 2.19 (labeled Restau- rant, Quality Rating, and Meal Price ($)) is considered a field by Excel. Fields may be chosen to represent rows, columns, or values in the body of the PivotTable Report. The following steps show how to use Excel's PivotTable Field List to assign the Quality Rating field to the rows, the Meal Price ($) field to the columns, and the Restaurant field to the body of the PivotTable report. Step 1. In the PivotTable Field List, zo to Choose Fields to add to report, Drag the Quality Rating field to the Row Labels area Drag the Meal Price (S) field to the Column Labels area Drag the Restaurant field to the Values area FIGURE 2.20 INITIAL PIVOTTABLE FIELD LIST AND PIVOTTABLE FIELD. REPORT FOR THE RESTAURANT DATA PivotTablel To build a report, choose fields from the PivotTable Field List 18 a9) 20 Step 2. Click on Sum of Restaurant in the Values area Step 3. Click Value Field Settings from the list of options that appear Step 4. When the Value Field Settings dialog appears, Under Summarize value field by, choose Count Click OK Figure 2.21 shows the completed PivotTable Field List and a portion of the PivotTable worksheet as it now appears, lize the PivotTable Report: To complete the PivotTable Report we need to group the columns representing meal prices and place the row labels for quality rating in the proper order. The following steps accomplish this. Step 1. Right-click in cell B4 or any cell containing meal prices Step 2. Choose Group from the list of options that appears Step 3. When the Grouping dialog box appears, Enter 10 in the Starting at box Enter 49 in the Ending at box Enter 10 in the By box Click OK Step 4. Right-click on Excellent in cell AS Step 5. Choose Move and click Move “Excellent” to End The final PivotTable Report is shown in Figure 2.22. Note that it provides the same infor- mation as the crosstabulation shown in Table 2.10. FIGURE 2.21 COMPLETED PIVOTTABLE FIELD LIST AND A PORTION OF THE PIVOTTABLE REPORT FOR THE RESTAURANT DATA (COLUMNS H:AK ARE HIDDEN) —h B [ce] ple] F|G[AL/amM| an | 3 (5 [Romar otRestaurant]|Cotumn Labels ~ 4 Row Labels 10 11 12 13 14 15 47 48Grand Total US. Excellent fi 2 2 66 6 Good 643324 84 "Very Good 143 5 61 1 150 8 Grand Total (Ese nomis aso mes) 300 Scatter Diagram We can use Excel’s chart tools to construct a scatter diagram and a trend line for the stereo and sound equipment store data presented in Table 2.12. Refer to Figures 2.23 and 2.24 as we describe the steps involved. We will use the data in the file named Stereo: the labels, Week, No, of Commercials, and Sales Volume have been entered into cells A1:C1 of the worksheet. The data for each of the 10 weeks are entered into cells B2:C11. The follow- ing steps describe how to use Excel’s chart tools to produce a scatter diagram for the data. Step 1. Select cells B1:CI1 Step 2. Click the INSERT tab on the Ribbon Step 3. In the Charts group, click Insert Scatter (X,Y) or Bubble Chart Step 4. When the list of scatter diagram subtypes appears, click Seatter (the chart in the upper left corner) ‘The worksheet in Figure 2.23 shows the scatter diagram produced using these steps. You can easily edit the scatter diagram to display a different chart title, add axis titles, and display the trendline. For instance, suppose you would like to use “Scatter diagram for the Stereo and Sound Equipment Store” as the chart title and insert “Number of Commer- cials” for the horizontal axis title and “Sales ($100s)” for the vertical axis title. Step 1. Click the Chart Title and replace it with Seatter Diagram for the Stereo and Sound Equipment Store Step 2. Click the Chart Elements button +) (located next to the top right comer of the chart) FIGURE 2.22 FINAL PIVOTTABLE REPORT FOR THE RESTAURANT DATA FIGURE 2.23. SCATTER DIAGRAM FOR THE STEREO AND SOUND EQUIPMENT STORE USING EXCEL'S CHART TOOLS FIGURE 2.24 SCATTER DIAGRAM AND TRENDLINE FOR THE STEREO AND SOUND EQUIPMENT STORE USING EXCEL’S CHART TOOLS nae iz Da Week No. of Commercials Sales Volume T Step 3. When the list of chart elements appears: Click Axis Titles (creates placeholders for the axis titles) Click Gridlines (10 deselect the Gridlines option) Click Trendline Step 4. Click the Horizontal (Value) Axis Title and replace it with Number of Commercials Step 5. Click the Vertical (Value) Axis Title and replace it with Sales ($100s) Step 6. To change the trendline from a dashed line to a solid line, right-click on the trendline and choose the Format Trendline option Step 7. When the format Trendline dialog box appears: Select the Fill & Line option: In the Dash type box, select Solid Close the format Trendline dialog box ‘The edited scatter diagram and tendline are shown in Figure 2.24. Side-by-Side Bar Chart ‘We can use Excel’s Recommended Charts tool to construct a side-by-side bar chart for the restaurant data shown in Table 2.9. The data can be found in the DATAfile Restaurant. We assume that a pivot table has been constructed as shown in Figure 2.22. The following steps can be used to construct a side-by-side bar chart of the pivot table results. Step 1. Select any cell in the pivot table Step 2. Click the INSERT tab on the Ribbon Step 3. In the Charts group, click Recommended Charts FIGURE 2.25. SIDE-BY-SIDE BAR CHART FOR THE RESTAURANT DATA a TOPE ee RES OSI FZ RRR [Ven coma 6 6 wie Traces min dls com | Frond To awe? ce 4 2 | tom im cue n= 16. TTTTiTrir rrr rr rr rr iit t Step 4. When the chart appears you can choose the recommended chart type by clicking OK (alternatively, you can preview a different chart type by selecting one of the other chart types listed on the left side of the Insert Chart dialog box) ‘The worksheet in Figure 2.25 shows the side-by-side bar chart produced using these steps. Note that this is not the same chart shown in Figure 2.9, since the horizontal axis is qual- ity rating rather than meal price. However, we can easily change this to match the chart in Figure 2.9 using the following steps. Step 1. Click on the chart Step 2. Click the Design tab on the Ribbon Step 3. In the Data group, click Switch Row/Column ‘The new chart appears as shown in Figure 2.26. You can easily edit the side-by-side bar chart to display axis titles as shown in Figure 2.26 using the following steps. Step 1. Click on the chart Step 2. Click the Chart Elements button | (located next to the top right corner of the chart) FIGURE 2.26 EDITED SIDE-BY-SIDE BAR CHART FOR THE RESTAURANT DATA a NOP ORS Tw ih += [Conran CCA Stacked Bar Chart We can use Excel’s Recommended Charts tool to construct a stacked bar chart for the res- taurant data shown in Table 2.9. The data can be found in the DATAfile Restaurant. The following steps show how to construct a pivot chart that is based on percentage of column total as shown in Table 2.15. We assume that a pivot table has been constructed as shown in Figure 2.22. Step 1. Select any cell in the pivot table Step 2. Right-click and select Show Value as Step 3. From the Show values as drop down menu, choose % of Column Total ‘The worksheet in Figure 2.27 shows new pivot table that gives percentages by column total. The following steps allow us to create a stacked bar chart of the elements of this pivot table. Step 1. Select any cell in the pivot table Step 2. Click the INSERT tab on the Ribbon Step 3. In the Charts group, click Recommended Charts Step 4. When the bar chart appears, choose the third option of the bar charts shown (100% Stacked Column) and click OK The worksheet in Figure 2.27 shows the resulting stacked bar chart. Note that this is not the same chart shown in Figure 2.10, since the horizontal axis is quality rating rather than meal price. However, we can easily change this to match the chart in Figure 2.10 using the following steps. Step 1. Click on the chart Step 2. Click the Design tab on the Ribbon Step 3. In the Data group, click Switch Row/Column, FIGURE 2.27 STACKED BAR CHART FOR THE RESTAURANT DATA a = Ce REN OTP TQ] RTS [rT OL yw YZ A [5 ee start Co Tr [¥en Geos osm 2 sume Soe f n ! wauraisis || athe © Tr COPE rere rr rr tt FIGURE 2.28 EDITED STACKED BAR CHART FOR THE RESTAURANT DATA ‘Conta Rae! Coma cid ent ‘| i 1 | st EECEEEEE EEE ert Descriptive Statistics Using Excel Excel can be used to generate the descriptive statistics discussed in this chapter. We show how Excel can be used to generate several measures of location and variability for a single variable and to generate the covariance and correlation coefficient as measures of associa- tion between two variables. Using Excel Functions Excel provides functions for computing the mean, median, mode, sample variance, and sample standard deviation. We illustrate the use of these Excel functions by computing the mean, median, mode, sample variance, and sample standard deviation for the starting sal- ary data in Table 3.1. Refer to Figure 3.16 as we describe the steps involved. The data are entered in column B. The new chart appears as shown in Figure 2.28. Also, you can easily edit the side-by-side bar chart to display the horizontal axis title as shown in Figure 2.28 using the following steps. Step 1. Click on the chart Step 2. Click the Chart Elements button +) (located next to the top right comer of the chart) Step 3. When the list of chart elements appears: Click Axis Titles (creates placeholders for the axis titles) Step 4. Click the Horizontal (Value) Axis Title and replace it with Meal Price ($) Step 5. Click the Vertical (Value) Axis Title and press the delete key Note that the colors of the bars may be changed by right clicking on the bar and choosing the desired color from the Fill option. FIGURE 3.16 USING EXCEL FUNCTIONS FOR COMPUTING THE MEAN, MEDIAN, MODE, VARIANCE, AND STANDARD DEVIATION Excel’s AVERAGE function can be used to compute the mean by entering the following formula into cell El: =AVERAGE(B2:B13) Similarly, the formulas =MEDIAN(B2:B 13), =MODE.SNGL(B2:B13), = VAR.S(B2:B13), and =STDEV.S(B2:B13) are entered into cells E2:E5, respectively, to compute the median, ‘mode, variance, and standard deviation for this sample. The worksheet in the foreground shows that the values computed using the Excel functions are the same as we computed earlier in the chapter. Excel also provides functions that can be used to compute the sample covariance and the sample correlation coefficient. We show here how these functions can be used to com- pute the sample covariance and the sample correlation coefficient for the stereo and sound equipment store data in Table 3.6, Refer to Figure 3.17 as we present the steps involved. Excel’s sample covariance function, COVARIANCES, can be used to compute the sample covariance by entering the following formula into cell F1: =COVARIANCE.S(B2:B11,C2:C11) Similarly, the formula =CORREL(B2:B11,C2:C11) is entered into cell F2 to compute the sample correlation coefficient. The worksheet in the foreground shows the values computed using the Excel functions. Note that the value of the sample covariance (11) is the same as ‘computed using equation (3.13). And the value of the sample correlation coefficient (.93) is the same as computed using equation (3.15). Using Excel’s Descriptive Statistics Tool ‘As we already demonstrated, Excel provides statistical functions to compute descriptive statistics for a data set. These functions can be used to compute one statistic at a time (eg., mean, variance, ete.). Excel also provides a variety of Data Analysis Tools. One of these tools, called Descriptive Statistics, allows the user to compute a variety of descriptive statistics at once. We show here how it can be used to compute descriptive sta- tistics for the starting salary data in Table 3.1. FIGURE 3.17 USING EXCEL FUNCTIONS FOR COMPUTING THE COVARIANCE AND CORRELATION FIGURE 3.18 EXCEL'S DESCRIPTIVE STATISTICS TOOL OUTPUT Step 1. Click the Data tab on the Ribbon Step 2. In the Analysis group, click Data Analysis, Step 3. When the Data Analysis dialog box appears: Choose Descriptive Statistics Click OK Step 4. When the Descriptive Statistics dialog box appears: Enter B1:B13 in the Input Range box Select Grouped By Columns Select Labels in First Row Select Output Range Enter D1 in the Output Range box (to identify the upper left-hand corner of the section of the worksheet where the descriptive statistics will ap- pear) Select Summary statistics Click OK Cells D1:E15 of Figure 3.18 show the descriptive statistics provided by Excel. The boldface entries are the descriptive statistics we covered in this chapter. The descriptive statistics that are not boldface are either covered subsequently in the text or discussed in more advanced texts. Regression Analysis with Excel In this appendix we will illustrate how Excel’s Regression tool can be used to perform the regression analysis computations for the Armand’s Pizza Parlors problem. Refer to Figure 14.23 as we describe the steps involved. The labels Restaurant, Population, and Sales FIGURE 14.23 EXCEL SOLUTION TO THE ARMAND’S PIZZA PARLORS PROBLEM. geqsaasag are entered into cells A1:C1 of the worksheet. To identify each of the 10 observations, we entered the numbers | through 10 into cells A2:A11. The sample data are entered into cells B2:C11. The following steps describe how to use Excel to produce the regression results. Step 1. Click the Data tab on the Ribbon Step 2. In the Analysis group, click Data Analysis Step 3. Choose Regression from the list of Analysis Tools Step 4. Click OK Step 5. When the Regression dialog box appears: Enter C1:C11 in the Input Y Range box Enter B1:B11 in the Input X Range box Select Labels Select Confidence Level Enter 99 in the Confidence Level box Select Output Range Enter A13 in the Output Range box (Any upper left-hand corner cell indicating where the output is to begin may be entered here.) Click OK The first section of the output, entitled Regression Statistics, contains summary statistics such as the coefficient of determination (R Square). The second section of the output, titled ANOVA, contains the analysis of variance table. The last section of the output, which is not titled, contains the estimated regression coefficients and related information. We will begin our discussion of the interpretation of the regression output with the information contained in cells A28:130. Interpretation of Estimated Regression Equation Output The y-intercept of the estimated regression line, by = 60, is shown in cell B29, and the slope of the estimated regression line, b, = 5, is shown in cell B30. The label Intercept in cell A29 and the label Population in cell A30 are used to identify these two values. In Section 14.5 we showed that the estimated standard deviation of b, is s,, = 5803. Note that the value in cell C30 is 5803. The label Standard Error in cell C28 is Excel's way of indicating that the value in cell C30 is the standard error, or standard deviation, of b,. Recall that the f test for a significant relationship required the computation of the t statistic, t = b,/s,,. For the Armand’s data, the value of t that we computed was 1 = 5/5803 = 8.62. The label in cell D28, r Sat, reminds us that cell D30 contains the value of the £ test statistic. The value in cell E30 is the p-value associated with the r test for significance. Excel has displayed the p-value in cell E30 using scientific notation. To obtain the decimal value, we move the decimal point 5 places to the left, obtaining a value of .0000255. Because the p-value = .0000255

You might also like