
Last chance! 50% off unlimited learning
Sale ends in
Make predictions based on the survival models (Aalen and Cox-Aalen) and the competing risks models for the cumulative incidence function (comp.risk). Computes confidence intervals and confidence bands based on resampling.
# S3 method for timereg
predict(
object,
newdata = NULL,
X = NULL,
times = NULL,
Z = NULL,
n.sim = 500,
uniform = TRUE,
se = TRUE,
alpha = 0.05,
resample.iid = 0,
...
)
an object belonging to one of the following classes: comprisk, aalen or cox.aalen
specifies the data at which the predictions are wanted.
alternative to newdata, specifies the nonparametric components for predictions.
times in which predictions are computed, default is all time-points for baseline
alternative to newdata, specifies the parametric components of the model for predictions.
number of simulations in resampling.
computes resampling based uniform confidence bands.
computes pointwise standard errors
specificies the significance levelwhich cause we consider.
set to 1 to return iid decomposition of estimates, 3-dim matrix (predictions x times x subjects)
unused arguments - for S3 compatability
vector of time points where the predictions are computed.
resampling based constant to construct 95% uniform confidence bands.
specifies what model that was fitted.
specifies the significance level for the confidence intervals. This relates directly to the constant given in unif.band.
specifies the newdata given in the call.
gives relative risk terms for Cox-type models.
gives call for predict funtion.
gives call for underlying object used for predictions.
gives cumulative inicidence predictions for competing risks models. Predictions given in matrix form with different subjects in different rows.
gives survival predictions for survival models. Predictions given in matrix form with different subjects in different rows.
pointwise standard errors for predictions of P1.
pointwise standard errors for predictions of S0.
Scheike, Zhang and Gerds (2008), Predicting cumulative incidence probability by direct binomial regression, Biometrika, 95, 205-220.
Scheike and Zhang (2007), Flexible competing risks regression modelling and goodness of fit, LIDA, 14, 464-483 .
Martinussen and Scheike (2006), Dynamic regression models for survival data, Springer.
# NOT RUN {
data(bmt);
## competing risks
add<-comp.risk(Event(time,cause)~platelet+age+tcell,data=bmt,cause=1)
ndata<-data.frame(platelet=c(1,0,0),age=c(0,1,0),tcell=c(0,0,1))
out<-predict(add,newdata=ndata,uniform=1,n.sim=1000)
par(mfrow=c(2,2))
plot(out,multiple=0,uniform=1,col=1:3,lty=1,se=1)
# see comp.risk for further examples.
add<-comp.risk(Event(time,cause)~factor(tcell),data=bmt,cause=1)
summary(add)
out<-predict(add,newdata=ndata,uniform=1,n.sim=1000)
plot(out,multiple=1,uniform=1,col=1:3,lty=1,se=1)
add<-prop.odds.subdist(Event(time,cause)~factor(tcell),
data=bmt,cause=1)
out <- predict(add,X=1,Z=1)
plot(out,multiple=1,uniform=1,col=1:3,lty=1,se=1)
## SURVIVAL predictions aalen function
data(sTRACE)
out<-aalen(Surv(time,status==9)~sex+ diabetes+chf+vf,
data=sTRACE,max.time=7,n.sim=0,resample.iid=1)
pout<-predict(out,X=rbind(c(1,0,0,0,0),rep(1,5)))
head(pout$S0[,1:5]); head(pout$se.S0[,1:5])
par(mfrow=c(2,2))
plot(pout,multiple=1,se=0,uniform=0,col=1:2,lty=1:2)
plot(pout,multiple=0,se=1,uniform=1,col=1:2)
out<-aalen(Surv(time,status==9)~const(age)+const(sex)+
const(diabetes)+chf+vf,
data=sTRACE,max.time=7,n.sim=0,resample.iid=1)
pout<-predict(out,X=rbind(c(1,0,0),c(1,1,0)),
Z=rbind(c(55,0,1),c(60,1,1)))
head(pout$S0[,1:5]); head(pout$se.S0[,1:5])
par(mfrow=c(2,2))
plot(pout,multiple=1,se=0,uniform=0,col=1:2,lty=1:2)
plot(pout,multiple=0,se=1,uniform=1,col=1:2)
pout<-predict(out,uniform=0,se=0,newdata=sTRACE[1:10,])
plot(pout,multiple=1,se=0,uniform=0)
#### cox.aalen
out<-cox.aalen(Surv(time,status==9)~prop(age)+prop(sex)+
prop(diabetes)+chf+vf,
data=sTRACE,max.time=7,n.sim=0,resample.iid=1)
pout<-predict(out,X=rbind(c(1,0,0),c(1,1,0)),Z=rbind(c(55,0,1),c(60,1,1)))
head(pout$S0[,1:5]); head(pout$se.S0[,1:5])
par(mfrow=c(2,2))
plot(pout,multiple=1,se=0,uniform=0,col=1:2,lty=1:2)
plot(pout,multiple=0,se=1,uniform=1,col=1:2)
pout<-predict(out,uniform=0,se=0,newdata=sTRACE[1:10,])
plot(pout,multiple=1,se=0,uniform=0)
#### prop.odds model
add<-prop.odds(Event(time,cause!=0)~factor(tcell),data=bmt)
out <- predict(add,X=1,Z=0)
plot(out,multiple=1,uniform=1,col=1:3,lty=1,se=1)
# }
Run the code above in your browser using DataLab