Confidence interval for C-index After asking this question earlier today, I figured the approach I should use is not very clear to me so I turn to the community hoping for some answer or good reading material because I kind of get lost as I dig deeper into it...
The idea is to conduct incremental analysis to assess the prognostic value of an indicator ind1 on a binary outcome y.
Different models are adjusted including other covariates such as let's say sex, age and some unbalanced 2 levels factor variable var. I used logistic regression with glm and family="binomial".
As required by researchers I am working with (it is important to mention since it is not my decision and I probably would not do this...), I am calculating C-index to compare models with or without adjusting on ind1. I use DescTools::Cstat to calculate this statistic.
The issue rises with the calculation of the confidence interval for the C-index. At first, I just did some cases resampling bootstrap and it worked fine since I was doing it on my whole dataset. But then, I also need to conduct the analysis on some subpopulation which leaded to the problem mentionned in my other question that is: in the example, my 2 levels factor variable var only have one level left in some of the samples along the bootstrap sampling. Hence the glm estimate fails and the bootstrap too. 2 approaches seem to be doable.
Method 1
As suggested by @Roland in my other post, I looked into residuals resampling but it was not obvious how to apply this to logistic regression (nor more generally to any GLM). I did the following but I would be glad to know if this is correct :
# removing na
data_tmp <- df %>% 
  filter(if_all(everything(), ~ !is.na(.)))

# fit the GLM model
mod1 <- glm(y ~ .,
            data = data_tmp %>% select(-ind1),
            family = "binomial")

mod2 <- glm(y ~ .,
            data = data_tmp,
            family = "binomial")


# Bootstrapping C-index
cind_boot_stat <- function(data, indices){
  # generate new y sample with Bernouilli each time
  d <- data %>% mutate(
    y1 = rbinom(nrow(data_tmp), 1, mod1$fitted.values),
    y2 = rbinom(nrow(data_tmp), 1, mod2$fitted.values))
  
  # fitting the logistic and calculating C-index
  c1 <- DescTools::Cstat(glm(y1 ~ .,
                             data = d %>% select(-y, -ind1),
                             family = "binomial"))
  
  c2 <- DescTools::Cstat(glm(y2 ~ .,
                             data = d %>% select(-y),
                             family = "binomial"))
  
  return(c(c1, c2))
}

cind_boot <- boot::boot(data_tmp, cind_boot_stat, R = 1000)

Method 2
Next idea from here was to use the fact that GLM parameters have asymptotic normal distribution so I generate 1000 sets of parameter as so :
mod1 <- glm(y ~ .,
            data = data_tmp,
            family = "binomial")

beta1 <- mod1$coefficients
sigma1 <- vcov(mod1)

generated_coefs <- MASS::mvrnorm(n=1000, mu=beta1, Sigma=sigma1)

Then, I would need to calculate the C-index from each set of parameters to eventually deduct a CI for the C-index. However, I am not sure that this approach is right and moreover, I don't know how I should go from my generated coefficients generated_coefs to the C-index : should I recreate a model object (if possible) to then use the DescTools::Cstat or is there any other way ?
To clarify, the questions are :

*

*is method 1 correct and if so, is my code for method 1 correct ?

*is method 2 correct and if so, how to calculate C-index out of the generated coefficients and the variance-covariance matrix ?

*is there any other approach I should consider ?

Thank you very much for the help.

The concordance probability is not to be used to compare two models.  The reason is that rank measures insufficiently reward extreme predictions that are "right".  By analogy, one would never compare two Wilcoxon statistics (one for treatment B vs treatment A and one for C vs A) to judge C vs B.  Instead, head-to-head comparisons are needed.  Instead, use a statistically efficient approach that also happens to be more clinically relevant: https://fharrell.com/post/addvalue
