Created
August 21, 2015 17:48
-
-
Save chartgerink/b52547c2c4e8cc7735d0 to your computer and use it in GitHub Desktop.
R code for a blogpost
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
# Cumulative meta-analysis coronary heart disease | |
pval = c(0.1495, | |
0.0364, | |
0.0821, | |
0.0301, | |
0.0067, | |
0.0296, | |
0.0678, | |
0.0476, | |
0.0417, | |
0.0154, | |
0.0500, | |
0.0290, | |
0.0392, | |
0.0231, | |
0.0225, | |
0.0297, | |
0.0160, | |
0.0064, | |
0.0329, | |
0.0115, | |
0.0125, | |
0.0159) | |
alpha = .05 | |
pval.sig <- pval[pval <= alpha] | |
pval.sig.adj <- pval.sig / alpha | |
fisher <- -2*sum(log(pval.sig.adj)) | |
df = length(pval.sig.adj) * 2 | |
fisher | |
df | |
pchisq(fisher, df = df) | |
# Cumulative meta-analysis stroke | |
pval = c(0.1616, | |
0.2540, | |
0.2053, | |
0.0340, | |
0.0229, | |
0.0314, | |
0.0197, | |
0.0199, | |
0.0077, | |
0.0017, | |
0.0042, | |
0.0012, | |
0.0025, | |
0.0022) | |
alpha = .05 | |
pval.sig <- pval[pval <= alpha] | |
pval.sig.adj <- pval.sig / alpha | |
fisher <- -2*sum(log(pval.sig.adj)) | |
df = length(pval.sig.adj) * 2 | |
fisher | |
df | |
pchisq(fisher, df = df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment