Description Usage Arguments Details Value Author(s) References Examples
This function allows to estimate a cumulative incidence function (CIF) from an horizontal mixture model with two competing events, i.e. the results obtained from the function mm2
.
1 |
model |
A list obtained by using the function |
event |
A numeric value for identifying the event for which the CIF has to be computed. Two possible values are allowed: 2 (for the CIF related to X=2) and 3 (for the CIF related to X=3). |
times |
A numeric vector with positive values related to the times for which the CIF has to be computed. |
cov.12 |
A vector, matrix or data frame in which to look for variables related to the time from X=1 to X=2 with which to predict the CIF. |
cov.13 |
A vector, matrix or data frame in which to look for variables related to the time from X=1 to X=3 with which to predict the CIF. |
cov.p |
A vector, matrix or data frame in which to look for variables related to the probability P(X=2). |
The covariates has to be identical than the ones included in the mixture model declared in the argument model
. More precisely, the columns of cov.12
, cov.13
and cov.p
must correspond to the same variables.
times |
A numeric vector with the times for which the CIF has to be computed. |
cif |
A matrix with the predicted CIF for the |
Yohann Foucher <Yohann.Foucher@univ-nantes.fr>
Trebern-Launay K, KesslerM, Bayat-Makoei S, Querard AH, Briancon S, Giral M, Foucher Y. Horizontal mixture model for competing risks: a method to obtain easily interpretable results by both physicians and patients-illustration for waitlisted renal transplant candidates in a perspective of patient-centered decision making. Manuscript submitted. 2017.
Austin PC. An Introduction to Propensity Score Methods for Reducing the Effects of Confounding in Observational Studies. Multivariate Behav Res May 2011; 46(3): 399-424. <DOI: 10.1080/ 00273171.2011.568786>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | # import the observed data
# X=1 corresponds to initial state with a functioning graft,
# X=2 to acute rejection episode (transient state),
# X=3 to return to dialysis, X=4 to death with a functioning graft
data(dataDIVAT)
dim(dataDIVAT)
# A subgroup analysis to reduce the time needed for this example
dataDIVAT$id<-c(1:nrow(dataDIVAT))
set.seed(2)
d2<-dataDIVAT[dataDIVAT$id %in% sample(dataDIVAT$id, 300, replace = FALSE),]
# Data-management: two competing events
# the patient death is now X=2
# the return in dialysis is now X=3
d2$time<-NA
d2$time[d2$trajectory==1]<-d2$time1[d2$trajectory==1]
d2$time[d2$trajectory==12]<-d2$time2[d2$trajectory==12]
d2$trajectory[d2$trajectory==12]<-1
d2$time[d2$trajectory==13]<-d2$time1[d2$trajectory==13]
d2$time[d2$trajectory==123]<-d2$time2[d2$trajectory==123]
d2$trajectory[d2$trajectory==123]<-13
d2$time[d2$trajectory==14]<-d2$time1[d2$trajectory==14]
d2$time[d2$trajectory==124]<-d2$time2[d2$trajectory==124]
d2$trajectory[d2$trajectory==124]<-14
d2$trajectory[d2$trajectory==14]<-12
table(d2$trajectory)
# Univariable horizontal mixture model one binary explicative variable
# z is 1 if delayed graft function and 0 otherwise
mm2.model <- mm2(t=d2$time, sequence=d2$trajectory, weights=NULL,
dist=c("E","W"), cuts.12=NULL, cuts.13=NULL,
ini.dist.12=c(9.28), ini.dist.13=c(9.92, -0.23),
cov.12=d2$z, init.cov.12=0.84, names.12="beta_12",
cov.13=d2$z, init.cov.13=0.76, names.13="beta_13",
cov.p=NULL, init.cov.p=NULL, names.p=NULL, init.intercept.p=-0.75,
conf.int=TRUE, silent=FALSE)
cif2.mm2 <- pred.mm2(mm2.model, event=2, times=seq(0, 4000, by=30),
cov.12=c(0,1), cov.13=c(0,1), cov.p=NULL)
plot(cif2.mm2$times/365.25, cif2.mm2$cif[1,], col = 1, type="l", lty = 1,
ylim=c(0,1), lwd =2, ylab="Cumulative Incidence Function",
xlab="Times (years)", main="", xlim=c(0, 11), legend=FALSE)
lines(cif2.mm2$times/365.25, cif2.mm2$cif[2,], lwd=2, col=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.