xrobin / pROC

Display and analyze ROC curves in R and S+
https://cran.r-project.org/web/packages/pROC/
GNU General Public License v3.0
118 stars 31 forks source link

power.roc.test #1

Closed eusebe closed 12 years ago

eusebe commented 12 years ago

Hi,

First, thank you of this wonderfull package.

I am trying to use the function 'power.roc.test' from the development version of the package. I would like to compute the sample size needed to compare a single AUC to a theoric value.

Is it possible to define the theoric value of the AUC (For example, if the expected AUC is 0.9, and its theoric value is 0.8) ?

Best,

David

xrobin commented 12 years ago

Hi eusebe,

Do you mean comparing an empirical AUC obtained with the ROC function, to a numeric value?

You can use the power.roc.test(parslist=list(A1= ..., ...), ...) method of the function. Read ?power.roc.test for the full description of the parameters to list. I realize it would probably help if you could get those parameters directly from the var function. I'll see how I can implement that in a future release, but it should be fairly easy.

If you want to compare two AUC where you have only their numeric value, you can also use the parslist method.

You will find an explanation of these parameters in Obuchowski & McClish (1997).

Hope it helps?

Xavier

eusebe commented 12 years ago

Thank you for the quick answer.

For example, I would like to reproduce the example 1 of the article. A1 = 1.2, B1 = 1, but there is only one ROC curve and no correlation parameter. With the parslist method, A2, B2, rn and ra seem to be required?

David

xrobin commented 12 years ago

Yes, they are required. The example 1 gives a formula to compute A2 (with B2 = B1 = 1, formula 16). But the correlation is absolutely needed to compute the variance. Remember Var(Δ) = Var(θ1) + Var(θ2) - 2 * Cov(θ1, θ2) (formula 3, with Δ = the AUC difference and θ1, θ2 the AUCs). It can make huge difference for very high correlations. Therefore you need to make an estimate on the correlation.