pecpec
accepts only R-objects for which a predictSurvProbpredictSurvProb
method exists and glmnetglmnet
is not such an object.
Currently, predictSurvProb methods are available for the following R-objects:
matrix
aalen, cox.aalen from library(timereg)
mfp from library(mfp)
phnnet, survnnet from library(survnnet)
rpart (from library(rpart))
coxph, survfit from library(survival)
cph, psm from library(rms)
prodlim from library(prodlim)
glm from library(stats)
For calculating the brier score for glmnetglmnet
one needs to use the peperrpeperr
package with the c060c060
library that wraps glmnet as an object suitable for peperrpeperr
.
peperr_glmnet_noerror <- peperr(response=Surv(time, status), x=x,
fit.fun=fit.glmnet, args.fit=list(family="cox"),
complexity=complexity.glmnet,args.complexity=list(family="cox"),
indices=resample.indices(n=length(time), method="boot", sample.n=10))
To get the integrated brier score for the entire model it seems one needs to use the ipecipec
function but I still need to research that.
Many thanks to Thomas Hielscher who authored the c060c060
package and was extremely kind to help me with this.