pearson_chisq: Computes the Pearson X^2 statistic.
Description
Computes the Pearson X^2 statistic.
Usage
pearson_chisq(n, pi, exclude_diagonal = FALSE)
Arguments
- n
Matrix of observed counts
- pi
Matrix with same dimensions as n. Model-based matrix of predicted proportions
- exclude_diagonal
logical. Should diagonal cells of square matrix
be excluded from the computation? Default is FALSE. The effect of setting
it to TRUE for non-square matrices may be unintuitive and should he avoided.