**0**wrote:

Hi there,

I am building a linear model to analyze the expression profiles of cvd and non-cvd subjects. There are 227 samples here.

When fitting the model:

```
design = model.matrix(~ race + age + bmi + gender + batch + cvd + subject)
```

fit = lmFit(voomOutput, design)
fit = eBayes(fit)
tt = topTable(fit, number=Inf, genelist=gl, coef="cvd1.0")

Then I got the error:

Coefficients not estimable: subjectGTEX-139TT subjectGTEX-RU72 subjectGTEX-ZAJG subjectGTEX-ZDXO subjectGTEX-ZYFD subjectGTEX-ZYY3 subjectGTEX-ZZPT Coefficients not estimable: subjectGTEX-139TT subjectGTEX-RU72 subjectGTEX-ZAJG subjectGTEX-ZDXO subjectGTEX-ZYFD subjectGTEX-ZYY3 subjectGTEX-ZZPT Error in .ebayes(fit = fit, proportion = proportion, stdev.coef.lim = stdev.coef.lim, : No residual degrees of freedom in linear model fits In addition: Warning message: Partial NA coefficients for 30333 probe(s)

And

> str(design) num [1:227, 1:158] 1 1 1 1 1 1 1 1 1 1 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:227] "1" "2" "3" "4" ... ..$ : chr [1:158] "(Intercept)" "race2" "race3" "race99" ... - attr(*, "assign")= int [1:158] 0 1 1 1 2 3 4 5 5 5 ... - attr(*, "contrasts")=List of 5 ..$ race : chr "contr.treatment" ..$ gender : chr "contr.treatment" ..$ batch : chr "contr.treatment" ..$ cvd : chr "contr.treatment" ..$ subject: chr "contr.treatment"

> head(subject) [1] GTEX-111FC GTEX-1128S GTEX-117XS GTEX-1192X GTEX-11DXW GTEX-11DXY 148 Levels: GTEX-111FC GTEX-1128S GTEX-117XS GTEX-1192X GTEX-11DXW GTEX-11DXY ... GTEX-ZZPT

It seems that there is something wrong in the design matrix, I see the same questions in other posts and learn that "No residual degrees of freedom in linear model fits" means no sample has replicates.

But I am still a bit confused about what causes this error in my case. And how can I resolve it?

Thanks.

edit:

> sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.1 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib locale: [1] C attached base packages: [1] parallel stats graphics grDevices utils datasets methods base other attached packages: [1] gplots_3.0.1 metagenomeSeq_1.20.1 glmnet_2.0-13 Matrix_1.2-12 [5] RColorBrewer_1.1-2 doParallel_1.0.11 iterators_1.0.9 foreach_1.4.4 [9] limma_3.34.9 Biobase_2.38.0 BiocGenerics_0.24.0 loaded via a namespace (and not attached): [1] lattice_0.20-35 matrixStats_0.53.1 codetools_0.2-15 gtools_3.5.0 [5] bitops_1.0-6 grid_3.4.2 KernSmooth_2.23-15 gdata_2.18.0 [9] tools_3.4.2 compiler_3.4.2 caTools_1.17.1

Post your session information. Make sure you're using the latest version of

limma(3.34.9).19k