https://psyteachr.github.io/quant-fun-v2/power-and-effect-sizes.html
# Power calculation


Type I error - or false positive, is the probability of rejecting the null hypothesis when it should not be rejected
Type II error - or false negative, is the probability of retaining the null hypothesis when it is false
power - correctly concluding there is an effect when there is a real effect to detect, the probability of correctly rejecting the null hypothesis for a given effect size and sample size.

Today we will use the functions pwr.t.test(), pwr.r.test() and pwr.chisq.test from the package pwr to run power calculations for t-tests, correlations and chi-square.
The pwr package
1. For a t test - use pwr.t.test

```
pwr.t.test(d = .4,
power = .8,
sig.level = .05,
alternative = "two.sided",
type = "two.sample") %>%
pluck("n") %>%
ceiling()
```
2. For correlation, use pwr.r.test


