PJFM_fit {PJFM} | R Documentation |
The function to fit PJFM.
Description
The function is used to fit PJFM.
Usage
PJFM_fit(
RecurData = NULL,
SurvData = NULL,
control_list = NULL,
EventName = NULL,
nlam = 50,
ridge = 0,
pmax = 10,
min_ratio = 0.01,
maxiter = 100,
eps = 1e-04
)
Arguments
RecurData |
a data frame containing the recurrent events data
(see |
SurvData |
a data frame containing the survival data
(see |
control_list |
a list of parameters specifying the joint frailty model
(see |
EventName |
a vector indicating which set of recurrent events to be analyzed. If NULL, all recurrent events in RecurData will be used. |
nlam |
number of tuning parameters. |
ridge |
ridge penalty. |
pmax |
the maximum of biomarkers being selected. The algorithm will stop early if the maximum has been reached. |
min_ratio |
the ratio between the largest possible penalty and the smallest penalty to tune. |
maxiter |
the maximum number of iterations. |
eps |
threshold for convergence. |
Value
return a list with the following objects.
object_name |
indicates whether this is a PJFM or JFM object. If JFM object, then some recurrent events were selected and the returned model is the refitted model with only selected recurrent events, but no penalty; otherwise, PJFM object is returned. |
fit |
fitted models with estimated parameters in both submodels. |
hess |
Hessian matrix; only available for JFM object. |
References
Jiehuan Sun. "Dynamic Prediction with Penalized Joint Frailty Model of High-Dimensional Recurrent Event Data and a Survival Outcome".
Examples
require(splines)
data(PJFMdata)
up_limit = ceiling(max(SurvData$ftime))
bs_fun <- function(t=NULL){
bs(t, knots = NULL, degree = 2, intercept = TRUE, Boundary.knots= c(0,up_limit))
}
recur_fix_time_fun = bs_fun
recur_ran_time_fun <- function(x=NULL){
xx = cbind(1, matrix(x, ncol = 1))
colnames(xx) = c("intercept","year_1")
xx[,1,drop=FALSE]
#xx
}
surv_fix_time_fun = bs_fun
control_list = list(
ID_name = "ID", item_name = "feature_id",
time_name = "time", fix_cov = "x", random_cov = NULL,
recur_fix_time_fun = recur_fix_time_fun,
recur_ran_time_fun = recur_ran_time_fun,
surv_fix_time_fun = surv_fix_time_fun,
surv_time_name = "ftime", surv_status_name = "fstat",
surv_cov = "x", n_points = 5
)
## this step takes about a few minute.
## analyze the first 10 recurrent events
res = PJFM_fit(RecurData=RecurData, SurvData=SurvData,
control_list=control_list, EventName=1:10)
## get summary table
summary_table = PJFM_summary(res)