# fisher: Fisher's exact test In twoxtwo: Work with Two-by-Two Tables

## Description

This function conducts a Fisher's exact test using specified exposure and outcome. Internally the function uses fisher.test to test independence of `twoxtwo` rows and columns. The output of the function includes the odds ratio, the lower/upper bounds for the confidence interval around the estimate, and the p-value from the test.

## Usage

 ```1 2 3 4 5 6 7 8 9``` ```fisher( .data, exposure, outcome, alternative = "two.sided", conf_level = 0.95, or = 1, ... ) ```

## Arguments

 `.data` Either a data frame with observation-level exposure and outcome data or a twoxtwo object `exposure` Name of exposure variable; ignored if input to `.data` is a `twoxtwo` object `outcome` Name of outcome variable; ignored if input to `.data` is a `twoxtwo` object `alternative` Alternative hypothesis for test; must be one of "two.sided", "greater", or "less"; default is `"two.sided"` `conf_level` Confidence level for the confidence interval; default is `0.95` `or` Hypothesized odds ratio; default is `1` `...` Additional arguments passed to twoxtwo function; ignored if input to `.data` is a `twoxtwo` object

## Value

A `tibble` with the following columns:

• test: Name of the test conducted

• estimate: Point estimate from the test

• ci_lower: The lower bound of the confidence interval for the estimate

• ci_upper: The upper bound of the confidence interval for the estimate

• statistic: Test statistic from the test (`NA` for `fisher()`)

• df: Degrees of freedom parameter for the test statistic (`NA` for `fisher()`)

• pvalue: P-value from the test

• exposure: Name of the exposure variable followed by +/- levels (e.g. smoking::yes/no)

• outcome: Name of the outcome variable followed by +/- levels (e.g. heart_disease::yes/no)

twoxtwo documentation built on July 9, 2021, 9:08 a.m.