Skip to content

Instantly share code, notes, and snippets.

@joonro
Last active August 20, 2018 03:52
Show Gist options
  • Select an option

  • Save joonro/ebbe51a88c7963d07576cbeaba423489 to your computer and use it in GitHub Desktop.

Select an option

Save joonro/ebbe51a88c7963d07576cbeaba423489 to your computer and use it in GitHub Desktop.
[Power Analysis] Linear Model see https://www.statmethods.net/stats/power.html for documentation. #R
install.packages("pwr")
library(pwr)
Rsq_A = 0.302
Rsq_AB = 0.309
f2 = (Rsq_AB - Rsq_A) / (1 - Rsq_AB)
f2
pwr.f2.test(u=5, v=4000, f2=f2, sig.level=0.05)
pwr.f2.test(u=5, v=4000, f2=0.02, sig.level=0.05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment