Generates the data needed for the calibration plot
Source:R/get_calibration_plot_data_surv.R
get_calibration_plot_data_surv.RdGenerates the data needed for the calibration plot. The calibration plot needs to separate the model predictions by risk groups. First the function separates the predictions in n_groups then computes the mean value of the model predictions and also the observed value. The observed value is the estimated value at the study time estimated using a Kaplan-Meier estimator.
Arguments
- model
Model generated with
mv_model_cox()ormv_model_logreg(). Needs thepredictionsparameter of the model, to generate it the functioncalculate_predictions()must be executed over the model. If we want to obtain also the recalibrated data the model must be initalize the recalibrated predictions withcalculate_predictions_recalibrated_type_1()andcalculate_predictions_recalibrated_type_2().- data
Data for what the observed predictions will be calculated.
- n_groups
Number of groups that must be calculated.
- type
Type of the predictions that the calibration plot data should be generated from:
"predictions_aggregated","predictions_recal_type_1"or"predictions_recal_type_2"