concrete-package | R Documentation |
Implements the methodology described in Rytgaard et al. (2023) <doi:10.1111/biom.13856> and Rytgaard and van der Laan (2023) <doi:10.1007/s10985-022-09576-2>. Currently can be used to estimate the effects of static or dynamic interventions on binary treatments given at baseline, cross-validated initial estimation of treatment propensity is done using the 'SuperLearner' package, and initial estimation of conditional hazards is done using ensembles of Cox regressions from the 'survival' package or Coxnet from the 'glmnet' package.
formatArguments() many check...(), format...() functions getInitialEstimates() getPropScores() getHazEstimates() getEIC() getIC() doTMLEUpdate() getOutput()
David Chen, <david.chen49@berkeley.edu> Maintainer: David Chen <david.chen49@berkeley.edu>
Rytgaard et al. (2023) <doi:10.1111/biom.13856> Rytgaard and van der Laan (2023) <doi:10.1007/s10985-022-09576-2>
SuperLearner coxph glmnet
library(concrete)
library(data.table)
set.seed(12345)
data <- as.data.table(survival::pbc)
data <- data[!is.na(trt), ][, trt := trt - 1]
data <- data[, c("time", "status", "trt", "age", "sex", "albumin")]
ConcreteArgs <- formatArguments(DataTable = data,
EventTime = "time",
EventType = "status",
Treatment = "trt",
Intervention = 0:1,
TargetTime = 1500,
TargetEvent = 1:2,
MaxUpdateIter = 250,
CVArg = list(V = 10),
Verbose = FALSE)
ConcreteEst <- doConcrete(ConcreteArgs)
ConcreteOut <- getOutput(ConcreteEst)
## Joint Intervention
data <- data[, trt2 := sample(0:1, .N, replace = TRUE, prob = c(0.3, .7))]
Intervention <- makeITT("A1" = data.frame(trt = rep_len(1, nrow(data)),
trt2 = rep_len(1, nrow(data))),
"A0" = data.frame(trt = rep_len(0, nrow(data)),
trt2 = rep_len(0, nrow(data))))
ConcreteArgs <- formatArguments(DataTable = data,
EventTime = "time",
EventType = "status",
Treatment = c("trt", "trt2"),
Intervention = Intervention,
TargetTime = 2000,
TargetEvent = 1:2,
MaxUpdateIter = 250,
CVArg = list(V = 10),
Verbose = FALSE)
ConcreteEst <- doConcrete(ConcreteArgs)
ConcreteOut <- getOutput(ConcreteEst)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.