SarahLynn
1/29/2021
why use a sample size calculator?
The sample size calculator app uses formulas like the following to calculate power. Here we are using defualt parameters, but note that the app will allow you to change them.
#for one sample continuous outcome
power.t.test(delta=.1,sd=1,power=.9,
type=c("one.sample"),
alternative=c("two.sided"))$n
[1] 1052.665
#for two sample discrete outcome
pwr.2p.test(h=.05,sig.level=.05,power=.9,
alternative=c("two.sided"))$n
[1] 8405.936
The app will also display a graph that shows how the sample size needed will change as you adjust the difference to detect or other input parameters. Example below with default values.
A well conducted experiment requires a pre-thought out sample size calculation and plan for collecting the appropriate data. A calculator like the one in this app will reduce the friction in gathering this information and hopefully make this step easier.
The sample size calculator app can be found here: https://swilde92.shinyapps.io/sample_size_calculator_r/