% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/eBayesFMT.R
\name{eBayesFMT}
\alias{eBayesFMT}
\title{Empirical Bayes Fully Moderated t-statistics}
\usage{
eBayesFMT(fit, data, Individual, method = c("VC", "WS"))
}
\arguments{
\item{fit}{model fit returned by dream of class MArrayLM2}

\item{data}{data.frame with columns corresponding to formula}

\item{Individual}{string referring to column in data.frame indicating which individual the repeated measures come from}

\item{method}{Use either variance components ('VC') or Welch-Satterthwaite ('WS')}
}
\description{
Empirical Bayes Fully Moderated t-statistics from linear mixed model fit with dream
}
\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{
# 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 )

}
\keyword{internal}
