fisher_test_df: Performs Fisher test for odds difference of condition 1...

fisher_test_dfR Documentation

Performs Fisher test for odds difference of condition 1 contingent on condition 2.

Description

NAs must be taken into account when formulating the conditions below, if desired.

Usage

fisher_test_df(df, cond1, cond2, alternative = "two.sided", ...)

Arguments

df

tibble

cond1

quosure evaluating to a logical for condition 1

cond2

quosure evaluating to a logical for condition 2

alternative

default="two.sided", see fisher.test().

...

further arguments to my.fisher.test.num() such as verbose

Details

The matrix (returned if verbose=TRUE) is constructed with cond1 and !cond1 for the first and second row, respectively; likewise with cond2 and !cond2 for the first and second column, respectively

Value

p value and odds ratio (c1c2/!c1c2) / (c1!c2/!c1!c2)

Examples

df <- data_frame(a=1:10, b=4:13)
fisher_test_df(df, quo(a < 4), quo(b < 7))
fisher_test_df(df, quo(a > 2), quo(b < 8))

powestermark/pwrutilities documentation built on Dec. 28, 2024, 4:44 a.m.