[BioC] loop design matrix

Gordon K Smyth smyth at wehi.EDU.AU
Thu Jan 12 12:59:58 CET 2006


> Date: Wed, 11 Jan 2006 10:50:16 -0700
> From: Matthew Scholz <schmatthew at gmail.com>
> Subject: [BioC] loop design matrix
> To: bioconductor at stat.math.ethz.ch
>
> I'm confused about my design matrix for a loop design experiment. This is a
> six-membered direct design that can be drawn as a hexagram inscribed in a
> hexagon (where the corners are treatments, obviously).
>
> Here is what my targets look like:
>
> Cy3 Cy5
> A   B
> B   C
> C   D
> D   E
> E  RC
> RC   A
> A   C
> B   D
> C   E
> D  RC
> E   A
> RC   B
>
> There are three ways I can conceive of constructing my design matrix for
> this. The first is to use the modelMatrix function with the parameters
> argument, but I don't really understand how this should be done, and this
> might be my problem. The second is to declare an arbitrary reference and use
> the modelMatrix function, as described in the user's manual:
>
> designmatrix <- modelMatrix(targets, ref="RC")
>
> When I do this I get the following design matrix
>
> A  B  C  D  E
> -1  1  0  0  0
> 0 -1  1  0  0
> 0  0 -1  1  0
> 0  0  0 -1  1
> 0  0  0  0 -1
> 1  0  0  0  0
> -1  0  1  0  0
> 0 -1  0  1  0
> 0  0 -1  0  1
> 0  0  0 -1  0
> 1  0  0  0 -1
> 0  1  0  0  0

This design matrix is perfectly correct.

> Which is fine, except when I use this to fit my data:
>
> designfit <- lmFit(RG, design=designmatrix, method="ls")
>
> I see the following annotation in the generated data:
>
> Warning message:
> design matrix is singular

The warning message you report cannot be produced by the command that you give.  This particular
warning can only be produced by subsetting your data object to reduce the number of arrays, which
you must have done elsewhere during your R session.  Your confusion seems to be simply that you
are not keeping track correctly of which commands produce which output.

>>From reading threads on the listserv, I understand this to mean that some of
> the coefficients are non-estimable, but I don't know why this is the case.
> So as a third possibility, I thought I might create my own design matrix.  I
> came up with the following matrix, which is apparently also wrong:
>
>        A  B  C  D  E RC
>  [1,]  1 -1  0  0  0  0
>  [2,]  0  1 -1  0  0  0
>  [3,]  0  0  1 -1  0  0
>  [4,]  0  0  0  1 -1  0
>  [5,]  0  0  0  0  1 -1
>  [6,] -1  0  0  0  0  1
>  [7,]  1  0 -1  0  0  0
>  [8,]  0  1  0 -1  0  0
>  [9,]  0  0  1  0 -1  0
> [10,]  0  0  0  1  0 -1
> [11,] -1  0  0  0  1  0
> [12,]  0 -1  0  0  0  1
>
> I say it's apparently wrong because when I fit the data, I get the
> following:
>
>> designfittest = lmFit(RGAn, design=design, method="ls")
> Coefficients not estimable: RC
>
> Is this due to the same singularity problem?

Before there was no singularity problem.  Now there is.

> I did note on another web site
> (http://discover.nci.nih.gov/microarrayAnalysis/Experimental.Design.jsp)
> that it is sometimes desirable to append the matrix with a row of 1's to
> force a single solution to the fit and wondered if this was what I was
> missing.

There's no need for this.  If there was a need, it was say so in the User's Guide.

>  I know a few other people who are struggling with this same type
> of issue, and we'd all love some clarification.
>
> Thanks,
> Matt

Has the above clarified the matter?  Otherwise I'm a bit at a loss because the package gave you
the correct design matrix first up, and correctly reported when you did something wrong.  You
could proceed as in the example in section 7.4 of the User's Guide.  What else would help?

Best wishes
Gordon



More information about the Bioconductor mailing list