TM: Tayob and Murray two-sample recurrent events test

Description Usage Arguments Value Author(s) References Examples

View source: R/TM.R

Description

Perform the Tayob and Murray two-sample recurrent events test described in Tayob, N. and Murray, S., 2014. Nonparametric tests of treatment effect based on combined endpoints for mortality and recurrent events. Biostatistics, 16(1), pp.73-83.

Usage

1
TM(X, delta, Z, Group, Tau, t, method = "average")

Arguments

X

vector containing observed time to terminating event

delta

vector that is 1 if terminating event is observed and 0 if patient is censored

Z

array of times to recurrent events. Number of columns corresponds to maximum number of recurrent events observed for a patient

Group

vector indicating which group each patient belongs to

Tau

upper limit of integration (cannot be greater than largest follow-up time, cannot be negative)

t

vector containing start times of follow-up windows chosen

method

Choose "average" for mean difference test or "area" for area between the RMRL curves

Value

A list object which contains

Author(s)

Nabihah Tayob

References

Tayob, N. and Murray, S., 2014. Nonparametric tests of treatment effect based on combined endpoints for mortality and recurrent events. Biostatistics, 16(1), pp.73-83.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data("TMdata")
head(TMdata)

N=nrow(TMdata) #Number of subjects
X=TMdata$X
delta=TMdata$delta
table(delta)
Z=array(cbind(TMdata$Z1,TMdata$Z2,TMdata$Z3,TMdata$Z4,TMdata$Z5,TMdata$Z6),c(N,6))
A=max(X) #length of study
Treatment=as.numeric(TMdata$Group==1) #1 if Case and 0 if Control
table(Treatment,delta)

srec.average = TM(X = X, delta = delta, Z = Z, Group = Treatment, Tau = A/2, 
                  t = seq(from = 0, to = A-A/2, by = A/4))
summary(srec.average)

srec.area = TM(X = X, delta = delta, Z = Z, Group = Treatment, Tau = A/2, 
               t = seq(from = 0, to = A-A/2, by = A/4), method = "area")
summary(srec.area)
plot(srec.area)

umich-biostatistics/corrsurv documentation built on Jan. 11, 2020, 2:03 a.m.