How to do decision curve analysis on multiple imputation datasets? #17
-
|
Hi |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hi Yi-Ju, Thank you for your question. You can do it in this order:
|
Beta Was this translation helpful? Give feedback.
-
|
A simple alternative is just to create one large data set from the imputed data sets and run the decision curve on that. Because we aren't interested in 95%CI, you don't have to worry about Rubin's rules for combining data etc etc |
Beta Was this translation helpful? Give feedback.

@YiJuChou
Given Dr. Vickers' answer, you can approach it this way code-wise:
Load necessary libraries
library(mice) # For multiple imputation
library(dcurves) # For decision curve analysis
library(dplyr) # For data manipulation
library(ggplot2) # For plotting
Simulating a dataset with missing values
set.seed(123) # For reproducibility
data <- tibble(
patientid = 1:100,
cancer = rbinom(100, 1, 0.3),
risk_group = sample(c("low", "intermediate", "high"), 100, replace = TRUE),
age = rnorm(100, mean = 65, sd = 10),
famhistory = sample(c(NA, 1, 0), 100, replace = TRUE),
marker = runif(100),
cancerpredmarker = runif(100, 0, 0.6)
)
Adjust 'm' as needed for the number of imputations
num_imputation…