dx_delong | R Documentation |
This function applies DeLong's test to compare the areas under two correlated ROC curves, providing a statistical approach to assess if there is a significant difference between them. It's particularly useful for comparing the performance of two diagnostic models.
dx_delong(dx1, dx2, detail = "full", paired = TRUE)
dx1 |
A |
dx2 |
A |
detail |
Character specifying the level of detail in the output: "simple" for p-value only, "full" for detailed test results. |
paired |
Logical indicating if data between |
The function utilizes the roc.test
function from the pROC
package to perform
DeLong's test, which is suitable for comparing two correlated ROC curves. This correlation
typically arises from using the same set of samples to generate both curves. A significant
p-value indicates a statistically significant difference between the AUCs of the two models.
When detail
is "full", additional information about the comparison, including the estimated
difference in AUC and its confidence interval, is provided. The confidence interval gives a
range of plausible values for the difference in AUC between the two models.
Depending on the detail
parameter, returns a p-value or a comprehensive
summary of the test including the test statistic, p-value, and confidence interval
for the difference in AUC.
pROC::roc.test()
for the underlying test implementation.
dx_cm()
to understand how to create a dx
object.
dx_glm <- dx(data = dx_heart_failure, true_varname = "truth", pred_varname = "predicted")
dx_rf <- dx(data = dx_heart_failure, true_varname = "truth", pred_varname = "predicted_rf")
simple <- dx_delong(dx_glm, dx_rf, detail = "simple")
detailed <- dx_delong(dx_glm, dx_rf)
print(simple)
print(detailed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.