summary.cmprsk {causalCmprsk} | R Documentation |
Summary of Event-specific Cumulative Hazards, Cumulative Incidence Functions and Various Treatment Effects
Description
Returns an object of class data.frame
containing the summary extracted from the cmprsk
object.
Usage
## S3 method for class 'cmprsk'
summary(object, event, estimand = "CIF", ...)
Arguments
object |
an object of class |
event |
an integer number (a code) of an event of interest |
estimand |
a character string naming the type of estimand to extract from |
... |
This is not currently used, included for future methods. |
Value
summary.cmprsk
returns a data.frame
object with 7 or 6 columns:
the time vector, an indicator of the treatment arm
(if the requested estimand
is one of c("logHR", "RD", "RR", "ATE.RMT"), this column is omitted),
an indicator of the type of event,
the point estimate for the requested estimand
, the lower and upper bounds of the
confidence interval (for conf.level
% of the confidence level),
and the standard error of the point estimate. For example, if estimand="CIF"
,
the returned data.frame
will include the following columns:
time
, TRT
, Event
, CIF
, CIL.CIF
, CIU.CIF
, SE.CIF
.
References
M.-L. Charpignon, B. Vakulenko-Lagun, B. Zheng, C. Magdamo, B. Su, K.E. Evans, S. Rodriguez, et al. 2022. Causal inference in medical records and complementary systems pharmacology for metformin drug repurposing towards dementia. Nature Communications 13:7652.
See Also
fit.cox
, fit.nonpar
, causalCmprsk
Examples
# create a data set
n <- 1000
set.seed(7)
c1 <- runif(n)
c2 <- as.numeric(runif(n)< 0.2)
set.seed(77)
cf.m.T1 <- rweibull(n, shape=1, scale=exp(-(-1 + 2*c1)))
cf.m.T2 <- rweibull(n, shape=1, scale=exp(-(1 + 1*c2)))
cf.m.T <- pmin( cf.m.T1, cf.m.T2)
cf.m.E <- rep(0, n)
cf.m.E[cf.m.T1<=cf.m.T2] <- 1
cf.m.E[cf.m.T2<cf.m.T1] <- 2
set.seed(77)
cf.s.T1 <- rweibull(n, shape=1, scale=exp(-1*c1 ))
cf.s.T2 <- rweibull(n, shape=1, scale=exp(-2*c2))
cf.s.T <- pmin( cf.s.T1, cf.s.T2)
cf.s.E <- rep(0, n)
cf.s.E[cf.s.T1<=cf.s.T2] <- 1
cf.s.E[cf.s.T2<cf.s.T1] <- 2
exp.z <- exp(0.5 + c1 - c2)
pr <- exp.z/(1+exp.z)
TRT <- ifelse( runif(n)< pr, 1, 0)
X <- ifelse(TRT==1, cf.m.T, cf.s.T)
E <- ifelse(TRT==1, cf.m.E, cf.s.E)
covs.names <- c("c1", "c2")
data <- data.frame(X=X, E=E, TRT=TRT, c1=c1, c2=c2)
# Nonparametric estimation:
form.txt <- paste0("TRT", " ~ ", paste0(c("c1", "c2"), collapse = "+"))
trt.formula <- as.formula(form.txt)
res.ATE <- fit.nonpar(df=data, X="X", E="E", trt.formula=trt.formula, wtype="stab.ATE")
# summarizing results on the Risk Difference for event=2
fit.summary <- summary(object=res.ATE, event = 2, estimand="RD")
head(fit.summary)
# summarizing results on the CIFs for event=1
fit.summary <- summary(object=res.ATE, event = 1, estimand="CIF")
head(fit.summary)