View puzzle_nov25_2015.delim
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
col3 col2 col4 col1 | |
h a t t | |
i v i g | |
k s g n | |
n g n i |
View predict_function
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
library(lubridate) | |
dt = "2015-11-18" | |
predict_function = function(dt){ | |
dt_ymd = ymd(dt) | |
## Get some info | |
mday_dt = mday(dt_ymd) | |
wday_dt = wday(d_ymd) | |
## Download data |
View This is a test
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
Blah blah blah 2 |
View any-pvalue-significant.R
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
## Load library/set seed | |
set.seed(1325) | |
library(qvalue) | |
library(RSkittleBrewer) | |
trop = RSkittleBrewer("tropical") | |
## Set a target p-value | |
target_pval = 0.8 | |
## Not significant if we |
View google-scraper.R
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
## Load libraries | |
library(XML) | |
library(dplyr) | |
library(RCurl) | |
## Get the results for a specific term | |
scrape_term = function(search_term,npages){ | |
base_url = "http://scholar.google.com/scholar?" | |
search_string = paste0("q=",paste0(strsplit(search_term," ")[[1]],collapse="+")) | |
dat = data.frame(NA,nrow=10*npages,ncol=3) |
View P-value histogram Med Journals
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
## 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) |
View gist:9665572
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
# Load library | |
library(RSkittleBrewer) | |
# Differences in mean between 0 and 5 | |
sig = seq(0,5,length=100) | |
# This is the sample size | |
ss = 20 | |
# Calculate power from 200 replicated tests |
View googleCite.R
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
######################################################################################### | |
# Some functions to quantify your Google Scholar citations page. | |
# R functions Copyright (C) 2011 John Muschelli (jmuschel@jhsph.edu), Andrew Jaffe (ajaffe@jhsph.edu), | |
# Jeffrey Leek (jtleek@gmail.com), and the Simply Statistics Blog | |
# (http://simplystatistics.tumblr.com, http://twitter.com/simplystats) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
View gist:4369771
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
# Make the canvas | |
plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") | |
# Make the branches | |
rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) | |
polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) | |
polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) | |
polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) | |
polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) |
View gist:4177366
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
pvaluesPain = c(0.02, 0.06, 0.75, 0.38, 0.3, 0.07, 0.22, 0.27) | |
adjustedPvaluesPain = p.adjust(pvaluesPain,method="bonferroni") | |
adjustedPvaluesPain | |
sum(adjustedPvaluesPain < 0.05) | |
pvaluesNoPain = c(0.82, 0.98, 0.65, 0.39, 0.88, 0.95, 0.29, 0.64, 0.81) | |
adjustedPvaluesNoPain = p.adjust(pvaluesNoPain,method="bonferroni") | |
adjustedPvaluesNoPain | |
sum(adjustedPvaluesNoPain < 0.05) |
NewerOlder