oogetdoublemaxcombotestpvalue: Compute the p-value for the max-combo test statistic at a...

Description Usage Arguments Value Examples

View source: R/maxcombofunctions.R

Description

This function computes the p-value for the max-combo test statistic for comparing times to an event from two different arms at a single timepoint; please note that this is not a p-value for a group sequential test procedure involving two or more timepoints, but rather a p-value for a scenario in which there is only one planned analysis timepoint. The max-combo test statistic is the maximum of multiple standardized weighted log-rank test statistics. The user of the function is expected to provide the function with a data frame containing the time-to-event data for the two arms; additionally, this data frame is expected to be in a particular format (see more details below). Additionally, the user of the function is expected to provide a list of one or more weighting functions to use for the respective one or more weighted log-rank tests; in particular this function only allows the user to specify a weighting function that takes as input the Kaplan-Meier estimate for the survival curve obtained by pooling both of the two arms (a double that is between 0 and 1, inclusive) and provides as output a weight (a double that is typically greater than or equal to zero); note that the Fleming-Harrington class of weighting functions falls within what can be specified in this way. If no list of weighting functions is provided, a single weighting function that is identically 1 is used, which means that the test statistic that is used is exactly equal to the usual standardized log-rank test statistic.

The supplied data frame is expected to have one row for each subject. The data frame should have the following columns:

The columns in the data frame do not have to be named exactly as above; however, if different names are used, those names must be specified as arguments to the function. Please see below for more detail regarding how to specify those names and for more detail regarding the expectations of the function regarding the columns in the data frame.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
oogetdoublemaxcombotestpvalue(
  oodataframe,
  oolistfunctionweightasafunctionofstminus = base::list(function(oodoublestminus) {    
    base::return(1) }),
  oostringorsymbolid = "id",
  oostringorsymboltreated = "treated",
  oostringorsymbolAtime = "Atime",
  oostringorsymbolBtime = "Btime",
  oostringorsymbolBobserved = "Bobserved",
  oostringorsymbolCtime = "Ctime",
  oostringorsymbolCobserved = "Cobserved",
  ooodoublemaxcomboteststatistic = NULL
)

Arguments

oodataframe

A data frame containing time-to-event data from two different arms.

oolistfunctionweightasafunctionofstminus

A list of one or more weighting functions. Each weighting function should take as input the pooled Kaplan-Meier estimate of survival across the two arms (i.e., a double between 0 and 1, inclusive) and output a single weight (i.e., a double, typically greater than or equal to zero). Defaults to the following list of a single weighting function that is identically 1, which results in the usual standardized log-rank test statistic: base::list(function(oodoublestminus){ base::return(1) } )

oostringorsymbolid

The name of the column in the supplied data frame for the id variable. Defaults to "id". The id variable should take a unique value for each subject. The column with this name in the data frame can be an integer vector with a different integer for each subject; the function will most likely also work if the column is a character vector with a different value for each subject.

oostringorsymboltreated

The name of the column in the supplied data frame for a treatment indicator variable. Defaults to "treated". The treatment indicator variable is a variable indicating which of the two arms the subject is in. The column with this name in the data frame should be an integer vector that takes only the value 0L (e.g., for placebo) or the value 1L (e.g., for a new drug or therapy). The test statistic that is used by this function will generally be for a test that the arm represented by subjects with treatment indicator 1L is superior to the arm represented by subjects with treatment indicator 0L (i.e., a one-sided test of superiority of arm 1 over arm 0).

oostringorsymbolAtime

The name of the column in the supplied data frame for the Atime variable. Defaults to "Atime". Atime is the absolute time the subject enters the study. The column with this name in the data frame can be vector of doubles; the function will most likely also work if the column is a vector of integers.

oostringorsymbolBtime

The name of the column in the supplied data frame for the Btime variable. Defaults to "Btime". Btime is the absolute time of an event or censoring, whichever comes first. The column with this name in the data frame can be vector of doubles; the function will most likely also work if the column is a vector of integers.

oostringorsymbolBobserved

The name of the column in the supplied data frame for the Bobserved variable. Defaults to "Bobserved". Bobserved should be TRUE if the event was observed. The column with this name in the data frame can be a logical vector; the function will most likely also work if the column is a vector of integers (i.e., with 1L in place of TRUE and 0L in place of FALSE).

oostringorsymbolCtime

The name of the column in the supplied data frame for the Ctime variable. Defaults to "Ctime". Ctime is the absolute time of an event or censoring, whichever comes first. The column with this name in the data frame can be vector of doubles; the function will most likely also work if the column is a vector of integers.

oostringorsymbolCobserved

The name of the column in the supplied data frame for the Cobserved variable. Defaults to "Cobserved". Cobserved should be TRUE if censoring occurred (and so the event was not observed). The column with this name in the data frame can be a logical vector; the function will most likely also work if the column is a vector of integers (i.e., with 1L in place of TRUE and 0L in place of FALSE).

ooodoublemaxcomboteststatistic

A value for a hypothetical max-combo test statistic that could have been observed (but was not) can be provided to this argument, in which case the p-value for that hypothetical statistic that could have been observed (but was not) is what is provided. If NULL is provided, a p-value for the max-combo test statistic that was actually observed is provided. Defaults to NULL.

Value

A double

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# -------------------------------------------------------------------------------
# Example 1: Usage on a single deterministic dataset in which the drug halves
# the hazard at all times (i.e., a proportional hazards situation)
# -------------------------------------------------------------------------------

oointnparticipants=100L
oointnparticipantsplacebo=oointnparticipants/2L
oointnparticipantsactive=oointnparticipants/2L

oodoublerateplacebo=0.250
oodoublerateactive=0.125

oovecinttreated=c(
  base::rep(0L,length.out=oointnparticipantsplacebo),
  base::rep(1L,length.out=oointnparticipantsactive)
)
oovecdoubletAabsolute=c( #the start time, i.e., when the subject enters the study.
  base::seq(from=0.0,to=2.0,length.out=oointnparticipantsplacebo),
  base::seq(from=0.0,to=2.0,length.out=oointnparticipantsactive)
)
#the duration of time from when the subject enters the study until the subject experiences the event
oovecdoubletAtoB=c(
  stats::qexp(
    base::seq(from=0.0,to=0.98,length.out=oointnparticipantsplacebo),
    rate=oodoublerateplacebo
  ),
  stats::qexp(
    base::seq(from=0.0,to=0.98,length.out=oointnparticipantsactive),
    rate=oodoublerateactive
  )
)
oovecdoubletBabsolute=oovecdoubletAabsolute + oovecdoubletAtoB
#the analysis takes place at absolute time 6.0 months, and no other censoring (e.g., dropout) occurs
oovecdoubletCabsolute=6.0
oovecdoubletminBvsC=base::pmin(oovecdoubletBabsolute,oovecdoubletCabsolute)
oovecboolobservedB=(oovecdoubletBabsolute < oovecdoubletCabsolute)
oovecboolobservedC=(oovecdoubletCabsolute <= oovecdoubletBabsolute)

oodataframe=dplyr::tibble(id=1L:oointnparticipants,
                          treated=oovecinttreated,
                          Atime=oovecdoubletAabsolute,
                          Btime=oovecdoubletminBvsC,
                          Bobserved=oovecboolobservedB,
                          Ctime=oovecdoubletminBvsC,
                          Cobserved=oovecboolobservedC)

#standardized log-rank test statistic
oolistweightingfunctionsJustLogrank=base::list(
  logrank=function(stminus){ base::return(1.0) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustLogrank
) #test statistic 2.92
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustLogrank
) #p-value 0.0017

#standardized weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function,
#which places greater weight on later times
oolistweightingfunctionsJustFlemingHarrington01=base::list(
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington01
) #test statistic 2.83
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington01
) #p-value 0.0023

#standardized weighted log-rank test statistic with Fleming-Harrington 1-0 weighting function,
#which places greater weight on earlier times
oolistweightingfunctionsJustFlemingHarrington10=base::list(
  flemingharrington10=function(stminus){ base::return(stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington10
) #test statistic 2.71
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington10
) #p-value 0.0033

#the max-combo test statistic based on the first two of the above
oolistweightingfunctionsLogrankAndFlemingHarrington01=base::list(
  logrank=function(stminus){ base::return(1.0) },
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsLogrankAndFlemingHarrington01
) #test statistic 2.92, i.e., just the maximum of 2.92 (from the log-rank test statistic) and 2.83
# (from the weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function)
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsLogrankAndFlemingHarrington01
) #p-value 0.0028

#the max-combo test statistic based on the first three of the above
oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10=base::list(
  logrank=function(stminus){ base::return(1.0) },
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) },
  flemingharrington10=function(stminus){ base::return(stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = 
  oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10
) #test statistic 2.92, i.e., just the maximum of 2.92 (from the log-rank test statistic), 2.83
# (from the weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function), and
# 2.71 (from the weighted log-rank test statistic with Fleming-Harrington 1-0 weighting function)
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = 
  oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10
) #p-value 0.0032


# --------------------------------------------------------------------------------------------
# Example 2: Usage on a single deterministic dataset in which the drug delays
# the event by exactly one month for each subject (i.e., an early treatment effect situation)
# --------------------------------------------------------------------------------------------

oointnparticipants=100L
oointnparticipantsplacebo=oointnparticipants/2L
oointnparticipantsactive=oointnparticipants/2L

oodoublerateplacebo=0.250

oovecinttreated=c(
  base::rep(0L,length.out=oointnparticipantsplacebo),
  base::rep(1L,length.out=oointnparticipantsactive)
)
oovecdoubletAabsolute=c( #the start time, i.e., when the subject enters the study.
  base::seq(from=0.0,to=2.0,length.out=oointnparticipantsplacebo),
  base::seq(from=0.0,to=2.0,length.out=oointnparticipantsactive)
)
#the duration of time from when the subject enters the study until the subject experiences the event
oovecdoubletAtoB=c(
  stats::qexp(
    base::seq(from=0.0,to=0.98,length.out=oointnparticipantsplacebo),
    rate=oodoublerateplacebo
  ),
  stats::qexp(
    base::seq(from=0.0,to=0.98,length.out=oointnparticipantsactive),
    rate=oodoublerateplacebo
  ) + 1.0 #note the addition of 1.0 month time to event here for the active arm
)
oovecdoubletBabsolute=oovecdoubletAabsolute + oovecdoubletAtoB
#the analysis takes place at absolute time 6.0 months, and no other censoring (e.g., dropout) occurs
oovecdoubletCabsolute=6.0
oovecdoubletminBvsC=base::pmin(oovecdoubletBabsolute,oovecdoubletCabsolute)
oovecboolobservedB=(oovecdoubletBabsolute < oovecdoubletCabsolute)
oovecboolobservedC=(oovecdoubletCabsolute <= oovecdoubletBabsolute)

oodataframe=dplyr::tibble(id=1L:oointnparticipants,
                          treated=oovecinttreated,
                          Atime=oovecdoubletAabsolute,
                          Btime=oovecdoubletminBvsC,
                          Bobserved=oovecboolobservedB,
                          Ctime=oovecdoubletminBvsC,
                          Cobserved=oovecboolobservedC)

#standardized log-rank test statistic
oolistweightingfunctionsJustLogrank=base::list(
  logrank=function(stminus){ base::return(1.0) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustLogrank
) #test statistic 1.66
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustLogrank
) #p-value 0.05

#standardized weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function,
#which places greater weight on later times
oolistweightingfunctionsJustFlemingHarrington01=base::list(
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington01
) #test statistic 0.53
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington01
) #p-value 0.30

#standardized weighted log-rank test statistic with Fleming-Harrington 1-0 weighting function,
#which places greater weight on earlier times
oolistweightingfunctionsJustFlemingHarrington10=base::list(
  flemingharrington10=function(stminus){ base::return(stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington10
) #test statistic 2.07
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington10
) #p-value 0.02

#the max-combo test statistic based on the first two of the above
oolistweightingfunctionsLogrankAndFlemingHarrington01=base::list(
  logrank=function(stminus){ base::return(1.0) },
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsLogrankAndFlemingHarrington01
) #test statistic 1.66, i.e., just the maximum of 1.66 (from the log-rank test statistic) and 0.53
# (from the weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function)
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsLogrankAndFlemingHarrington01
) #p-value 0.07

#the max-combo test statistic based on the first three of the above
oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10=base::list(
  logrank=function(stminus){ base::return(1.0) },
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) },
  flemingharrington10=function(stminus){ base::return(stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus =
  oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10
) #test statistic 2.07, i.e., just the maximum of 1.66 (from the log-rank test statistic), 0.53
# (from the weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function), and
# 2.07 (from the weighted log-rank test statistic with Fleming-Harrington 1-0 weighting function)
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = 
  oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10
) #p-value 0.03


# -------------------------------------------------------------------------------------------------
# Example 3: Usage on a single deterministic dataset in which subjects in the placebo arm all have
# the event after being on the study for 1.2 months (i.e., a delayed treatment effect situation)
# -------------------------------------------------------------------------------------------------
 
oointnparticipants=100L
oointnparticipantsplacebo=oointnparticipants/2L
oointnparticipantsactive=oointnparticipants/2L

oodoublerateactive=0.250

oovecinttreated=c(
  base::rep(0L,length.out=oointnparticipantsplacebo),
  base::rep(1L,length.out=oointnparticipantsactive)
)
oovecdoubletAabsolute=c( #the start time, i.e., when the subject enters the study.
  base::seq(from=0.0,to=2.0,length.out=oointnparticipantsplacebo),
  base::seq(from=0.0,to=2.0,length.out=oointnparticipantsactive)
)
#the duration of time from when the subject enters the study until the subject experiences the event
oovecdoubletAtoB=c(
  base::ifelse(
    stats::qexp(
      base::seq(from=0.0,to=0.98,length.out=oointnparticipantsplacebo),
      rate=oodoublerateactive
    ) <= 1.2,
    stats::qexp(
      base::seq(from=0.0,to=0.98,length.out=oointnparticipantsplacebo),
      rate=oodoublerateactive
    ),
    1.2
  ),
  stats::qexp(
    base::seq(from=0.0,to=0.98,length.out=oointnparticipantsactive),
    rate=oodoublerateactive
  )
)
oovecdoubletBabsolute=oovecdoubletAabsolute + oovecdoubletAtoB
#the analysis takes place at absolute time 6.0 months, and no other censoring (e.g., dropout) occurs
oovecdoubletCabsolute=6.0
oovecdoubletminBvsC=base::pmin(oovecdoubletBabsolute,oovecdoubletCabsolute)
oovecboolobservedB=(oovecdoubletBabsolute < oovecdoubletCabsolute)
oovecboolobservedC=(oovecdoubletCabsolute <= oovecdoubletBabsolute)

oodataframe=dplyr::tibble(id=1L:oointnparticipants,
                          treated=oovecinttreated,
                          Atime=oovecdoubletAabsolute,
                          Btime=oovecdoubletminBvsC,
                          Bobserved=oovecboolobservedB,
                          Ctime=oovecdoubletminBvsC,
                          Cobserved=oovecboolobservedC)

#standardized log-rank test statistic
oolistweightingfunctionsJustLogrank=base::list(
  logrank=function(stminus){ base::return(1.0) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustLogrank
) #test statistic 1.55
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustLogrank
) #p-value 0.06

#standardized weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function,
#which places greater weight on later times
oolistweightingfunctionsJustFlemingHarrington01=base::list(
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington01
) #test statistic 2.28
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington01
) #p-value 0.01

#standardized weighted log-rank test statistic with Fleming-Harrington 1-0 weighting function,
#which places greater weight on earlier times
oolistweightingfunctionsJustFlemingHarrington10=base::list(
  flemingharrington10=function(stminus){ base::return(stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington10
) #test statistic 1.35
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsJustFlemingHarrington10
) #p-value 0.09

#the max-combo test statistic based on the first two of the above
oolistweightingfunctionsLogrankAndFlemingHarrington01=base::list(
  logrank=function(stminus){ base::return(1.0) },
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsLogrankAndFlemingHarrington01
) #test statistic 2.28, i.e., just the maximum of 1.55 (from the log-rank test statistic) and 2.28
# (from the weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function)
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = oolistweightingfunctionsLogrankAndFlemingHarrington01
) #p-value 0.02

#the max-combo test statistic based on the first three of the above
oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10=base::list(
  logrank=function(stminus){ base::return(1.0) },
  flemingharrington01=function(stminus){ base::return(1.0 - stminus) },
  flemingharrington10=function(stminus){ base::return(stminus) }
)
maxcombo::oogetdoublemaxcomboteststatistic(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus =
  oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10
) #test statistic 2.28, i.e., just the maximum of 1.55 (from the log-rank test statistic), 2.28
# (from the weighted log-rank test statistic with Fleming-Harrington 0-1 weighting function), and
# 1.35 (from the weighted log-rank test statistic with Fleming-Harrington 1-0 weighting function)
maxcombo::oogetdoublemaxcombotestpvalue(
  oodataframe = oodataframe,
  oolistfunctionweightasafunctionofstminus = 
  oolistweightingfunctionsLogrankAndFlemingHarrington01AndFlemingHarrington10
) #p-value 0.02

maxcombo documentation built on Dec. 15, 2020, 5:29 p.m.