I am trying to perform some linear regressions with respect to some covariates in limma so that I can predict expression values after controling for 2 covariates,
Efactor. Basically, this is my sample setup:
Afactor Efactor sample1 a1 e2 sample2 a0 e1 sample3 a0 e2 sample4 a1 e0 sample5 a1 e0 sample6 a1 e1 ...
Afactor is a factor with 2 unique values
Efactor is a factor with 3 unique values
e3. To fit it, I'm using limma as follows:
design=model.matrix('~0 + Afactor + Efactor', my_metadata) fit= lmFit(my_data, design)
This allows me to find the fitting coefficients with
fit$coefficients, that resemble the following:
>head(fit$coefficients) Afactora1 Afactora2 Efactore1 Efactore2 gene1 2.3 3.7 -1.3 0.9 gene2 1.1 2.1 -2.5 2.1 gene3 1.3 3.1 0.2 1.3
- Note that there is no coefficient for
Efactore3, but why is that so?
- Does this have to do with the fact that possible factors for Efactor are
- Shouldn't it be possible to extract the coefficient for
e3so that I could use each coefficient to estimate gene expression from the fitted model by imputing the values of
Efactorfor each sample?