Last active
April 14, 2016 19:32
-
-
Save Jfortin1/b7c9ad83459fd7363fd78ba8ae53cf65 to your computer and use it in GitHub Desktop.
Wrapper for vash
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
# Wrapper to calculate t-statistic from vash with one covariate | |
getVashT <- function(x, mod, df=NULL, ...){ | |
require(vashr) | |
require(limma) | |
fit <- lmFit(x, mod) | |
if (is.null(df)){ | |
df <- ncol(x)-1 | |
} | |
temp <- vash(sehat = fit$sigma, df=df, ...) | |
temp <- fit$coef[,2] / temp$sd.post / fit$stdev.unscaled[,2] | |
temp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment