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 NULL, absolute risk will be calculated for all involved events. Default is NULL which returns values for all involved causes.

time

A vector of time horizons which we want absolute risk predictions at. Only applicable when type='absRisk'.

type

Type of the predictions. Valid values are: 'lp' or 'link' for linear predictors, 'risk' or 'response' for exp(lp) and finally 'absRisk' for semi-parametric estimates of absolute risk.

reference

Reference for centering predictions. Valid values are 'zero' and 'sample'. Default is 'zero'. For more information on referencing see details in ?predict.coxph.

...

Additional arguments. Not used by predict.penCSC.

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))


[Package CSCNet version 0.1.2 Index]