\HeaderA{stat.ma}{Calculation of log Intensity Ratios and Average log Intensities}{stat.ma}
\aliasA{ma.func}{stat.ma}{ma.func}
\aliasA{norm.l.func}{stat.ma}{norm.l.func}
\aliasA{norm.pin.func}{stat.ma}{norm.pin.func}
\aliasA{norm.scale.func}{stat.ma}{norm.scale.func}
\keyword{datagen}{stat.ma}
\begin{Description}\relax
Computes the log intensity ratio \eqn{M = log_2 (R/G)}{} and the mean log
intensity \eqn{A = log_2 \sqrt{RG}}{A = log_2(R*G)/2}, where R and G
represent the fluorescence
intensities in the red and green channels, respectively. Logarithms base
2 are used instead of natural or decimal logarithms as intensities are
typically integers between 1 and \eqn{2^{16}}{}. The log intensity
ratios M are normalized using one of the five available methods.
\end{Description}
\begin{Usage}
\begin{verbatim}
stat.ma(RG, layout, norm="p", pout=FALSE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{RG}] a list with 4 elements, each represents a matrix with p rows for p
genes and n columns for n slides. \\
The first element "R" contains the raw red intensities from slide
i=1,...,n .\\
Similarly, the second element "G" contains the raw green
intensities. \\
The third element "Rb"  contains the background red intensities and \\
the fourth element "Gb" contains the  background green intensities.\\
This list structure can be generated by the interactive function
\code{\LinkA{init.data}{init.data}}. 
\item[\code{layout}] a list specifying the dimensions of the spot matrix
and the grid  
matrix.  This can be generated by calling \code{\LinkA{init.grid}{init.grid}}.
\item[\code{norm}] Character string, one of "n", "m", "l", "p" or "s".  This
argument specifies the type of normalization method to be performed:
"n" no normalization between the 2 channels; "m"
\code{\LinkA{median}{median}} normalization, which sets the median of log
intensity ratios to zero; "l" global \code{\LinkA{lowess}{lowess}}
normalization; "p" print-tip group lowess normalization and "s"
scaled print-tip group lowess normalization. The default method is
set to print-tip normalization.
\item[\code{pout}] if TRUE, an M vs. A plot will be produced. Otherwise,
a matrix of log intensity ratios and average log intensities is
return.  By default pout is set to FALSE.  The option pout='TURE'
is not yet implemented.
\item[\code{...}] other parameters used in \code{\LinkA{ma.func}{ma.func}}. 
\end{ldescription}
\end{Arguments}
\begin{Value}
List containing the following components:

\begin{ldescription}
\item[\code{M}] Matrix of log expression ratios \eqn{M = log_2 (R/G)}{}
\item[\code{A}] Matrix of average log intensities \eqn{A = log_2
\sqrt{RG}}{A = log_2(R*G)/2}
\end{ldescription}

For the matrix in each of the components, rows correspond to genes
and columns correspond to different hybridizations, that is
different slides.
\end{Value}
\begin{Note}\relax
\code{\LinkA{ma.func}{ma.func}}, \code{\LinkA{norm.l.func}{norm.l.func}},
\code{\LinkA{norm.scale.func}{norm.scale.func}} and \code{\LinkA{norm.pin.func}{norm.pin.func}} are called by \code{\LinkA{stat.ma}{stat.ma}} and are not typically used on their own.
\end{Note}
\begin{Author}\relax
Yee Hwa Yang, \email{yeehwa@stat.berkeley.edu} \\
Sandrine Dudoit, \email{sandrine@stat.berkeley.edu} \\
Natalie Roberts, \email{nroberts@wehi.edu.au}
\end{Author}
\begin{References}\relax
S. Dudoit, Y. H. Yang, M. J. Callow, and T. P. Speed. Statistical
methods for identifying differentially expressed genes in replicated
cDNA microarray experiments (Statistics, UC Berkeley, Tech Report \# 578).
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{ma.func}{ma.func}}, \code{\LinkA{norm.l.func}{norm.l.func}},
\code{\LinkA{norm.pin.func}{norm.pin.func}}, \code{\LinkA{norm.scale.func}{norm.scale.func}}, \code{\LinkA{plot.mva}{plot.mva}}, \code{\LinkA{lowess}{lowess}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(MouseArray)
## mouse.setup <- init.grid() 
## mouse.data <- init.data() ## see \emph{init.data} 
mouse.lratio <- stat.ma(mouse.data, mouse.setup)
\end{ExampleCode}
\end{Examples}

