Download - Appendix 14.1 Chi-Square Tests Using Excelcanmedia.mcgrawhill.ca/college/olcsupport/bowerman/2ce/Appendices... · Appendix 14.1 Chi-Square Tests Using Excel 1 Chi-square goodness

Transcript
Page 1: Appendix 14.1 Chi-Square Tests Using Excelcanmedia.mcgrawhill.ca/college/olcsupport/bowerman/2ce/Appendices... · Appendix 14.1 Chi-Square Tests Using Excel 1 Chi-square goodness

Appendix 14.1 Chi-Square Tests Using Excel 1

Chi-square goodness of fit test:

• In the first row of the spreadsheet, enter thefollowing column headings in order—Percent,Expected, Number, and ChiSqContribution.

• Beginning in cell A2, enter the “percentageof invoice figures” as decimal fractions intocolumn A.

• Compute expected values. Enter the formula=500*A2 into cell B2 and press enter. Copythis formula through cell B6 by double-clicking the drag handle (in the lower rightcorner) of cell B2.

• Enter the “number of invoice figures” intocells C2 through C6.

• Compute cell Chi-square contributions. In cellD2, enter the formula =(C2 – B2)^2/B2 andpress enter. Copy this formula through cellD6 by double-clicking the drag handle (in thelower right corner) of cell D2.

• Compute the Chi-square statistic in cell D8.Use the mouse to select the range of cells D2 : D8 and click the button on the Excelribbon.

• Click on an empty cell, say cell A15, and select the Insert Function button on theExcel ribbon.

• In the Insert Function dialog box, select Statistical from the “Or select a category:”menu, select CHIDIST from the “Select a function:” menu, and click OK.

• In the “CHIDIST Function Arguments” dialogbox, enter D8 into the “X” box and 3 intothe “Deg_freedom” box.

• Click OK in the “CHIDIST Function Arguments”dialog box to produce the p-value related tothe chi-square statistic in cell A15.

Contingency table and chi-square test of inde-pendence:

• Follow the instructions given in Appendix 2.1for using a PivotTable to construct a crosstab-ulation table of fund type versus level of cus-tomer satisfaction and place the table in anew worksheet.

fx

Appendix 14.1 ■ Chi-Square Tests Using Excel

The instruction blocks in this section each begin by describing the entry of data into an Excel spreadsheet. Alter-natively, the data may be downloaded from this book’s website. Please refer to Appendix 1.1 for further infor-mation about entering data, saving data, and printing results when using Excel.

bow02371_app14.1.qxd 3/2/11 3:44 PM Page 1

1st Pass

Page 2: Appendix 14.1 Chi-Square Tests Using Excelcanmedia.mcgrawhill.ca/college/olcsupport/bowerman/2ce/Appendices... · Appendix 14.1 Chi-Square Tests Using Excel 1 Chi-square goodness

2 Chapter 14 Chi-Square Tests

To compute a table of expected values:

• In cell B9, type the formula =$E4*B$7/$E$7(be very careful to include the $ in all thecorrect places) and press the enter key (toobtain the expected value 12 in cell B9).

• Click on cell B9 and use the mouse to pointthe cursor to the drag handle (in the lowerright corner) of the cell. The cursor willchange to a black cross. Using the blackcross, drag the handle right to cell D9 andrelease the mouse button to fill cells C9 : D9. With B9 : D9 still selected, use theblack cross to drag the handle down to cellD11. Release the mouse button to fill cellsB10 : D11.

• To add marginal totals, select the rangeB9 : E12 and click the button on the Excel ribbon.

To compute the chi-square statistic:

• In cell B15, type the formula =(B4 – B9)^2/B9and press the enter key to obtain the cell contribution 0.75 in cell B15.

• Click on cell B15 and (using the procedure described above) use the “black cross cur-sor” to drag the cell handle right to cell D15and then down to cell D17 (obtaining thecell contributions in cells B15 : D17).

• To add marginal totals, select the rangeB15 : E18 and click the button on theExcel ribbon.

• The chi-square statistic is in cell E18(=46.4375).

To compute the p-value for the chi-square testof independence:

• Click on an empty cell, say E20.

• Select the Insert Function button on theExcel ribbon.

• In the Insert Function dialog box, select Statistical from the “Or select a category:”menu, select CHIDIST from the “Select a function:” menu, and click OK.

• In the “CHIDIST Function Arguments” dia-log box, enter E18 (the cell location of the chi-square statistic) into the “X” windowand 4 into the “Deg_freedom” window.

• Click OK in the “CHIDIST Function Arguments” dialog box to produce the p-value related to the chi-square statistic incell E20.

fx

bow02371_app14.1.qxd 3/2/11 3:44 PM Page 2

1st Pass