Skip to contents

Pure-base-R Pearson chi-square without Yates correction. Intended for quick self-checks of the transcribed cell counts against the published chi-square values.

Usage

morie_siu_verify_chi2(observed)

Arguments

observed

A 2D matrix or data frame of non-negative counts.

Value

A named list with elements chi2, df, p_value, expected, and n.

Examples

morie_siu_verify_chi2(matrix(c(10, 10, 10, 10), nrow = 2))$chi2
#> [1] 0