Created
July 29, 2017 09:24
-
-
Save anonymous/32eef6305b533fcb12e4b8f21ff38a27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The included numbers will per calulate power for a meta-analysis to detect a summary effect size of 0.2, with an average sample size per group of = 50, a total of 15 effect sizes, and moderate heterogeneity. | |
es <- 0.2 # Enter your summary effect size | |
as <- 50 # Average per number per group | |
mk <- 15 # Number of effect sizes | |
hg <- 1 # Heterogeniety (".33" for small, "1" for moderate, & "3" for large) | |
eq1 <- ((as+as)/((as)*(as))) + ((es^2)/(2*(as+as))) | |
eq2 <- hg*(eq1) | |
eq3 <- eq2+eq1 | |
eq4 <- eq3/mk | |
eq5 <- (es/sqrt(eq4)) | |
Power <- (1-pnorm(1.96-eq5)) # Two-tailed | |
Power |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment