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
cibars <- function(x, y, y.se, tinyfactor = 50, ...){ | |
lower <- y - 1.96*y.se | |
upper <- y + 1.96*y.se | |
segments(x0 = x, y0 = lower, x1 = x, y1 = upper, ...) | |
tinybarwidth <- (max(x) - min(x))/tinyfactor | |
segments(x0 = x - tinybarwidth, y0 = lower, x1 = x + tinybarwidth, y1 = lower, ...) | |
segments(x0 = x - tinybarwidth, y0 = upper, x1 = x + tinybarwidth, y1 = upper, ...) |
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
myboxplot <- function(datalist, quantiles = c(.1, .9), names, ...){ | |
bp <- boxplot(datalist, plot = FALSE) | |
quants <- sapply(datalist, function(df){ | |
quantile(df, quantiles, na.rm = T) |
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
favre <- function(model, coeff.index){ | |
favre2 <- matrix(c(1, -1, 0, 0, | |
1, 0, -1, 0, | |
1, 0, 0, -1 | |
), nrow = 3, ncol = 4, byrow = T) | |
theta.hat <- favre2 %*% as.matrix(model$coeff[coeff.index]) | |
cov.hat <- favre2 %*% vcov(model)[coeff.index, coeff.index] %*% t(favre2) |
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
############################################################## | |
## Author: Michael Sachs, michael.sachs@nih.gov | |
## Version 1.0 | |
## Date Updated: 9/16/2013 | |
# Description: An extension of the ddply function from the | |
# plyr package that additionally evaluates the user-supplied | |
# function on subsets defined by lower-order combinations of the | |
# variables. This is useful for calculating sub-totals and totals. |
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
## frequentist approach for comparison | |
freq_leaveout <- function(formula) { | |
leftout <- sapply(1:n.trials, function(i){ | |
fit.biv <- lm(formula, data = hat.test[-i, ]) | |
predict(fit.biv, newdata = hat.test)[i] | |
}) |
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
Rscript --vanilla run.R 1 > run-1.Rout | |
Rscript --vanilla run.R 2 > run-2.Rout | |
Rscript --vanilla run.R 3 > run-3.Rout | |
Rscript --vanilla run.R 4 > run-4.Rout | |
Rscript --vanilla run.R 5 > run-5.Rout | |
Rscript --vanilla run.R 6 > run-6.Rout | |
Rscript --vanilla run.R 7 > run-7.Rout | |
Rscript --vanilla run.R 8 > run-8.Rout | |
Rscript --vanilla run.R 9 > run-9.Rout | |
Rscript --vanilla run.R 10 > run-10.Rout |
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
--- | |
title: "Sparklify" | |
author: "Michael Sachs" | |
date: "November 14, 2014" | |
output: | |
html_document: | |
self_contained: false | |
--- | |
<head> | |
<script type="text/javascript" src="jquery-1.11.1.min.js"></script> |
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
tm <- data.frame(Marker = sort(rep(letters[1:5], 10)), x = runif(50), y = runif(50)) | |
p1 + geom_line(data = tm, aes(linetype = Marker, x = x, y = y), alpha = 0) + | |
scale_linetype(guide = guide_legend(override.aes = list(alpha = 1)), labels = | |
c(expression(A[1]), expression(A[2]), expression(A[3]), expression(A[4]), expression(A[5]))) + | |
theme(legend.position = c(.75, .25)) |
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
qsub -v np=52 -l walltime=424:00:00, nodes=26 simRun.bat |
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
license: mit |
OlderNewer