Plotting
The package also includes basic plotting functions for easier visualization of the data, as well as for visualizing the resulting model and evaluating its performance. Below, the basic functionality of these functions will be demonstrated. Keep in mind, there are various input parameters available to customize the resulting plots according to individual needs. For more details on these parameters, please refer to the documentation. Some of the plotting functions may prompt additional instructions in the console based on the provided dataset. Following these instructions will generate the next plot.
Plotting Data
To plot either real-world or simulated data, simply provide the dataset to the “plot_data()” function. If real-world data is used, it has to be preprocessed using “preprocess_event_data()” beforehand. For simulated data, one can directly use the object returned by “simulate_metaROC()”. The function automatically detects whether the dataset is real-world or simulated. When real-world data is provided, the function generates plots of study-specific ROC curves. In contrast, simulated data plots include the true ROC curve alongside another plot depicting True Sensitivity-Specificity against Threshold curves.
plot_data(sim)
#> Press Enter to see the next plot...
Plotting evaluation results
Plotting serves as a valuable tool, especially for evaluation. While sifting through numerous numbers can be tedious, appropriate plots can provide the same information and contextualize it effectively. To facilitate this, the “plot_evaluation” function was included. This function is designed for simulated data, requiring both the simulated data and the evaluated model as objects returned from their respective functions. One can choose between “Wald” confidence intervals provided by the evaluated model itself or computationally expensive Bootstrap intervals. The function generates four plots in total: The first plotis similar to the first plot of “plot_data” but includes the estimated ROC curve with its confidence interval. It is followed by two Sensitivity-Specificity against threshold plots: one using true values and another using estimated values, allowing for coverage checks with confidence intervals in both. Lastly, a Youden Index against threshold plot showcases its development and identifies the optimal threshold according to the model. The example also demonstrates the use of weighted Youden Index and annotations to clarify the optimal threshold value.
plot_evaluation(sim, evaluated_model,
youd_anno = TRUE,
youd_weight = 0.3,
CI = "Wald")
#> Press Enter to see the next plot...
#> Press Enter to see the next plot...
#> Press Enter to see the next plot...