cv_predict | R Documentation |
This function calculates cross-validated prediction performance metrics
cv_predict(
Formula,
data,
na.action = "na.fail",
subset = NULL,
hazard = c("weibull"),
frailty = TRUE,
model,
knots_list = NULL,
p0_vec = rep(4, 3),
startVals = NULL,
optim_method = if (tolower(hazard) %in% c("royston-parmar", "rp")) "BFGS" else
"L-BFGS-B",
n_folds,
t_cutoff,
t_start = 0,
tol = 0.001,
type = "marginal",
gamma = 1,
h3_tv,
tv_knots,
verbose = 0
)
Formula |
a Formula object, with the outcome on the left of a
|
data |
a |
na.action |
how NAs are treated. See |
subset |
a specification of the rows to be used: defaults to all rows. See |
hazard |
String specifying the form of the baseline hazard. |
frailty |
Boolean indicating whether a gamma distributed subject-specific frailty should be included. Currently this must be set to TRUE. |
model |
String specifying the transition assumption |
knots_list |
Used for hazard specifications besides Weibull, a
list of three increasing sequences of integers, each corresponding to
the knots for the flexible model on the corresponding transition baseline hazard. If
|
p0_vec |
vector of length three of integers indicating how many baseline hazard parameters should be specified for each of the three transition hazards. This input is only relevant when hazard is something other than "weibull" and is superceded by knots_list. |
startVals |
A numeric vector of parameter starting values, arranged as follows:
the first |
optim_method |
a string naming which |
n_folds |
Integer value specifying the number of partitions to divide the data into for cross validation |
t_cutoff |
Numeric vector indicating the time(s) to compute the risk profile. |
t_start |
Numeric scalar indicating the dynamic start time to compute the risk profile. Set to 0 by default. |
tol |
Numeric value for the tolerance of the numerical integration procedure. |
type |
String either indicating 'marginal' for population-averaged probabilities, or 'conditional' for probabilities computed at the specified gamma |
gamma |
Numeric value indicating the fixed level of the frailty assumed for predicted probabilities, if 'type' is set to 'conditional' |
h3_tv |
String indicating whether there is an effect of t1 on hazard 3. |
tv_knots |
for piecewise effect of t1 in h3, these are the knots at which the effect jumps |
verbose |
Numeric indicating the amount of intermediate information that should be printed during the cross-validation process. Larger numbers correspond to more printed information. |
if Xmat has only one row, and t_cutoff is a scalar, then returns a 4 element row matrix
of probabilities. If Xmat has n
rows, then returns an n
by 4 matrix of probabilities.
If Xmat has n
rows and t_cutoff is a vector of length s
, then returns an s
by 4 by n
array.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.