fisher_power: Fisher Exact Empirical Power

View source: R/fisher-power.R

fisher_powerR Documentation

Fisher Exact Empirical Power

Description

Calculates the empirical power of a test through simulated data for a given effect size of sample size (per group).

Usage

fisher_power(p1, p2, n1, n2, nsim = 200L, alpha = 0.05, ...)

Arguments

p1

The first proportion (group 1).

p2

The second proportion (group 2).

n1

The group 1 sample size (column 1).

n2

The group 2 sample size (column 2).

nsim

integer(1). Number of simulations to perform in estimating power, (1 - \beta).

alpha

double(1). The significance threshold (\alpha), the probability of a significant result given the null hypothesis, i.e. a false positive. If desired, Bonferroni correction should be implemented here.

...

Passed to the underlying test, i.e. fisher.test(), t.test(), etc., e.g. ⁠alternative =⁠.

Examples

fisher_power(0.8, 0.7, 100, 100)

fisher_power(0.6, 0.7, 50, 60)

stufield/power documentation built on June 1, 2025, 7:16 p.m.