Learn R Programming

missMethyl (version 1.6.2)

RUVadj: Adjust estimated variances

Description

Calculate rescaled variances, empirical variances, etc. For use with RUV model fits produced using RUVfit.

Usage

RUVadj(fit, ebayes = TRUE, evar = FALSE, rsvar = FALSE, ...)

Arguments

fit
An object of class MArrayLM as returned by RUVfit.
ebayes
A logical variable. Should empirical bayes estimates be calculated?
evar
A logical variable. Should empirical variance estimates be calculated?
rsvar
A logical variable. Should rescaled variance estimates be calculated?
...
additional arguments that can be passed to variance_adjust. See linked function documentation for details.

Value

  • An object of class MArrayLM containing:
  • coefficientsThe estimated coefficients of the factor(s) of interest.
  • sigma2Estimates of the features' variances.
  • tt statistics for the factor(s) of interest.
  • pP-values for the factor(s) of interest.
  • multiplierThe constant by which sigma2 must be multiplied in order to get an estimate of the variance of coefficients
  • dfThe number of residual degrees of freedom.
  • WThe estimated unwanted factors.
  • alphaThe estimated coefficients of W.
  • byxThe coefficients in a regression of Y on X (after both Y and X have been "adjusted" for Z). Useful for projection plots.
  • bwxThe coefficients in a regression of W on X (after X has been "adjusted" for Z). Useful for projection plots.
  • XX. Included for reference.
  • kk. Included for reference.
  • ctlctl. Included for reference.
  • ZZ. Included for reference.
  • fullW0Can be used to speed up future calls of RUVfit.
  • The following items may or may not be present depending on the options selected when RUVadj was run:
  • p.rsvarP-values, after applying the method of rescaled variances.
  • p.evarP-values, after applying the method of empirical variances.
  • p.ebayesP-values, after applying the empirical bayes method of Smyth (2004).
  • p.rsvar.ebayesP-values, after applying the empirical bayes method of Smyth (2004) and the method of rescaled variances.
  • p.BHP-values adjusted for false discovery rate (FDR) using the method of Benjamini and Hochberg (1995).
  • p.rsvar.BHFDR-adjusted p-values, after applying the method of rescaled variances.
  • p.evar.BHFDR-adjusted p-values, after applying the method of empirical variances.
  • p.ebayes.BHFDR-adjusted p-values, after applying the empirical bayes method of Smyth (2004).
  • p.rsvar.ebayes.BHFDR-adjusted p-values, after applying the empirical bayes method of Smyth (2004) and the method of rescaled variances.

Details

Adjust variance. By default only the empirical bayes method of Smyth (2004) is performed.

References

Benjamini, Y., and Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society Series, B, 57, 289-300.

Gagnon-Bartsch JA, Speed TP. (2012). Using control genes to correct for unwanted variation in microarray data. Biostatistics. 13(3), 539-52. Available at: http://biostatistics.oxfordjournals.org/content/13/3/539.full.

Gagnon-Bartsch, Jacob, and Speed. {2013}. Removing Unwanted Variation from High Dimensional Data with Negative Controls. Available at: http://statistics.berkeley.edu/tech-reports/820.

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.

See Also

MArrayLM, RUV2, RUV4, RUVinv, RUVrinv, p.adjust, get_empirical_variances, sigmashrink

Examples

Run this code
if(require(minfi) & require(minfiData) & require(limma)) {

# Get methylation data for a 2 group comparison
meth <- getMeth(MsetEx)
unmeth <- getUnmeth(MsetEx)
Mval <- log2((meth + 100)/(unmeth + 100))

group<-factor(pData(MsetEx)$Sample_Group)
design<-model.matrix(~group)

# Perform initial analysis to empirically identify negative control features 
# when not known a priori
lFit = lmFit(Mval,design)
lFit2 = eBayes(lFit)
lTop = topTable(lFit2,coef=2,num=Inf)

# The negative control features should *not* be associated with factor of interest
# but *should* be affected by unwanted variation 
ctl = rownames(Mval) %in% rownames(lTop[lTop$adj.P.Val > 0.5,])

# Perform RUV adjustment and fit
fit = RUVfit(data=Mval, design=design, coef=2, ctl=ctl)
fit2 = RUVadj(fit)

# Look at table of top results
top = topRUV(fit2)
}

Run the code above in your browser using DataLab