Learn R Programming

BayesianHybridDesign (version 0.1.0)

fisher.power: Power Calculation by Fisher's Exact Test

Description

This function calculates the power by simulations using Fisher's exact test.

Usage

fisher.power(pt, nt, pc, nc, alpha = 0.1, nsim = 10000, seed = NULL)

Value

A numeric scalar representing the calculated statistical power.

Arguments

pt

A scalar. Probablity of success in experimental arm

nt

A scalar. Number of subject in experimental arm

pc

A scalar. Probablity of success in control arm

nc

A scalar. Number of subject in control arm

alpha

A scalar. One sided type I error rate.

nsim

A scalar. Number of replications to calculate power. Default 100,000.

seed

An integer. A seed for the random number generator to ensure reproducibility. Note: For best practice, it is recommended to call set.seed() outside of the function.

Examples

Run this code
# nsim is reduced for a quick example run
fisher.power(pt = 0.5, nt = 40, pc = 0.3, nc = 40, nsim = 1000, seed = 2000)

Run the code above in your browser using DataLab