eBayesFMT: Empirical Bayes Fully Moderated t-statistics

Description Usage Arguments Details Examples

View source: R/eBayesFMT.R

Description

Empirical Bayes Fully Moderated t-statistics from linear mixed model fit with dream

Usage

1
eBayesFMT(fit, data, Individual, method = c("VC", "WS"))

Arguments

fit

model fit returned by dream of class MArrayLM2

data

data.frame with columns corresponding to formula

Individual

string referring to column in data.frame indicating which individual the repeated measures come from

method

Use either variance components ('VC') or Welch-Satterthwaite ('WS')

Details

Applies empirical Bayes method of, Yu, et al. (2019) for linear mixed models. This method applies a prior and shrinkage to 1) the residual variance and 2) the variance component estimates for 'Individual'. 'Individual' refers to the variable indicating which individual the repeated measures come from. This method then combines posterior values from (1) and (2) to approximate the degrees of freedom for the t-statistic.

Yu, L., Zhang, J., Brock, G. et al. Fully moderated t-statistic in linear modeling of mixed effects for differential expression analysis. BMC Bioinformatics 20, 675 (2019). https://doi.org/10.1186/s12859-019-3248-9

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# load library
# library(variancePartition)
library(BiocParallel)
register(SerialParam())

# load simulated data:
# geneExpr: matrix of gene expression values
# info: information/metadata about each sample
data(varPartData)

form <- ~ Batch + (1|Individual) + (1|Tissue) 

# Fit linear mixed model for each gene
# run on just 10 genes for time
fit = dream( geneExpr[1:10,], form, info)

# view top genes using standard t-statistics
topTable( fit )

# Compute moderated t-statistics from Yu, et al, 2019
fiteb = variancePartition:::eBayesFMT(fit, info, 'Individual')
topTable( fiteb )

variancePartition documentation built on Nov. 8, 2020, 5:18 p.m.