R/arrayWeightsQuick.R

Defines functions arrayWeightsQuick

Documented in arrayWeightsQuick

arrayWeightsQuick <- function(y, fit)
#	Compute approximate array quality weights from a MArrayLM object
#	Gordon Smyth
#	25 Oct 2004.  Last revised 28 Oct 2004.
{
	if(!is.null(fit$weights)) warning("spot quality weights found but not taken into account")
	res <- as.matrix(y)- fit$coefficients %*% t(fit$design)
	h <- hat(fit$design, intercept=FALSE)
	mures2 <- fit$sigma^2 %*% array(1-h,c(1,length(h)))
	1/colMeans(res*res/mures2,na.rm=TRUE)
}

Try the limma package in your browser

Any scripts or data that you put into this service are public.

limma documentation built on Nov. 8, 2020, 8:28 p.m.