# Calculating trial size with the pwr package (R)

I'm attempting to calculate n for a trial in medical imaging comparing two different imaging modalities. I've never done this before, so I'm not sure how to approach this and interpret the result.

The outcome for both tests are binary (yes or no). The null is no difference, and the alternative is two sided.

I don't KNOW the expected proportion for each test, but I could read articles about both tests and guess. I do know the prevalence(0.30) of what we are testing for in all subjects.

Should I use:

1. a) pwr.2p.test(h = "guess the effect size", sig.lvl = 0.05, power = 0.8)
2. b) pwr.2p.test(h = ES.h(p1 = "estimate of proportion 1", p2 = "estimate of proportion 2"), sig.level = 0.05, power = .80)
3. c) something else?

I somehow feel like the known prevalence should be included in this...

• Alright, I tried doing it with option b) with accuracy as the estimated proportion. I know the prevalence, 0.30, and used sens/spec for the two modalities from different metastudies(modality1 0.39/0.82 and modality2 0.90/0.90). From this I calculated expected TP and TN for both, and then expected accuracy for both (mod1 0.691 and mod 2 0.9). pwr.2p.test(h = ES.h(p1 = 0.691, p2 = 0.9), sig.level = 0.05, power = 0.8) then gives me n of 55 and effect size 0.535. Is my reasoning here correct? – stapperen Sep 27 '18 at 20:39