redrank {mstate} | R Documentation |
This function estimates regression coefficients in reduced rank proportional hazards models for competing risks and multi-state models.
redrank(data, covariates, fullcovs = NULL, R, clock = c("forward","reset"), strata = NULL, Gamma.start, eps = 1e-5, print.level = 1)
data |
Object of class 'msdata', as prepared for instance by
msprep |
covariates |
Character vector containing the column names of covariates for which a reduced rank estimate is to be found |
fullcovs |
Character vector containing the column names of covariates which need to be retained in the model |
R |
Numeric, indicating the rank of the solution |
clock |
One of "forward" (default) or "reset" ,
indicating whether the clock is forward or reset, see for instance
Putter, Fiocco & Geskus (2007) |
strata |
Name of covariate to be used inside the
strata part of
coxph |
Gamma.start |
A matrix of dimension K x R, with K the number of transitions and R the rank, to be used as starting value |
eps |
Numeric value determining when the iterative algorithm
is finished (when for two subsequent iterations the difference in
log-likelihood is smaller than eps ) |
print.level |
Determines how much output is written to the screen; 0: no output, 1: iterations, for each iteration solutions of Alpha, Gamma, log-likelihood, 2: also the Cox regression results |
For details refer to Fiocco, Putter & van Houwelingen (2005, 2008).
A list with elements
Alpha |
the Alpha matrix |
Gamma |
the Gamma matrix |
Beta |
the Beta matrix corresponding to covariates |
Beta2 |
the Beta matrix corresponding to fullcovs |
cox.itr1 |
the coxph object
resulting from the last call giving Alpha |
alphaX |
the matrix of prognostic scores given by
Alpha , n x R, with n number of subjects |
niter |
the number of iterations needed to reach convergence |
df |
the number of regression parameters estimated |
loglik |
the log-likelihood |
Marta Fiocco and Hein Putter H.Putter@lumc.nl
Fiocco M, Putter H, van Houwelingen JC (2005). Reduced rank proportional hazards model for competing risks. Biostatistics 6, 465–478.
Fiocco M, Putter H, van Houwelingen HC (2008). Reduced-rank proportional hazards regression and simulation-based prediction for multi-state models. Statistics in Medicine 27, 4340–4358.
Putter H, Fiocco M, Geskus RB (2007). Tutorial in biostatistics: Competing risks and multi-state models. Statistics in Medicine 26, 2389–2430.
# Based on Fiocco, Putter & van Houwelingen (2005) data(ebmt2) # transition matrix for competing risks tmat <- trans.comprisk(6,names=c("Relapse","GvHD","Bacterial","Viral","Fungal","Other")) # preparing long dataset ebmt2$stat1 <- as.numeric(ebmt2$status==1) ebmt2$stat2 <- as.numeric(ebmt2$status==2) ebmt2$stat3 <- as.numeric(ebmt2$status==3) ebmt2$stat4 <- as.numeric(ebmt2$status==4) ebmt2$stat5 <- as.numeric(ebmt2$status==5) ebmt2$stat6 <- as.numeric(ebmt2$status==6) covs <- c("dissub","match","tcd","year","age") ebmtlong <- msprep(time=c(NA,rep("time",6)), stat=c(NA,paste("stat",1:6,sep="")), data=ebmt2,keep=covs,trans=tmat) # Get model matrix cx <- coxph(Surv(Tstart,Tstop,status) ~ dissub+match+tcd+year+age, data=ebmtlong, method="breslow") mm <- model.matrix(cx)[,-1] # without intercept mm <- data.frame(mm) ebmtlong <- cbind(ebmtlong,mm) # Somehow, cbind makes ebmtlong lose its "trans" attribute and "msdata" class attr(ebmtlong, "trans") <- tmat class(ebmtlong) <- c("msdata","data.frame") covs <- names(mm) # Actually run for a subset of the actual data ebmtlongsub <- ebmtlong[1:1200,] # first 200 patients # The reduced rank 2 solution rr2 <- redrank(data=ebmtlongsub, covariates=covs, R=2, eps=0.001) rr2$Alpha; rr2$Gamma; rr2$Beta; rr2$loglik # This reproduces the results in Fiocco, Putter & van Houwelingen (2005) # Takes a while to run ## Not run: # The reduced rank 3 solution rr3 <- redrank(data=ebmtlong, covariates=covs, R=3) rr3$Alpha; rr3$Gamma; rr3$Beta; rr3$loglik # The full rank solution fullrank <- redrank(data=ebmtlong, covariates=covs, R=6) fullrank$Beta; fullrank$loglik ## End(Not run)