Tests for independence where each row of the rx2 table is compared to
the exposure reference level and test of independence two-sided p
values are calculated using mid-p exact, Fisher's Exact, and the
chi-square test. This function expects the following table struture:
disease=0 disease=1
exposed=0 (ref) n00 n01
exposed=1 n10 n11
exposed=2 n20 n21
exposed=3 n30 n31
The reason for this is because each level of exposure is compared to
the reference level. If you are providing a 2x2 table order does not matter:
If the table you want to provide to this function is not in the
preferred form, just use the rev
option to "reverse" the rows,
columns, or both. If you are providing categorical variables (factors
or character vectors), the first level of the "exposure" variable is
treated as the reference. However, you can set the reference of a
factor using the relevel
function.
Likewise, each row of the rx2 table is compared to the exposure
reference level and test of independence two-sided p values are
calculated using mid-p exact, Fisher's Exact, Monte Carlo simulation,
and the chi-square test.