# Groups | Package | Function | |
---|---|---|---|
Continuous ~ Categorical / parametric | |||
One-sample t test | 1 |
|
|
Two-sample t test | 2 |
|
|
Paired t test | 2 |
|
|
One-way ANOVA | ≥3 |
|
|
Continuous ~ Categorical / nonparametric | |||
One-sample Wilcoxon test | 1 | NA | |
Mann-Whitney U test | 2 | NA | |
Paired Wilcoxon test | 2 | NA | |
Kruskal-Wallis test | ≥3 | NA |
Sample Size for Medical Research with R
A Quick Guide Cookbook
Preface
Goal
An in-development cookbook & code collection for sample size calculation in medical research using R
Who is book for
This book this for someone who has
Some basic
R
knowledge.Some experience conducting statistical test (e.g., t-test).
But you haven’t done any sample size calculation before (at least in R) and you want a quick tutorial to do that in R
with some examples.
Resources
Many of the resources and code are from these sources:
Sample size calculation in clinical trial using R (Park et al. 2023)
Reproducible Medical Research with R (Peter D. R. Higgins, n.d.)
Functions
Here is the summary of functions that help you calculate sample size or power based on statistical test
TODO: make table above from here
R Package Used
pwr (Champely 2020)
WebPower (Zhang and Mai 2023)