Calculate the chi-squared statistic from observed and expected counts using the Litchfield and Wilcoxon (1949) approach.
LWchi2(obsn, expn, totn)
A numeric vector of observed counts.
A numeric vector of expected counts, the same length as
A numeric vector of total counts possible, the same length as
The denominator of Litchfield and Wilcoxon's (1949) chi-squared estimate
is the minimum of the
expn and (
following their Nomograph No. 1. This ensures that the same chi-squared
value is calculated regardless of which proportion is reported (e.g.,
affected vs. not affected).
A list of length two.
The first element is a numeric vector of length three:
chistat, chi-squared statistic;
df, degrees of freedom; and
pval, P value.
The second element is a numeric vector the same length as
containing total contributions to the chi-squared. To get the
individual contributions to the chi-squared as reported in
Litchfield and Wilcoxon (1949), divide by
Litchfield, JT Jr. and F Wilcoxon. 1949. A simplified method of evaluating dose-effect experiments. Journal of Pharmacology and Experimental Therapeutics 96(2):99-113. [link].
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.