power.NI.binary: Function to compute the power for a given sample size for a...

power.NI.binaryR Documentation

Function to compute the power for a given sample size for a standard 2-arm non-inferiority trial.

Description

A function that can be used to do power calculations for a non-inferiority trial with binary outcome. The trial can aim to use one of several possible analysis methods and summary measures.

Usage

  power.NI.binary(p.control.expected, p.experim.target, NI.margin, sig.level = 0.025, 
                                  n.control, n.experim, summary.measure = "RD", print.out = TRUE, test.type=NULL,
                                  unfavourable=T, n.rep=1000, M.boot=2000, BB.adj=0.0001) 

Arguments

p.control.expected

Expected event risk in the control arm.

p.experim.target

Target event risk in the experimental arm under which to power the trial.

NI.margin

Non-inferiority margin. Can be either risk difference, risk ratio, odds ratio or arc-sine difference.

sig.level

One-sided significance level for testing. Default is 0.025, i.e. 2.5%.

n.control

The sample size in the control arm for which to estimate power.

n.experim

The sample size in the experimental arm for which to estimate power.

summary.measure

The population-level summary measure to be estimated, i.e. the scale on which we define the non-inferiority margin. Can be one of "RD" (Risk Difference), "RR" (Risk Ratio), "OR" (Odds Ratio) or "AS" (Arc-Sine difference).

print.out

Logical. If FALSE, no output is printed.

test.type

A string that indicates the type of test to be assumed for the sample size calculation. Currently, three options are supported: "Wald", "score" and "local".

unfavourable

A logical variable. If TRUE, the outcome is considered unfavourable. This is used to check that the NI margin specified is meaningful.

n.rep

The number of repetitions of the simulations to estimate power.

M.boot

Number of bootstrap samples if using a bootstrap-based analysis method.

BB.adj

Adjustment factor for "Berger.Boos" method.

Details

This function estimates power of a standard two-arm non-inferiority trial for a given sample size, running a certain number n.rep of simulations under the alternative hypothesis and calculatign estimated success rate of the trial with the desired design and analysis methods.

Value

The estimated power. On screen, the Monte-Carlo Confidence Interval is printed as well.

Examples

  
  power<-power.NI.binary(p.control.expected=0.2, p.experim.target=0.2, NI.margin=0.1, n.control=200, n.experim=200,
                                       n.rep=500)
  

Matteo21Q/dani documentation built on Aug. 29, 2024, 12:48 a.m.