inst/snippet/power-t-test05.R

pow <- function(effect) {
    power.t.test(delta = effect, n = 50)$power
}
effect = seq(0, 2, by = 0.05)
gf_line(pow(effect) ~ effect) %>%
  gf_labs(y = "power", x = "effect size", 
          title = "Power of a 2-sample test (n = 50)")

Try the fastR2 package in your browser

Any scripts or data that you put into this service are public.

fastR2 documentation built on Nov. 9, 2023, 9:06 a.m.