| WA_cv | R Documentation |
Runs K-fold CV over a grid of basis types, degrees, interior-knot counts,
and link functions. For each configuration, fits the model on K-1 folds and
accumulates the prediction error (PE) on the held-out fold using
WA_PE() (IPCW computed on the training subjects).
WA_cv(
formula,
data,
id,
cluster = NULL,
basis_set = c("il", "pl", "bz"),
degree_vec = 1:2,
n_int_vec = c(0, 2, 4),
knot_scheme = c("equidist", "quantile"),
link_set = c("log"),
time_range = NULL,
tau_grid = NULL,
w_recur,
w_term,
ipcw = c("cox", "km"),
ipcw_formula = ~1,
K = 5,
seed = 1L,
verbose = TRUE
)
formula |
A |
data |
Long-format data frame; see |
id |
Character scalar; subject ID column name; see |
cluster |
Optional character scalar; cluster column name; see |
basis_set |
Character vector of candidate bases. |
degree_vec |
Integer vector of candidate degrees. |
n_int_vec |
Integer vector of interior-knot counts; 0 means boundaries only. |
knot_scheme |
|
link_set |
Character vector of candidate links (subset of |
time_range |
Optional numeric length-2 vector |
tau_grid |
Optional numeric vector; if |
w_recur |
recurrent-event weights |
w_term |
Numeric scalar; terminal-event weight; see |
ipcw |
IPCW method ( |
ipcw_formula |
One-sided RHS formula for IPCW Cox model (if |
K |
Number of folds. |
seed |
RNG seed for fold assignment. |
verbose |
Logical; show a text progress bar and per-fold messages. |
A data frame with columns: basis, degree, n_int,
link, and aggregated PE. Lower PE is better.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.