Skip to content

Instantly share code, notes, and snippets.

@arcaravaggi
Created February 14, 2018 17:14
Show Gist options
  • Save arcaravaggi/81e318c807a1cb259bc5cb6bda227fd4 to your computer and use it in GitHub Desktop.
Save arcaravaggi/81e318c807a1cb259bc5cb6bda227fd4 to your computer and use it in GitHub Desktop.
Simple power analysis in R
install.packages("pwr")
library(pwr)
# pwr.anova.test(k = , n = , f = , sig.level = , power = )
# k = number of groups
# n = number of samples
# f = effect size
# sig.level = significance level
# power = power (0-1)
#
# See https://www.statmethods.net/stats/power.html for more info
pwr.anova.test(k = 6, f = .25, sig.level = 0.05, power = .95)
# Omitted n as that is calculated by the function based on other parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment