chisq.detail: Print details of a chi-squared test

chisq.detailR Documentation

Print details of a chi-squared test

Description

Prints out the details of the computations involved in a chi-squared test on a table. Includes the expected values and the chi-squared contribution of each cell.

Usage

chisq.detail(tab)

Arguments

tab

Matrix or table to be analyzed

Details

This function prints out the input table along with the expected value for each cell under the null hypothesis. It also prints out the chi-squared contribution of each cell in the same pattern as the table. This shows the computations involved and one rule of thumb is to look for these values that are greater than 4 as a post-hoc analysis.

Value

This function is used primarily for its side effect of printing the results, but does return invisibly a list with the following components:

obs

A matrix of the observed values, same as tab.

expected

A matrix of the expected values under the null hypothesis.

chi.table

A matrix of the chi-squared contributions of each cell.

chi2

The chi-squared test statistic.

Author(s)

Greg Snow, 538280@gmail.com

References

~put references to the literature/web site here ~ Moore, bps

See Also

chisq.test,loglin, xtabs, table, prop.table, CrossTable from the gmodels package.

Examples

chisq.detail(HairEyeColor[,,1])
chisq.detail(HairEyeColor[,,2])

TeachingDemos documentation built on May 29, 2024, 5:59 a.m.