Code:
# Creation of robust model
design <-model.matrix(~Class+ PC1 + PC2 + PC3)
fit.robust <- lmFit(EL_bc_norm_0, design, method = "robust", maxit=500)
fit.robust.eBayes <- eBayes(fit.robust)
I am trying to extract the residuals out of the above model (named design) relating to each gene and subject. But because there isn't a "y" argument in the model.matrix() function, I am unable to use resid(). From what I understand (my background in statistics is weak) model.matrix()
is actually finding the parameter estimates, which will later be use by topTable()
to find group differences.
One thread says there no reason to examine residuals for microarray data (https://support.bioconductor.org/p/19622/) but nonetheless, I've been asked to do so.
Looking at another guide (http://jtleek.com/genstats/inst/doc/02_11_many-regressions.html) the traditional non-robust fitted model contains "residuals" but they seem to be absent in my fitted model (All I have is df.residual).
I can use "residuals(fit.robust, EL_bc_norm_0)". This appears to work but I am a bit hesitant about what I am doing.
Thank you!