This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem in identifying model matrix

Hi all,

I am working on a RNA-Seq data where my factor set looks like the following:

Type       Patient            Time
C             3                T0
C             3                T1
C             8                T0
C             8                T1
C             9                T0
C             9                T1
C            10                T0
C            10                T1
C             5                T1
C            11                T1
A            1                 T0
A            1                 T1
A            4                 T0
A            4                 T1
A            6                 T0
A            6                 T1
A            7                 T0
A            2                 T1

Here, I want to see the change in expression at time T1 between C and A.

I tried to specify the model matrix in edgeR as:

design <- model.matrix(~Type+patient+Type:Time)

But, when I tried to use "estimateGLMCommonDisp" command, it shows an error saying that the design is not of full rank.

Could anyone please help me by correcting my model matrix?

Thanks in advance!

rna-seq r software error edger modelmatrix

Hint: Type is a linear combination of patient, which is causing the error.

Patient is nested within Type. I want to consider Patient as a block effect while testing for change at time T1 between C and A. Just can't reach the exact idea here!

Is the lowercase patient here a typo?

design <- model.matrix(~Type+patient+Type:Time)

It appears in uppercase in the matrix

Nope. It's all good in the case. It is actually patient, I wrote here with upper-case! Problem is in specifying the model matrix.

1 answer

What I was trying to get at with my hint is that if you include patient you then have no use for Type (the Type effect is completely determined by the patient effect). So ~patient+Type:Time.

BTW, you'll probably need to get rid of some patients too. There are 4 (2, 5, 7, and 11) that are uninformative.

It's still showing the same problem, even after getting rid of these patients !!

Error in glmFit.default(y, design = design, dispersion = dispersion, offset = offset,  :
  Design matrix not of full rank.  The following coefficients not estimable:
 TypeA:TimeT1 TypeC:TimeT1

This is the error I'm getting.

If you keep time as a factor, then you're asking the model to fit a coefficient for the each of the 4 Type:Time combinations. Consequently, you have things like TypeA:T0 and TypeA:T1, which are the sum of patients in the TypeA group. If you instead use Type as a numeric, then you'll find that it works (and it should answer the question you want).

Log in to answer this question.