power.NI.continuous: Power calculation tool for Non-Inferiority trials with a...

power.NI.continuousR Documentation

Power calculation tool for Non-Inferiority trials with a continuous outcome.

Description

A function for estimating power of a non-inferiority trial whose primary outcome is continuous. Allows for different summary measures, test types and both favourable (e.g. cure) and unfavourable (e.g. death) events.

Usage

  power.NI.continuous(mean.control, mean.experim, sd, NI.margin, sig.level = 0.025, 
                                      n.control, n.experim, summary.measure = "mean.difference", print.out = TRUE, 
                                      test.type=NULL, higher.better=T, M.boot=2000, n.rep=1000)   

Arguments

mean.control

Assumed mean in the control arm.

mean.experim

target mean in the experimental arm for powering the trial.

sd

Standard deviation in both arms.

NI.margin

Non-inferiority margin. Can be either efined as a mean difference, or mean ratio.

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 "mean.difference" (Difference of Means) or "mean.ratio" (Ratio of Means).

print.out

Logical. If FALSE, no output is printed.

higher.better

Logical. If FALSE, the outcome is considered unfavourable, i.e. higher scores indicate worse outcomes. Default is TRUE, i.e. favourable outcome, higher scores indicate better outcomes.

test.type

A character string defining the method to be used for sampel size calculations. For the mean difference, methods available include "Z.test" and "t.test". For the mean ratio, methods available include "Fiellers" test, "log.t.test" or "log.Z.test".

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.

Details

This is a function to estimate through simulations the power of a fixed sample size to test non-inferiority of an active treatment against the control within a specific NI margin. The margin can be specified on a number of different scales.

Value

The output is an estimate of power, and on screen the Monte-Carlo CI for this estimate may be printed as well.

Examples

  
power<-power.NI.continuous(mean.control=2, mean.experim=2, sd=1, NI.margin=-1, n.control=20, n.experim=20, n.rep=500)
  

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