You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document includes a couple examples of calculations with the `pwr` package, which you must have installed.
```{r}
library(pwr)
```
Example discussed in 2.4.1 in the text:
* To calculate power for a two-sample $t$ test, when sample size in each sample is $n=16$, effect size (Cohen's $d$) is 0.5, at significance level $\alpha=0.05$:
```{r}
pwr.t.test(n=16, d=0.5, sig.level = 0.05)
```
* Calculate what sample size would be needed to achieve power of $\beta = 0.8$ for this effect size and $\alpha$: