ebayes(fit, proportion=0.01, stdev.coef.lim=c(0.1,4), trend=FALSE, robust=FALSE, winsor.tail.p=c(0.05,0.1)) eBayes(fit, proportion=0.01, stdev.coef.lim=c(0.1,4), trend=FALSE, robust=FALSE, winsor.tail.p=c(0.05,0.1)) treat(fit, lfc=0, trend=FALSE, robust=FALSE, winsor.tail.p=c(0.05,0.1))
MArrayLMfitted model object produced by
fitcan alternatively be an unclassed list produced by
var.priorbe robustified against outlier sample variances?
xto Winsorize. Used only when
eBayesproduces an object of class
MArrayLM-class) containing everything found in
fitplus the following added components:
sigma^2. A vector if
NULL, otherwise a scalar.
sum(df.residual), whichever is smaller.
fitsimultaneously equal to zero
treata produces an
MArrayLMobject similar to
ebayesproduces an ordinary list containing the above components except for
fita fitted model object from the functions
gls.series. The fitted model object may have been processed by
contrasts.fitbefore being passed to
eBayesto convert the coefficients of the design matrix into an arbitrary number of contrasts which are to be tested equal to zero. The columns of
fitdefine a set of contrasts which are to be tested equal to zero.
The empirical Bayes moderated t-statistics test each individual contrast equal to zero. For each probe (row), the moderated F-statistic tests whether all the contrasts are zero. The F-statistic is an overall test computed from the set of t-statistics for that probe. This is exactly analogous the relationship between t-tests and F-statistics in conventional anova, except that the residual mean squares and residual degrees of freedom have been moderated between probes.
df.prior are computed by
s2.post is the weighted average of
sigma^2 with weights proportional to
lods is sometimes known as the B-statistic.
F are computed by
eBayes doesn't compute ordinary (unmoderated) t-statistics by default, but these can be easily extracted from
the linear model output, see the example below.
ebayes is the earlier and leaner function, kept for backwards compatibility, while
eBayes is the later more object-orientated version.
The difference is that
ebayes outputs only the empirical Bayes statistics whereas
eBayes adds them to the fitted model object
eBayes is recommended for routine use as it produces objects containing all the necessary components for downstream analysis
treat computes empirical Bayes moderated-t p-values relative to a minimum required fold-change threshold.
topTreat to summarize output from
Instead of testing for genes which have log-fold-changes different from zero, it tests whether the log2-fold-change is greater than
lfc in absolute value (McCarthy and Smyth, 2009).
treat is concerned with p-values rather than posterior odds, so it does not compute the B-statistic
The idea of thresholding doesn't apply to F-statistics in a straightforward way, so moderated F-statistics are also not computed.
trend=TRUE then an intensity-dependent trend is fitted to the prior variances
squeezeVar is called with the
covariate equal to
Amean, the average log2-intensity for each gene.
squeezeVar for more details.
robust=TRUE then the robust empirical Bayes procedure of Phipson et al (2016) is used.
squeezeVar for more details.
Loennstedt, I., and Speed, T. P. (2002). Replicated microarray data. Statistica Sinica 12, 31-46.
Phipson, B, Lee, S, Majewski, IJ, Alexander, WS, and Smyth, GK (2016). Robust hyperparameter estimation protects against hypervariable genes and improves power to detect differential expression. Annals of Applied Statistics 10. http://arxiv.org/abs/1602.08678
Smyth, G. K. (2004). Linear models and empirical Bayes methods for assessing differential expression in microarray experiments. Statistical Applications in Genetics and Molecular Biology, Volume 3, Article 3. http://www.statsci.org/smyth/pubs/ebayes.pdf
An overview of linear model functions in limma is given by 06.LinearModels.
# See also lmFit examples # Simulate gene expression data, # 6 microarrays and 100 genes with one gene differentially expressed set.seed(2004); invisible(runif(100)) M <- matrix(rnorm(100*6,sd=0.3),100,6) M[1,] <- M[1,] + 1 fit <- lmFit(M) # Moderated t-statistic fit <- eBayes(fit) topTable(fit) # Ordinary t-statistic ordinary.t <- fit$coef / fit$stdev.unscaled / fit$sigma # Q-Q plots of t statistics # Points off the line may be differentially expressed par(mfrow=c(1,2)) qqt(ordinary.t, df=fit$df.residual, main="Ordinary t") abline(0,1) qqt(fit$t, df=fit$df.total,main="Moderated t") abline(0,1) par(mfrow=c(1,1))
Run the code above in your browser using DataCamp Workspace