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 xxact, and normal approximation.
This function expects the following table struture:
counts person-time
exposed=0 (ref) n00 t01
exposed=1 n10 t11
exposed=2 n20 t21
exposed=3 n30 t31
The reason for this is because each level of exposure is compared to
the reference level.
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 method and normal approximation.
This function can be used to construct a p value function
by testing the MUE to the null hypothesis (rr=1) and alternative
hypotheses (rr not equal to 1) to calculate two-side mid-p exact p
values. For more detail, see Rothman.