\HeaderA{INTlevels}{Calculate the total number of levels within a model for package
Envisage}{INTlevels}
\keyword{models}{INTlevels}
\begin{Description}\relax
This function calculates the total number of levels of all
variables and interactions within the maximal model considered in the
stepwise modelling procedure of \pkg{Envisage}.
\end{Description}
\begin{Usage}
\begin{verbatim}
  INTlevels(pData) 
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{pData}] An object of class
\code{\LinkA{phenoData}{phenoData}} containing the
phenotypic information for the experiment.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \pkg{Envisage} package contains methods allowing the use of
linear models (LMs) for analysing significantly changing genes in 
experiments with a variety of sources of variation, be they
experimentally controlled variables such as drug treatment or time, or
non-controlled sources of confounding variation such as phenotypic or
environmental differences. This allows all sources of variation to be
considered when analysing for significant differential expression,
ensuring resulting genes are biologically relevent to the experimental
question. 

The function \code{\LinkA{INTlevels}{INTlevels}} calculates the total
number of levels of all main effect and interaction terms in the
maximal model considered within the stepwise modelling procedure of
\pkg{Envisage}. If too many variables are included in the model, with a
greater total of levels than there are data points, this may result in
incorrect fitting of the model. This should be avoided by being aware
of how many degrees of freedom each variable that you want to include
will take up. If a variable of interest has a large number of possible
levels, consider combining some of these to avoid over-fitting the
data or only use this as a main effect term instead of considering all 
interactions. 

\code{\LinkA{INTlevels}{INTlevels}} is an internal function and is not
designed to be accessed by users.
\end{Details}
\begin{Value}
A vector is returned containing the total number of levels required
for each main effect and first order interation of variables within
the analysis.
\end{Value}
\begin{Author}\relax
Sam Robson \email{S.C.Robson@warwick.ac.uk}
\end{Author}
\begin{References}\relax
Robson, S. C., Hunter, E., Bird, H., Turner, H. (2008) 
\emph{Envisage: model-based significance analysis of microarray gene
expression data}, manuscript in preparation
\end{References}
\begin{SeeAlso}\relax
For the main \pkg{Envisage} method, see
\code{\LinkA{envisage}{envisage}}.
\end{SeeAlso}

