Skip to content

Instantly share code, notes, and snippets.

@yufree
Last active September 28, 2017 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yufree/e251b9c5a955752ae5a4cc119a9c4937 to your computer and use it in GitHub Desktop.
Save yufree/e251b9c5a955752ae5a4cc119a9c4937 to your computer and use it in GitHub Desktop.
Influence of p-value cutoff change
library(tidypvals)
library(dplyr)
library(ggplot2)
aj1 = anti_join(head2015,chavalarias2016)
aj2 = anti_join(chavalarias2016,head2015)
sj1 = semi_join(head2015,chavalarias2016)
allp = rbind(aj1,aj2,sj1)
allp = rbind(allp,brodeur2016)
allp0 = allp %>%
filter(!is.na(field)) %>%
group_by(field) %>%
mutate(p0.05 = (pvalue<0.05)) %>%
mutate(p0.005 = (pvalue<0.005)) %>%
summarise(avg1 = mean(p0.05),avg2 = mean(p0.005)) %>%
mutate(wrong = avg1-avg2)
allp0 %>%
ggplot(aes(field, wrong)) +
geom_col(show.legend = FALSE) +
ylab("percentage of not significant paper if p-value cutoff is 0.005") +
coord_flip()
allp0 %>%
ggplot(aes(field, avg1)) +
geom_col(show.legend = FALSE) +
ylab("percentage of significant paper if p-value cutoff is 0.05") +
coord_flip()
allp0 %>%
ggplot(aes(field, avg2)) +
geom_col(show.legend = FALSE) +
ylab("percentage of significant paper if p-value cutoff is 0.005") +
coord_flip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment