The R code for dmpFinder suggests that it is already doing this; can someone please confirm whether this interpretation is correct?
When shrinkVar=FALSE (assume type="categorical"), dmpFinder seems to be running an F-test comparing a null model to a full model:
if (type == "categorical") {
pheno <- factor(as.character(pheno))
design <- model.matrix(~pheno)
fit <- lmFit(M, design) # full model
if (shrinkVar) {
fit <- contrasts.fit(fit, contrasts(pheno))
fit <- eBayes(fit)
tab <- data.frame(intercept=fit$coefficients[, 1], f=fit$F, pval=fit$F.p.value)
} else {
fit1 <- lmFit(M) # null model
RSS1 <- rowSums((M - fitted(fit1))^2)
RSS <- rowSums((M - fitted(fit))^2)
df1 <- length(levels(pheno)) - 1
df2 <- n - length(levels(pheno))
F <- ((RSS1 - RSS)/df1)/(RSS/df2)
if (df2 > 1e+06) {
F.p.value <- pchisq(df1 * F, df1, lower.tail=FALSE)
}
else {
F.p.value <- pf(F, df1, df2, lower.tail=FALSE)
}
tab <- data.frame(intercept=fit$coefficients[, 1], f=F, pval=F.p.value)
}
Does this mean batch effects are implicitly controlled for in this situation? If batch effects are all we want to control for, is there any value to doing SVA in addition?