I am working with the R programming language. Suppose I have 1000 patients in a medical study, and I want to take measurements on these 1000 patients.
- 500 patients in Group A
- 250 patients in Group B
- 250 patients in Group C
However, I don't have enough money to study all these patients.
I found the following tutorial in R: https://www.programmingr.com/examples/neat-tricks/sample-r-function/how-to-seize-pwr-statistical-power-analysis-in-r/
library(pwr)
pwr.2p.test(n=1000,sig.level=0.05,power=0.5)
Difference of proportion power calculation for binomial distribution (arcsine transformation)
h = 0.08764393
n = 1000
sig.level = 0.05
power = 0.5
alternative = two.sided
Question: I am not sure if this is the correct way to select sample size? Does anyone know if it is possible to find out the minimum number of patients need to be selected from Group A, Group B and Group C for the results to be statistically significant? I read something about how this would involve "significance" and "power".
Can someone please show me how to do this?
Thanks!