I'm trying to compare two AUC values, for sample size calculation in the pROC
package. The package takes inputs roc1 and roc2 and determines the number of cases and controls from those curves. I would like to use those curves as input, and calculate the sample size needed to achieve a certain level of power; however, I want to use a different ratio of cases to controls than the data I provide. The kappa argument in pROC::power.roc.test does not appear to work unless I'm misunderstanding how to use this function.
library(pROC)
# Using iris dataset in R
# Just changing the `virginica` to `setosa` to have only two levels.
iris[which(iris$Species == 'virginica'),]$Species <- "setosa"
iris$Species <- factor(iris$Species, levels = c("setosa", "versicolor"))
roc1 <- roc(Species ~ Sepal.Length, data = iris)
roc2 <- roc(Species ~ Sepal.Width, data = iris)
power.roc.test(roc1, roc2, power =0.9)
power.roc.test(roc1, roc2, power = 0.9, kappa = 1.7)
power.roc.test(roc1, roc2, power = 0.9, kappa = banana)
All the power.roc.test
calls produce the same numbers of cases and controls.
Am I using the package wrong? Am I understanding the stats behind ROC curve sample size estimation incorrectly?
I looked in the source code, and it seemed like kappa was just recalculated based on the given cases and controls. I tried carrying the kappa through the function but I confess that I'm not the most adept at class methods.