\HeaderA{designI2M}{Convert Individual Channel Design Matrix to M-A Format}{designI2M}
\aliasA{designI2A}{designI2M}{designI2A}
\keyword{regression}{designI2M}
\begin{Description}\relax
Convert a design matrix in terms of individual channels to ones in terms of M-values or A-values for two-color microarray data.
\end{Description}
\begin{Usage}
\begin{verbatim}
designI2M(design)
designI2A(design)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{design}] numeric model matrix with one row for each channel observation, i.e., twice as many rows as arrays
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If \code{design} is a model matrix suitable for modelling individual log-intensities for two color microarray data, then \code{designI2M} computes the corresponding model matrix for modelling M-values (log-ratios) and \code{designI2A} computes the model matrix for modelling A-values (average log-intensities).

Note that the matrices \code{designI2M(design)} or \code{designI2A(design)} may be singular if not all of the coefficients are estimable from the M or A-values.
In that case there will be columns containing entirely zeros.
\end{Details}
\begin{Value}
numeric model matrix with half as many rows as \code{design}
\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{model.matrix}{model.matrix}} in the stats package.

An overview of individual channel linear model functions in limma is given by \LinkA{07.SingleChannel}{07.SingleChannel}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
X <- cbind(1,c(1,1,1,1,0,0,0,0),c(0,0,0,0,1,1,1,1))
designI2M(X)
designI2A(X)
\end{ExampleCode}
\end{Examples}


