Last active
August 29, 2015 14:01
-
-
Save jtleek/deb7a98644ebd19757b1 to your computer and use it in GitHub Desktop.
Code to create p-value histograms of significant p-values in journal abstracts for JAMA, NEJM, BMJ, Lancet, and AJE 2000-2010
This file contains hidden or 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
## See the paper by Jager and Leek and associated discussion | |
## for more information: http://biostatistics.oxfordjournals.org/content/15/1/1 | |
## For the code to perform the analysis in that paper or to see how the p-values | |
## were collected see the repo: https://github.com/jtleek/swfdr | |
## The data for this gist are available here: | |
## https://github.com/jtleek/swfdr/blob/master/pvalueData.rda | |
## Load packages | |
library(ggplot2) | |
## Load data | |
load("pvalueData.rda") | |
## Make a data frame | |
pvalueData <- as.data.frame(pvalueData) | |
## Make pvalue data numeric | |
pvalueData$pvalue = as.numeric(as.vector(pvalueData$pvalue)) | |
## Add journal names | |
pvalueData$journal = rownames(pvalueData) | |
## Subset to significant p-values | |
pval05 = pvalueData[pvalueData$pvalue < 0.05,] | |
## Make a plot | |
qplot(factor(journal), pvalue, data = pval05, geom = "violin",fill=journal) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment