Learn R Programming

RISCA (version 1.0.1)

hr.sl.time: Conditionnal Effect for Censored Outcome with a Super Learner for the Outcome Model.

Description

This function allows to estimate the conditional (subject-specific) effect of an exposure or a treatment for a censored times-to-event by using a Super Learner (SL).

Usage

hr.sl.time(object, pro.time, iterations, n.cluster, cluster.type, conda.env)

Value

logHR.conditional.values

A vector with the estimated individual HRs.

logHR.conditional

A table related to the logarithm of the conditional HR: estimate is the estimated value, std.error is the corresponding standard error, ci.lower and ci.upper represent the 95% confidence interval, and p.value is the p-value of the bilateral test of the null hypothesis HR = 1.

Arguments

object

An object returned by the function sl.time. It shall be included the exposition/treatment of interest in the argument group of the sl.time function.

pro.time

The maximum time of follow-up to estimate of restricted mean survival time (RMST). The default value is NULL, which corresponds to object$pro.time if this argument is not NULL, or the time at which half of the sample is still at-risk otherwise.

iterations

The number of bootstrap resamples to estimate of the variances and the confidence intervals.

n.cluster

The number of cores to use, i.e., the upper limit for the number of child processes that run simultaneously (1 by default).

cluster.type

A character string with the type of parallelization. The default type is "PSOCK" (it calls makePSOCKcluster, faster on MacOS or Linux platforms). An alternative is "FORK" (it calls makeForkCluster, it does not work on Windows platforms).

conda.env

The name of the Conda environment to use if Python is used via reticulate. The default is NULL, which corresponds th the default environment by default located at ~/.virtualenvs.

Author

Yohann Foucher <Yohann.Foucher@univ-nantes.fr>

Details

The conditional effect is estimated by a conditional hazard ratio (HR), which corresponds to average of the individual HR on the studied population, i.e. the subject-specific effect if the individual is treated (group = 1) versus untreated (group = 0).

References

Foucher et al. Manuscript in progress. 2021.

Examples

Run this code

data(dataDIVAT2)

#The outcome model base on a Super Learner from the first 150 individuals
sl1<-sl.time(  methods=c("aft.gamma", "ph.gompertz"),  metric="bs",
  data=dataDIVAT2[1:150,],  times="times", failures="failures",  group="ecd",
  cov.quanti=c("age"),  cov.quali=c("hla", "retransplant"),  cv=3)

#Set the prognostic time, for instance:
pro.time <- min(c(
  max(dataDIVAT2$times[dataDIVAT2$ecd==0]),
  max(dataDIVAT2$times[dataDIVAT2$ecd==1]) ))

#Conditional effect of the ECD by using a SL: use 1000 iterations instead of 2
hr.sl <- hr.sl.time(sl1, pro.time=pro.time, iterations=2, n.cluster=1)

#Conditional effect of the ECD by using a Cox model
cox.cdt <- coxph(Surv(times,failures) ~ ecd + age + retransplant,
  data=dataDIVAT2)

data.frame( rbind(
summary(cox.cdt)$coef[1,c(1,2,5)],
hr.sl$logHR.conditional[,c(1,2,5)] ))

Run the code above in your browser using DataLab