predict.penCSC {CSCNet} | R Documentation |
predict.penCSC
Description
Flexible prediction method for the objects of class 'penCSC' including the absolute risk prediction.
Usage
## S3 method for class 'penCSC'
predict(object, newX, event = NULL, time, type = "lp", reference = "zero", ...)
Arguments
object |
An object of class 'penCSC'. |
newX |
A data frame containing the information of variables related to new records. Information of variables not included in the model creation will be ignored. |
event |
A vector of event codes which we want predictions for. This must be the same as values in the status variable of the data that was used to create the models. If |
time |
A vector of time horizons which we want absolute risk predictions at. Only applicable when |
type |
Type of the predictions. Valid values are: |
reference |
Reference for centering predictions. Valid values are |
... |
Additional arguments. Not used by |
Value
A tibble containing the predictions based on the input arguments.
Author(s)
Shahin Roshani
References
Pfeiffer, R. M., & Gail, M. M. (2017). Absolute risk: Methods and applications in clinical management and public health.
Aalen, O.O. (1978) Nonparametric Inference for a Family of Counting Processes. The Annals of Statistics, 6, 701-726. doi:10.1214/aos/1176344247.
Wickham H, Averick M, Bryan J, Chang W, McGowan L, François R, et al. Welcome to the tidyverse. J Open Source Softw. 2019 Nov 21;4(43):1686.
Bache S, Wickham H (2022). magrittr: A Forward-Pipe Operator for R. https://magrittr.tidyverse.org, https://github.com/tidyverse/magrittr.
Friedman J, Hastie T, Tibshirani R (2010). "Regularization Paths for Generalized Linear Models via Coordinate Descent." Journal of Statistical Software, 33(1), 1-22. doi:10.18637/jss.v033.i01, https://www.jstatsoft.org/v33/i01/.
Examples
library(riskRegression)
data(Melanoma)
vl <- list('1'=c('age','sex','ulcer','thick'),
'2'=~age+sex+epicel+thick+ici)
al <- list('1'=0,'2'=.5)
ll <- list('1'=.01,'2'=.04)
penfit <- penCSC(time='time',status='status',vars.list=vl,
data=Melanoma,alpha.list=al,lambda.list=ll)
predict(penfit,Melanoma[1:5,],type='lp')
predict(penfit,Melanoma[1:5,],type='response')
predict(penfit,Melanoma[1:5,],type='absRisk',event=1:2,time=1825*(1:2))