samplesize.NI.survival: Sample size calculation tool for Non-Inferiority trials with...

samplesize.NI.survivalR Documentation

Sample size calculation tool for Non-Inferiority trials with a survival outcome.

Description

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

Usage

samplesize.NI.survival(HR.target=NULL, p.control.expected=NULL, 
                       p.experim.target=NULL, NI.margin, sig.level = 0.025, 
                       power = 0.9, r = 1, summary.measure = "HR", 
                       print.out = TRUE, test.type="logrank.Schoenfeld",
                       unfavourable=T, round=T, ltfu=0) 

Arguments

HR.target

The target hazard ratio between experimental and control arm at which to power the trial.

p.control.expected

Expected event risk in the control arm.

p.experim.target

Target event risk in the active arm at which to power the trial.

NI.margin

Non-inferiority margin on the selected summary measure.

sig.level

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

power

Power of the trial, i.e. one minus type-II error of the study. Default is 0.9, i.e. 90%.

r

Allocation ratio, i.e. ratio between sample sizes in the active and control goups. Default is 1.

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 "HR" (Hazard Ratio), "DRMST" (Difference in Resticted Mean Survival Time by time tau), or "DS" (Difference in Surviving proportion at time tau).

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 for "HR" only: "logrank.Freedman", "logrank.Schoenfeld", "KM".

unfavourable

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

round

A logical variable. If TRUE, sample sizes are rounded to the next integer, using the ceiling function. Otherwise, they are left unrounded.

ltfu

A numeric variable with the expected proportion of patients lost to follow-up. Default is 0.

Details

This is a function to calculate sample size needed 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, though functions for summary measures other than HR are currently under development.

Value

The output is a vector, containing the sample sizes for the control and active arms respectively.

Examples


 out5A<-samplesize.NI.survival(HR.target=1,p.control.expected=0.2, 
                                   p.experim.target=0.2, NI.margin=1.5)


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