Hi All,
I need some advice on the R code for the limma model. I was running a linear model using limma. But I was wondering how to account for missing values in the covariates. For example:-
Blockquote
design <- model.matrix (~ Stress + Gender + Age + Smoking + BMI + sleep + blood cell types + PCS, pheno) fit <- lmFit(mvals , design)
Error: row dimension of design doesn't match column dimension of data object
dim(mvals) [1] 751 795669 dim(design) [1] 721 47
so for example stress has 1 missing value, BMI has 1 missing value, smoking had 3, sleep has 25.
I was wondering how to account for this in the fit command? I have previously used: fit <- lmFit(mvals[,!is.na(pheno$stress)], design) but I get errors when I do add more covariates missing values.
It would be great if someone could help me out!
Thankyou!