ChiSquaredTest Command

ChiSquaredTest( <Matrix> )

Performs a chi-squared test that compares the given matrix of observed counts against the matrix of expected counts determined by the hypothesis of independence. The matrix of expected counts is calculated internally. Each expected count is found from the row and column totals of the given matrix of observed counts using the rule: expected count=row total×column totaltotal observed counts

Results are returned in list form as {Probability value, chi-squared test statistic}.

ChiSquaredTest({{1, 2, 1}, {3, 2, 3}}) yields {0.69, 0.75}.

ChiSquaredTest( <Observed List>, <Expected List> )

Performs a Goodness of Fit test that compares the given list of observed counts against the given list of expected counts. To compute the probability, n-1 degrees of freedom are assumed, where n is the number of elements in each list. For lists of different sizes the result is undefined. Results are returned in list form as {Probability value, chi-squared test statistic}.

ChiSquaredTest({1, 2, 3, 4}, {3, 2, 4, 2}) yields {0.31, 3.58}.

ChiSquaredTest( <Observed Matrix>, <Expected Matrix> )

Performs a chi-squared test that compares the given matrix of observed counts against the given matrix of expected counts. To compute the probability, (r1)(c1) degrees of freedom are assumed, where r and c are the number of rows and columns in each matrix. For matrices of different size the result is undefined. Results are returned in list form as {Probability value, chi-squared test statistic}.

ChiSquaredTest({{1, 2, 1}, {3, 2, 3}}, {{2, 3, 2}, {4, 2, 3}}) yields {0.45, 1.58}.

ChiSquaredTest( <List>, <List>, <Degrees of Freedom> ) Performs a Goodness of Fit test that compares the given list of observed counts against the given list of expected counts, using a specific number of degrees of freedom. Results are returned in list form as {Probability value, chi-squared test statistic}. For lists of different sizes the result is undefined.

ChiSquaredTest({1, 2, 3, 4}, {3, 2, 4, 2}, 2) yields {0.17, 3.58}.