{{ message }}

# Sample size calculation with wrong zalpha?#50

Closed
opened this issue Apr 9, 2019 · 3 comments
Closed

# Sample size calculation with wrong zalpha?#50

opened this issue Apr 9, 2019 · 3 comments

### patrickEinz commented Apr 9, 2019

 I tried to reproduce the sample size calculations in Table 4 of the Obuchowski paper (2004) for a single ROC curve. For a significance level of 0.05, an expected AUC of 0.7, a desired power of 0.9 and kappa = 1, the sample size calculation should result in 33 patients for each of the two groups. However, power.roc.test(auc=0.7, sig.level=0.05, power=0.9, kappa=1.0) gives ncases = ncontrols = 40.21369 as a result. Maybe the problem is that inside the function, the z-value for the significance level is calculated by zalpha <- qnorm(sig.level), which gives the lower alpha percentile (-1.64 instead of 1.64), not the upper one. I think it should be: zalpha <- qnorm(sig.level, lower.tail = F) or, of course zalpha <- qnorm(1 - sig.level) Thank you very much for your work and for maintaining this great package! The text was updated successfully, but these errors were encountered:

### xrobin commented Apr 10, 2019 • edited

 Thanks for your report! The Obuchowski (2004) paper describes one-sided tests, in which case pROC returns the expected results: > power.roc.test(auc=0.7, sig.level=0.05, power=0.9, kappa=1.0, alternative="one.sided") One ROC curve power calculation ncases = 32.65397 ncontrols = 32.65397 auc = 0.7 sig.level = 0.05 power = 0.9  However you are right this is looking weird. I will look into it.

added a commit that referenced this issue Apr 10, 2019
 Check table 4 in Obuchowski 2004 (issue #50) 
 7f0e6b7 
added a commit that referenced this issue Dec 1, 2019
 Use the right z_\alpha and z_\beta in numeric power.roc.test (issue #50) 
 cef4f08 

### xrobin commented Dec 1, 2019

 This is now fixed for the one ROC curve case. Note that resulting values are unchanged and were correct already. I still need to look into it for the two ROC curves case, where the same mistake apparently occurs.

added a commit that referenced this issue Dec 1, 2019
 Refactor the solving of equation to separate functions (issue #50) 
 6f17502 
added a commit that referenced this issue Dec 1, 2019
 Use the right z_\alpha and z_\beta in power.roc.test with 2 ROC curve… 
 8cc60a1 
…s (issue #50)
added a commit that referenced this issue Dec 1, 2019
 Remove coefficient names that re-appear later (issue #50) 
 3718b2b 
added a commit that referenced this issue Dec 1, 2019
 Use the right z_\alpha and z_\beta in power.roc.test with a list of p… 
 e100c61 
…arameters (issue #50)

### xrobin commented Dec 1, 2019

 Fixed in the 2 ROC curves and list of parameters cases too. It was a good occasion to cleanup the code at the same time. Again, no difference in the output. But clearer, and more appropriate use of the distributions. Thanks again for reporting this inconsistency and helping make pROC better.

closed this Dec 1, 2019
added a commit that referenced this issue Dec 1, 2019
 Document cleanup in issue #50 in news. 
 f6bd39f