LWchi2(obsn, expn, totn)
obsn
.obsn
.chistat
, chi-squared statistic;
df
, degrees of freedom; and
pval
, P value.
The second element is a numeric vector the same length as obsn
,
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 totn
.expn
and (totn
- expn
)
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).chisq.test
.LWchi2(c(10, 8, 3), c(7, 7, 7), c(12, 12, 12))
Run the code above in your browser using DataLab