CHITEST function

Returns the test for independence. CHITEST returns the value from the chi-squared (χ2) distribution for the statistic and the appropriate degrees of freedom. You can use χ2 tests to determine whether hypothesized results are verified by an experiment.

Important   This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. This function is still available for compatibility with earlier versions of Excel. However, if backward compatibility is not required, you should consider using the new functions from now on, because they more accurately describe their functionality.

For more information about the new function, see CHISQ.TEST function.

Syntax

CHITEST(actual_range,expected_range)

The CHITEST function syntax has the following arguments:

  • Actual_range     Required. The range of data that contains observations to test against expected values.

  • Expected_range     Required. The range of data that contains the ratio of the product of row totals and column totals to the grand total.

Remarks

  • If actual_range and expected_range have a different number of data points, CHITEST returns the #N/A error value.

  • The χ2 test first calculates a χ2 statistic using the formula:

    Equation

    where:

    Aij = actual frequency in the i-th row, j-th column

    Eij = expected frequency in the i-th row, j-th column

    r = number or rows

    c = number of columns

  • A low value of χ2 is an indicator of independence. As can be seen from the formula, χ2 is always positive or 0, and is 0 only if Aij = Eij for every i,j.

  • CHITEST returns the probability that a value of the χ2 statistic at least as high as the value calculated by the above formula could have happened by chance under the assumption of independence. In computing this probability, CHITEST uses the χ2 distribution with an appropriate number of degrees of freedom, df. If r > 1 and c > 1, then df = (r - 1)(c - 1). If r = 1 and c > 1, then df = c - 1 or if r > 1 and c = 1, then df = r - 1. r = c= 1 is not allowed and #N/A is returned.

  • Use of CHITEST is most appropriate when Eij’s are not too small. Some statisticians suggest that each Eij should be greater than or equal to 5.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

  1. Select the example in this article.

    Important   Do not select the row or column headers.

    selecting an example from help

    Selecting an example from Help

  2. Press CTRL+C.

  3. In Excel, create a blank workbook or worksheet.

  4. In the worksheet, select cell A1, and press CTRL+V.

    Important   For the example to work properly, you must paste it into cell A1 of the worksheet.

  5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

After you copy the example to a blank worksheet, you can adapt it to suit your needs.

1

2

3

4

5

6

7

8

9


10

A

B

C

Men (Actual)

Women (Actual)

Description

58

35

Agree

11

25

Neutral

10

23

Disagree

Men (Expected)

Women (Expected)

Description

45.35

47.65

Agree

17.56

18.44

Neutral

16.09

16.91

Disagree

Formula

Description (Result)

=CHITEST(A2:B4,A6:B8)

The χ2 statistic for the data above is 16.16957 with 2 degrees of freedom (0.000308)

Applies To: Excel 2010, Excel Starter, Excel Online, SharePoint Online



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language