Description Usage Arguments Value
This function creates a data.frame
with one row per subject and a column named "fits".
The latter column contains the 3 possible subject-level predictions: fit - training data model predictions,
fitgrid - grid-based model predictions, holdout - predictions for holdouts or out-of-sample predictions.
Some of these predictions might be empty, e.g. when add_holdout = FALSE
, no holdout predictions are made.
1 2 3 4 | predict_all(modelfit, newdata, add_holdout = TRUE, add_grid = TRUE, tgrid,
grid_size = 150, add_checkpoint = TRUE, checkpoint = as.integer(c(1,
hbgd::months2days(1:24))), add_MSE = TRUE,
verbose = getOption("growthcurveSL.verbose"))
|
modelfit |
Model fit object returned by |
newdata |
Subject-specific data for which predictions should be obtained. |
add_holdout |
Optional flag, set to |
add_grid |
Optional flag, set to |
tgrid |
Specify the grid of time-points directly. If missing a subject-specific grid is defined based on the subject's follow-up range. |
grid_size |
How many time-points should be used in equally spaced grid?
This argument is only used when |
add_checkpoint |
Set to |
checkpoint |
The grid of checkpoint for which to obtain predictions (daily resolution). |
add_MSE |
Add subject-specific MSE for growth curve prediction (NOT IMPLEMENTED). |
verbose |
Set to |
A data.frame with one row per subject. The column named "fit" contains nested subject-specific observed data and predictions. Each entry (cell) of "fit" is a list of 4 subject-specific data.frames, named "xy", "fit", "fitgrid" and "holdout", containing the training time-outcome values, the model predictions for training data, the grid of equally spaced model prediction and the holdout / out-of-sample predictions, respectively.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.