ipcwswitch (version 1.0.3)

SHIdat: A real example dataset from the randomized clinical trial SHIVA

Description

Dataset SHIdat contains an anonymized excerpt of data from the SHIVA01 trial. This was the first randomized cli,ical trial that aimed at comparing molecularly targeted therapy based on tumour profiling (MTA) versus conventiona therapy (CT) for advanced cancer. A switch to the other arm was scheduled to be proposed at disease progression for patients in both treatment groups.

Usage

data("SHIdat")

Arguments

Format

A data frame with 197 observations on the following 306 variables.

id

a numeric vector corresponding to the patient's identifier

bras.f

a vector containing the patient's randomized arm

agerand

a numeric vector containing patient's age (in years) at randomization

sex.f

a vector containing the patient's gender

tt_Lnum

a numeric vector containing the number of previous lines of treatment

rmh_alea.c

a numeric vector containing the Royal Marsden Hospital score segregated into two categories

pathway.f

a vector the molecular pathway altered (pathway.f: the hormone receptors pathway, the PI3K/ AKT/mTOR pathway, and the RAF/MEK pathway)

myps.v2,ps.v3,ps1.v1,ps1.v2,ps1.v3,ps1.v4,ps1.v5,ps1.v6,ps1.v7,ps1.v8,ps1.v9,ps1.v10,ps1.v11,ps1.v12, ps1.v13,ps1.v14,ps1.v15,ps1.v16,ps1.v17,ps1.v18,ps1.v19,ps1.v20, ps1.v21

numeric vectors containing the ECOG performance status measured at the randomization visit, the visit before the potential switch and the planned visits (maximum number of planned visits: 21)

mytran.v1,tran.v2,tran.v3,tran.v4,tran.v5,tran.v6,tran.v7,tran.v8,tran.v9,tran.v10,tran.v11,tran.v12, tran.v13,tran.v14,tran.v15,tran.v16,tran.v17,tran.v18,tran.v19,tran.v20,tran.v21

numeric vectors containing the use of platelet transfusions at each of the potential 21 planned visits

myttc.v2,ttc.v3,ttc1.v1,ttc1.v2,ttc1.v3,ttc1.v4,ttc1.v5,ttc1.v6,ttc1.v7,ttc1.v8,ttc1.v9,ttc1.v10, ttc1.v11,ttc1.v12,ttc1.v13,ttc1.v14,ttc1.v15,ttc1.v16,ttc1.v17,ttc1.v18,ttc1.v19,ttc1.v20, ttc1.v21

numeric vectors containing the presence of concomitant treatments at the randomization visit, the visit before the potential switch and the planned visits (maximum number of planned visits: 21)

tox.t1,tox.t2,tox.t3,tox.t4,tox.t5,tox.t6,tox.t7,tox.t8,tox.t9,tox.t10,tox.t11,tox.t12,tox.t13,tox.t14, tox.t15,tox.t16,tox.t17,tox.t18,tox.t19,tox.t20,tox.t21,tox.t22,tox.t23,tox.t24,tox.t25,tox.t26, tox.t27,tox.t28,tox.t29,tox.t30,tox.t31,tox.t32,tox.t33,tox.t34,tox.t35,tox.t36,tox.t37,tox.t38, tox.t39,tox.t40,tox.t41,tox.t42,tox.t43,tox.t44,tox.t45,tox.t46,tox.t47,tox.t48,tox.t49,tox.t50, tox.t51,tox.t52,tox.t53,tox.t54,tox.t55,tox.t56,tox.t57,tox.t58,tox.t59,tox.t60,tox.t61,tox.t62, tox.t63,tox.t64,tox.t65,tox.t66,tox.t67,tox.t68,tox.t69,tox.t70,tox.t71,tox.t72,tox.t73,tox.t74, tox.t75,tox.t76,tox.t77,tox.t78,tox.t79,tox.t80,tox.t81,tox.t82,tox.t83,tox.t84,tox.t85,tox.t86, tox.t87,tox.t88,tox.t89,tox.t90,tox.t91,tox.t92,tox.t93,tox.t94,tox.t95,tox.t96,tox.t97,tox.t98, tox.t99, tox.t100

numeric vectors corresponding to the presence of an adveerse event. tox.ti contains 1 if the patient started an adverse event linked with the treatment at datetox.ti, 0 if the patient ended an adverse event linked with the treatment at datetox.ti, and NA otherwise

ddn

a vector containing the date of latest news

debttCO

a vector containing the date of initiation of the other arm treatment

ddeath

a vector containg the death date

ddt.v1

a vector containing the date of initiation of the randomized treatment

datt

a vector containing the date of the interruption of the randomized treatment

dexac.v2

a vector containing the date of randomization

dexac.v3

a vector containing the date of the visit before the potential switch

dexac1.v1,dexac1.v2,dexac1.v3,dexac1.v4,dexac1.v5,dexac1.v6,dexac1.v7,dexac1.v8,dexac1.v9, dexac1.v10,dexac1.v11,dexac1.v12,dexac1.v13,dexac1.v14,dexac1.v15,dexac1.v16,dexac1.v17, dexac1.v18,dexac1.v19,dexac1.v20, dexac1.v21

vectors containing the dates of the potential 21 planned visits

datetox.t1,datetox.t2,datetox.t3,datetox.t4,datetox.t5,datetox.t6,datetox.t7,datetox.t8, datetox.t9,datetox.t10,datetox.t11,datetox.t12,datetox.t13,datetox.t14,datetox.t15, datetox.t16,datetox.t17,datetox.t18,datetox.t19,datetox.t20,datetox.t21,datetox.t22, datetox.t23,datetox.t24,datetox.t25,datetox.t26,datetox.t27,datetox.t28,datetox.t29, datetox.t30,datetox.t31,datetox.t32,datetox.t33,datetox.t34,datetox.t35,datetox.t36, datetox.t37,datetox.t38,datetox.t39,datetox.t40,datetox.t41,datetox.t42,datetox.t43, datetox.t44,datetox.t45,datetox.t46,datetox.t47,datetox.t48,datetox.t49,datetox.t50, datetox.t51,datetox.t52,datetox.t53,datetox.t54,datetox.t55,datetox.t56,datetox.t57, datetox.t58,datetox.t59,datetox.t60,datetox.t61,datetox.t62,datetox.t63,datetox.t64, datetox.t65,datetox.t66,datetox.t67,datetox.t68,datetox.t69,datetox.t70,datetox.t71, datetox.t72,datetox.t73,datetox.t74,datetox.t75,datetox.t76,datetox.t77,datetox.t78, datetox.t79,datetox.t80,datetox.t81,datetox.t82,datetox.t83,datetox.t84,datetox.t85, datetox.t86,datetox.t87,datetox.t88,datetox.t89,datetox.t90,datetox.t91,datetox.t92, datetox.t93,datetox.t94,datetox.t95,datetox.t96,datetox.t97,datetox.t98, datetox.t99, datetox.t100

vectors containing the dates related to adverse events (as explained above)

CO

a vector containing 1 if the patient changed treatment arm (i.e., did a switch)

progDate

a vector containing the date of a potential progression

progStatus

a vector containing 1 if the patient did a progression (and 0 otherwise)

status

a vector containing the patient's status at the date of latest news (1 if died, 0 otherwise)

Details

Note that some variables were built from the original data for illustration purpose. We provided an excerpt containing only the covariates that are useful for our analysis. Note also that the SHIVA data were anonymized.

Acknowledgments: we thank the patients who volunteered to participate in this study for their dedication and the study-site staff who cared for them. This work is supported by grant ANR-10-EQPX-03 from the Agence Nationale de la Recherche (Investissements d'avenir) and Site de Recherche Integre contre le Cancer (SiRIC). High-throughput sequencing was done by the NGS platform of the Institut Curie, supported by grants ANR-10-EQPX-03 and ANR-10-INBS-09-08 from the Agence Nationale de la Recherche (Investissements d'avenir) and the Canceropole Ile-de-France.

References

Le Tourneau, C., Delord, J. P., Goncalves, A., et al. (2015). "Molecularly targeted therapy based on tumour molecular profiling versus conventional therapy for advanced cancer (SHIVA): a multicentre, open-label, proof-of-concept, randomised, controlled phase 2 trial". The Lancet Oncology, 16(13), 1324-1334. doi : "10.1016/S1470-2045(15)00188-6"

Graffeo, N., Latouche, A., Le Tourneau C., Chevret, S. "An R Package for IPCW: Application to switches in clinical trials" (submitted)

See Also

cens.ipw, ipcw, replicRows, timesTokeep, wideToLongTDC

Examples

Run this code
# NOT RUN {
# To obtain the times parameter, we can apply the timesTokeep function on the same
# dataframe in the wide format
# names of the repeated measurements
vect.ps   <- c("myps.v2", "ps.v3", c(paste("ps1.v", seq(1,21), sep="")))
vect.ttc  <- c("myttc.v2", "ttc.v3", c(paste("ttc1.v", seq(1,21), sep="")))
vect.tran <- c("mytran.v1", paste("tran.v", seq(2,21), sep=""))
# corresponding dates
dates <- c("dexac.v2", "dexac.v3", c(paste("dexac1.v", seq(21), sep="")))
dates2 <- dates[!(dates %in% c("dexac.v2","dexac.v3"))]

# times to keep
kept.t <- timesTokeep(SHIdat, id = "id",
                      tstart = "dexac.v2", tstop = "ddn",
                      mes.cov = list(vect.ps, vect.ttc, vect.tran),
                      time.cov = list(dates, dates, dates2))
# Now, we can build the long format
SHIlong <- wideToLongTDC(SHIdat, id = "id",
                         tstart = "dexac.v2", tstop = "ddn",
                         event = "status",
                         bas.cov = c("agerand", "sex.f","tt_Lnum", "rmh_alea.c", "pathway.f",
                         "bras.f","debttCO","ddt.v1", "datt"),
                         mes.cov = list(f1=vect.ps, f2=vect.ttc, f3=vect.tran),
                         time.cov = list(dates, dates, dates2),
                         times = kept.t[[1]])

# Put dates in numeric format with tstart at 0
tabi <- split(SHIlong, SHIlong$id)
L.tabi   <- length(tabi)
tablist <- lapply(1:L.tabi, function(i){
  refstart <- tabi[[i]]$tstart[1]

  tabi[[i]]$tstart  <- tabi[[i]]$tstart - refstart
  tabi[[i]]$tstop <- tabi[[i]]$tstop - refstart
  tabi[[i]]$debttCO <- tabi[[i]]$debttCO - refstart # to be used in next step
  tabi[[i]]$ddt.v1 <- tabi[[i]]$ddt.v1 - refstart # to be used in the final step
  tabi[[i]]$datt <- tabi[[i]]$datt - refstart # to be used in the final step

  return(tabi[[i]])
})
SHIlong <- do.call( rbind, tablist )
colnames(SHIlong)[14:16] <- c("ps", "ttc", "tran")

# Eliminating patient not having initiated the treatment arm
SHIlong2 <- SHIlong[!is.na(SHIlong$ddt.v1),]

# Patients are censored when initiating the other arm treatment, that is, at time swtrtdt
SHIlong2 <- cens.ipw(SHIlong2, id = "id", tstart = "tstart", tstop  = "tstop",
                     event = "event", arm = "bras.f", realtrt = FALSE,
                     censTime ="debttCO")
# We collect all event times 
# (death for both arms and treatment censoring according to the trt arm)
replic.times.MTA <-
    unique(c(SHIlong2$tstop[SHIlong2$cens == 1 &
    SHIlong2$bras.f == "MTA"],
    SHIlong2$tstop[SHIlong2$event == 1]))
replic.times.CT <-
    unique(c(SHIlong2$tstop[SHIlong2$cens == 1 &
    SHIlong2$bras.f == "CT"],
    SHIlong2$tstop[SHIlong2$event == 1]))
# to put times in same order as arms levels
levels(SHIlong2[,"bras.f"])
SHIrep  <- replicRows(SHIlong2, tstart = "tstart", tstop = "tstop",
                      event = "event", cens = "cens", 
                      times1 = replic.times.MTA, times2=replic.times.CT, 
                      arm = "bras.f")

# Estimation of the stabilized weights
library(survival)
SHIres <- ipcw(SHIrep, id = "id", tstart = tstart, tstop = tstop, cens = cens,
               arm = "bras.f", 
               bas.cov = c("agerand", "sex.f", "tt_Lnum", "rmh_alea.c", "pathway.f"),
               conf = c("ps", "ttc", "tran"),
               trunc = 0.05, type = 'kaplan-meier')

# To have conventional therapy (CT) as reference
SHIres$bras.f <- relevel(SHIres$bras.f, ref="CT")

# Using the IPCW weights in Cox likelihood...
fit.stab.w <- coxph(Surv(tstart, tstop, event) ~ bras.f + agerand + sex.f +
                        tt_Lnum + rmh_alea.c + pathway.f
                      + cluster(id),
                      data = SHIres, weights = SHIres$weights.trunc)
fit.stab.w

# }

Run the code above in your browser using DataCamp Workspace