binsim | R Documentation |
Performs a simulation to estimate the power of Fisher's Exact under group sequential monitoring.
binsim(
nsamp,
n,
p1,
p2,
inf.times,
upper,
lower = rep(1.5, length(inf.times)),
p.con = 0.5,
alt = "less"
)
nsamp |
Number of simulated trials |
n |
Total sample size for each trial |
p1 |
Success probability for group 1 (control) |
p2 |
Success probability for group 2 |
inf.times |
Information times of analyses (as fractions) |
upper |
Upper boundary (p-value scale, so test rejects for values smaller than the 'upper' boundary) |
lower |
Lower boundary (p-value scale) |
p.con |
Proportion randomized to control (group 1) |
alt |
Direction of the alternative (one of greater, less or two.sided) |
Calls fisher.test
. If the experimental group (2) has a higher
event rate than the control group (1), then 'less' is the appropriate
direction for a one-sided test.
A vector of length nsamp
, giving the test result for each
simulated trial, coded 1 if the upper boundary was crossed, -1 if the lower
boundary was crossed, and coded 0 if neither was (only the first boundary
crossing is recorded).
R Gray
b2p
; fisher.test
binsim(20, 50, 0.1, 0.5, c(0.5, 1), c(0.05, 0.05), c(0.5, 0.5), alt = 'less')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.