[BioC] limma lmFit error: Coefficients not estimable

Gordon K Smyth smyth at wehi.EDU.AU
Fri Mar 26 05:36:33 CET 2010

Hi Maxim,

You're trying to estimate more information than your experiment contains. 
So you have to reduce the number of columns in your matrix, and reduce the 
number of coefficients you're trying to estimate.  You could for example 
decide to treat patient as a random effect instead of fixed, so it would 
no longer be in your design matrix.  See Section 8.2 of the limma User's 

I hope in the future you might consider the limma message to be 
confirmation that the design matrix is singular!  If not, here are some 
other ways:

1. round(svd(design)$d,6) will show the matrix has three singular values 
that are exactly zero.

2. solve(crossprod(design)) will show the matrix can't be squared 
and inverted.

3. You could fitting an ordinary linear regression:

   y <- rnorm(28)

which shows there are three NA coefficients.

Best wishes

On Wed, 24 Mar 2010, Freydin, Maxim wrote:

> Dear Gordon,
> Thanks a lot. Gould you please give me an example of how to confirm the matrix singularity?
> Is there any simple way to improve the matrix?
> Best wishes,
> Maxim
> -----Original Message-----
> From: Gordon K Smyth [mailto:smyth at wehi.EDU.AU]
> Sent: 23 March 2010 23:36
> To: Freydin, Maxim
> Cc: Bioconductor mailing list
> Subject: [BioC] limma lmFit error: Coefficients not estimable
> Dear Maxim,
> Thanks for the code example.  Your design matrix really is singular, as
> can easily be confirmed in a variety of ways.  This is not a bug in limma.
> Also this not an "error".  It is a perfectly helpful diagnostic message
> that the software is giving you.
> Best wishes
> Gordon
>> Date: Wed, 17 Mar 2010 16:11:10 +0000
>> From: "Freydin, Maxim" <m.freidin at imperial.ac.uk>
>> To: "'bioconductor at stat.math.ethz.ch'"
>> 	<bioconductor at stat.math.ethz.ch>
>> Subject: [BioC] limma lmFit error: Coefficients not estimable
>> Message-ID:
>> Hello,
>> I found that the question was already answered, but the solution proposed did not work for me.
>> Could you please help to resolve an issue with limma I faced. Please see the attachment. I have a set of arrays for 4 groups of patients (Atype) taken at two time points (Visit). Every patient was analyzed twice, so they are paired and I cannot ignore this. The questions are 1) what genes are differentially expressed between time points in every group; 2) what genes are differentially expressed between disease types at V1 and V3.
>> I make a design matrix this way:
>> atype<-factor(c("lco","bri","bri","bri","con","con","con","lco","mild","mild","mild","lco","con","con","lco","bri","bri","bri","con","con","con","lco","mild","mild","mild","lco","con","con"))
>> patient<-factor(c("x1","x8","x10","x14","x17","x18","x19","x20","x24","x26","x27","x29","x31","x38","x1","x8","x10","x14","x17","x18","x19","x20","x24","x26","x27","x29","x31","x38"))
>> visit<-factor(c("v1","v1","v1","v1","v1","v1","v1","v1","v1","v1","v1","v1","v1","v1","v3","v3","v3","v3","v3","v3","v3","v3","v3","v3","v3","v3","v3","v3"))
>> fact<-paste(visit,atype,sep=".")
>> fact<-as.factor(fact)
>> design<-model.matrix(~0+fact+patient)
>> colnames(design)<-c(levels(fact),colnames(design[,9:21]))
>> cont<-makeContrasts(Mild.Bri.V1=v1.mild-v1.bri,Mild.Bri.V3=v3.mild-v3.bri,Mild.Bri.V1.V3=(v1.mild-v3.mild)-(v1.bri-v3.bri),Mild.Con.V1=v1.mild-v1.con,Mild.Con.V3=v3.mild-v3.con,Mild.Con.V1.V3=(v1.mild-v3.mild)-(v1.con-v3.con),Mild.Lco.V1=v1.mild-v1.lco,Mild.Lco.V3=v3.mild-v3.lco,Mild.Lco.V1.V3=(v1.mild-v3.mild)-(v1.lco-v3.lco),Bri.Con.V1=v1.bri-v1.con,Bri.Con.V3=v3.bri-v3.con,Bri.Con.V1.V3=(v1.bri-v3.bri)-(v1.con-v3.con),Bri.Lco.V1=v1.bri-v1.lco,Bri.Lco.V3=v3.bri-v3.lco,Bri.Lco.V1.V3=(v1.bri-v3.bri)-(v1.lco-v3.lco),Lco.Con.V1=v1.lco-v1.con,Lco.Con.V3=v3.lco-v3.con,Lco.Con.V1.V3=(v1.lco-v3.lco)-(v1.con-v3.con),levels=(design))
>> fit<-lmFit(eset.norm,design)
>>  # Coefficients not estimable: patientx27 patientx38 patientx8
>> fit2<-eBayes(contrasts.fit(fit,cont))
>> In my opinion, the design matrix looks all right, so does it mean there is a bug in limma?
>> Thanks
>> Best wishes,
>> Maxim
> ______________________________________________________________________
> The information in this email is confidential and inte...{{dropped:10}}

More information about the Bioconductor mailing list