Plotting residuals for limma lmfit model
0
0
Entering edit mode
2.9 years ago
ritz ▴ 10

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!

linearregression limma normality residuals • 1.3k views
ADD COMMENT
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Thankyou. I actually did check that link before posting. Not so much.

But thanks a lot.

ADD REPLY

Login before adding your answer.

Traffic: 2657 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6