I have run limma lmfit for continuous variable. An example of my code:-
design <- model.matrix(~ stress + age + gender + smoking + Plate , pheno) sv <- sva(getM(eset.nosex), design, vfilter = 5e4) ##surrogate varaibles design <- cbind(design, sv$sv) fit <- lmFit(getM(eset.nosex), design) fit <- eBayes(fit) names(fit)
names(fit)
[1] "coefficients" "rank" "assign" "qr"
[5] "df.residual" "sigma" "cov.coefficients" "stdev.unscaled"
[9] "pivot" "Amean" "method" "design"
[13] "df.prior" "s2.prior" "var.prior" "proportion"
[17] "s2.post" "t" "df.total" "p.value"
[21] "lods" "F" "F.p.value"
I want to check the model assumptions. Also, cause my independent variables are non-normal. I also ran a Q-Q plot for the t-statistics and p-value. But I also wish to fit a residual vs fitted plot. So I ran this:-
ResidualsMatrix <- residuals(fit, getM(eset.nosex))
Error in as.matrix(y) - fitted(object) : non-conformable arrays
but I got an error stated above which I have not been able to solve. I know it would mean the matrix sizes are different but I have used the same matrix as I used for the fit model. Can anyone advise on this problem?
Also just want to hear your thoughts:- What plot is better to assess that the lm model assumptions fit well. The Q-Q plot plotted using t-statistics or p-values? Cause both the plots do show a difference. p-value qqplot looks a little inflated. (λ = 1.25)
Thank you for your time!
Does this help? https://support.bioconductor.org/p/123835/
Thankyou. I actually did check that link before posting. Not so much.
But thanks a lot.