mvTest | R Documentation |
dream()
Evaluate multivariate tests on results from dream()
using vcov()
to compute the covariance between estimated regression coefficients across multiple responses. A joint test to see if the coefficients are jointly different from zero is performed using meta-analysis methods that account for the covariance.
mvTest(
fit,
vobj,
features,
coef,
method = c("FE.empirical", "FE", "RE2C", "tstat", "hotelling", "sidak", "fisher"),
shrink.cov = TRUE,
BPPARAM = SerialParam(),
...
)
## S4 method for signature 'MArrayLM,EList,vector'
mvTest(
fit,
vobj,
features,
coef,
method = c("FE.empirical", "FE", "RE2C", "tstat", "hotelling", "sidak", "fisher"),
shrink.cov = TRUE,
BPPARAM = SerialParam(),
...
)
## S4 method for signature 'MArrayLM,EList,missing'
mvTest(
fit,
vobj,
features,
coef,
method = c("FE.empirical", "FE", "RE2C", "tstat", "hotelling", "sidak", "fisher"),
shrink.cov = TRUE,
BPPARAM = SerialParam(),
...
)
## S4 method for signature 'MArrayLM,EList,list'
mvTest(
fit,
vobj,
features,
coef,
method = c("FE.empirical", "FE", "RE2C", "tstat", "hotelling", "sidak", "fisher"),
shrink.cov = TRUE,
BPPARAM = SerialParam(),
...
)
## S4 method for signature 'mvTest_input,ANY,ANY'
mvTest(
fit,
vobj,
features,
coef,
method = c("FE.empirical", "FE", "RE2C", "tstat", "hotelling", "sidak", "fisher"),
shrink.cov = TRUE,
BPPARAM = SerialParam(),
...
)
## S4 method for signature 'MArrayLM,matrix,ANY'
mvTest(
fit,
vobj,
features,
coef,
method = c("FE.empirical", "FE", "RE2C", "tstat", "hotelling", "sidak", "fisher"),
shrink.cov = TRUE,
BPPARAM = SerialParam(),
...
)
fit |
|
vobj |
matrix or |
features |
a) indeces or names of features to perform multivariate test on, b) list of indeces or names. If missing, perform joint test on all features. |
coef |
name of coefficient or contrast to be tested |
method |
statistical method used to perform multivariate test. See details. |
shrink.cov |
shrink the covariance matrix between coefficients using the Schafer-Strimmer method |
BPPARAM |
parameters for parallel evaluation |
... |
other arugments |
See package remaCor
for details about the remaCor::RE2C()
test, and see remaCor::LS()
for details about the fixed effect test. When only 1 feature is selected, the original p-value is returned and the test statistic is set to NA
.
For the "RE2C"
test, the final test statistic is the sum of a test statistic for the mean effect (stat.FE
) and heterogeneity across effects (stat.het
). mvTest()
returns 0 if stat.het
is negative in extremely rare cases.
Returns a data.frame
with the statistics from each test, the pvalue
from the test, n_features
, method
, and lambda
from the Schafer-Strimmer method to shrink the estimated covariance. When shrink.cov=FALSE
, lambda = 0
.
# library(variancePartition)
library(edgeR)
library(BiocParallel)
data(varPartDEdata)
# normalize RNA-seq counts
dge <- DGEList(counts = countMatrix)
dge <- calcNormFactors(dge)
# specify formula with random effect for Individual
form <- ~ Disease + (1 | Individual)
# compute observation weights
vobj <- voomWithDreamWeights(dge[1:20, ], form, metadata)
# fit dream model
fit <- dream(vobj, form, metadata)
fit <- eBayes(fit)
# Multivariate test of features 1 and 2
mvTest(fit, vobj, 1:2, coef = "Disease1")
# Test multiple sets of features
lst <- list(a = 1:2, b = 3:4)
mvTest(fit, vobj, lst, coef = "Disease1", BPPARAM = SnowParam(2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.