Skip to content

Instantly share code, notes, and snippets.

@leeper
Created November 21, 2016 12:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leeper/e843f5ae25e33a9d89d20e162597d90a to your computer and use it in GitHub Desktop.
Save leeper/e843f5ae25e33a9d89d20e162597d90a to your computer and use it in GitHub Desktop.
Transform p-values into "shruggies" of confidence-specific shrugginess
shrugp <- function(p) {
out <- symnum(p, cutpoints = c(0, 0.001, 0.01, 0.05, 0.10, 1.00),
symbols = c("(ツ)", "¯\\(ツ)/¯", "¯\\_(ツ)_/¯", "¯\\___(ツ)___/¯", "¯\\____(ツ)____/¯"))
as.character(out)
}
pvals <- c(0.09, 0.03, 0.002, 0.000001)
shrugp(pvals)
## [1] "¯\\___(ツ)___/¯" "¯\\_(ツ)_/¯" "¯\\(ツ)/¯" "(ツ)"
cat(paste0("p < ", p, ", ", shrugp(pvals), collapse = "\n"), "\n")
## p < 0.14, ¯\___(ツ)___/¯
## p < 0.09, ¯\_(ツ)_/¯
## p < 0.03, ¯\(ツ)/¯
## p < 0.002, (ツ)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment