corrEvents: Expected Number of Events Over Time With Staggered Entry For...

View source: R/corrEvents.R

corrEventsR Documentation

Expected Number of Events Over Time With Staggered Entry For Overlapping Populations

Description

This function calculates the expected number of events under alternative hypothesis at an analysis time, which is calculated from first subject in. The function returns the expected number of events for each arm, based on the provided enrollment distribution function and drop-off distribution if applicable. If the total sample size is not provided, then only the corresponding probability of event for each arm is provided. The expected number of events for each set of subjects is calculated including in both A and B, in A not B, in B not A, and in A or B.

Usage

corrEvents(
  T = 24,
  n = list(AandB = 300, AnotB = 0, BnotA = 450),
  r = list(AandB = 1/2, AnotB = 0, BnotA = 1/2),
  h0 = list(AandB = function(t) {     log(2)/12 }, AnotB = function(t) {     log(2)/12
    }, BnotA = function(t) {     log(2)/12 }),
  S0 = list(AandB = function(t) {     exp(-log(2)/12 * t) }, AnotB = function(t) {    
    exp(-log(2)/12 * t) }, BnotA = function(t) {     exp(-log(2)/12 * t) }),
  h1 = list(AandB = function(t) {     log(2)/12 * 0.7 }, AnotB = function(t) {    
    log(2)/12 * 0.7 }, BnotA = function(t) {     log(2)/12 * 0.7 }),
  S1 = list(AandB = function(t) {     exp(-log(2)/12 * 0.7 * t) }, AnotB = function(t)
    {     exp(-log(2)/12 * 0.7 * t) }, BnotA = function(t) {     exp(-log(2)/12 * 0.7 *
    t) }),
  F.entry = function(t) {     (t/18)^1.5 * as.numeric(t <= 18) + as.numeric(t > 18) },
  G.ltfu = function(t) {     0 }
)

Arguments

T

Analysis time calculated from first subject randomization date.

n

Total sample size for two arms for subjects in both population A and B, A not B, B not A. Default is NULL.

r

Proportion of experimental subjects in both population A and B, A not B, B not A. Default, 1/2 for 1:1 randomization stratified by A and B

h0

Hazard function of control arm for subjects in both population A and B, A not B, B not A. h0(t) = log(2)/m0 means T~exponential distribution with median m0. For study design without considering heterogeneous effect in strata for control arm, then specify the same h0(t) function across strata.

S0

Survival function of control arm for subjects in both population A and B, A not B, B not A. h0(t) = log(2)/m0 means T~exponential distribution with median m0. For study design without considering heterogeneous effect in strata for control arm, then specify the same S0(t) function across strata. The density function f0(t) = h0(t) * S0(t).

h1

Hazard function of experimental arm for subjects in both population A and B, A not B, B not A. For study design without considering heterogeneous effect in strata for the experimental arm, then specify the same h1(t) function across strata.

S1

Survival function of experimental arm for subjects in both population A and B, A not B, B not A. For study design without considering heterogeneous effect in strata for the experimental arm, then specify the same h1(t) function across strata.

F.entry

Distribution function of enrollment. For uniform enrollment, F.entry(t) = (t/A) where A is the enrollment period, i.e., F.entry(t) = t/A for 0<=t<=A, and F.entry(t) = 1 when t > A. For more general non-uniform enrollment with weight psi, F.entry(t) = (t/A)^psi*I(0<=t<=A) + I(t>A). Default F.entry is uniform distribution function.

G.ltfu

Distribution function of lost-to-follow-up censoring process. The observed survival time is min(survival time, lost-to-follow-up time). For 3\ every year as a constant rate, then G.ltfu = 1-exp(-0.03/12*t), i.e., drop-off~exp distribution. Default G.ltfu = 0 (no lost-to-followup)

Value

An object with dataframes below.

p.event

Probability of event for each arm (p.event0: control group; p.event1: experimental group)

n.events

Expected number of events

  • subgroup: Label of subgroups

  • n.events0: number of events for control group

  • n.events1: number of events for experimental group

  • n.events.total: total number of events for two groups

  • n0: number of subjects in control arm

  • n1: number of subjects in experimental arm

  • n.total: total number of subjects

  • maturity0: maturity in control arm, percent of events

  • maturity1: maturity in experimental arm, percent of events

  • maturity: maturity in both arms, percent of events

param

Parameters specified: T, r, and n

param.fun

f0, f1, F.entry, G.ltfu

Examples

#PD-L1+ subgroup and overall population tests. Control arm has exponential
#distribution with median 12 months in all strata. Experimental arm has
#proportional hazards with a hazard ratio of 0.7 in all strata. The randomization
#is stratified by PD-L1+ status. 1:1 randomization. 300 subjects in PD-L1+ and 
#450 total subjects in overall population. 3\% drop-off every year. Enrollment
#period is 18 months and weight 1.5. The expected number of events at 24 months is
#calculated as
corrEvents(T = 24, n = list(AandB = 300, AnotB=0, BnotA=450), 
   r = list(AandB=1/2, AnotB =0, BnotA = 1/2), 
   h0=list(AandB=function(t){log(2)/12}, AnotB=function(t){log(2)/12}, 
           BnotA=function(t){log(2)/12}), 
   S0=list(AandB=function(t){exp(-log(2)/12*t)}, AnotB=function(t){exp(-log(2)/12*t)},
           BnotA=function(t){exp(-log(2)/12*t)}),
   h1=list(AandB=function(t){log(2)/12*0.70},    AnotB=function(t){log(2)/12*0.70},
           BnotA=function(t){log(2)/12*0.70}), 
   S1=list(AandB=function(t){exp(-log(2)/12 * 0.7 * t)},AnotB=function(t){exp(-log(2)/12 * 0.7 * t)},
           BnotA=function(t){exp(-log(2)/12 * 0.7 * t)}),
   F.entry = function(t){(t/18)^1.5*as.numeric(t <= 18) + as.numeric(t > 18)}, 
   G.ltfu = function(t){1-exp(-0.03/12*t)})



phe2189/corrTests documentation built on Oct. 7, 2022, 11:13 a.m.