\HeaderA{model.matrix.reStruct}{reStruct Model Matrix}{model.matrix.reStruct}
\keyword{models}{model.matrix.reStruct}
\begin{Description}\relax
The model matrices for each element of \code{formula(object)},
calculated using \code{data}, are bound together column-wise. When
multiple grouping levels are present (i.e. when \code{length(object) >
    1}), the individual model matrices are combined from innermost (at
the leftmost position) to outermost (at the rightmost position).
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'reStruct':
model.matrix(object, data, contrast, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object inheriting from class \code{reStruct},
representing a random effects structure and consisting of a list of
\code{pdMat} objects.
\item[\code{data}] a data frame in which to evaluate the variables defined in
\code{formula(object)}.
\item[\code{contrast}] an optional named list specifying the contrasts to be used
for representing the \code{factor} variables in \code{data}. The
components names should match the names of the variables in
\code{data} for which the contrasts are to be specified. The
components of this list will be used as the \code{contrasts}
attribute of the corresponding factor. If missing, the default
contrast specification is used.
\item[\code{...}] some methods for this generic require additional
arguments.  None are used in this method.
\end{ldescription}
\end{Arguments}
\begin{Value}
a matrix obtained by binding together, column-wise, the model matrices
for each element of \code{formula(object)}.
\end{Value}
\begin{Author}\relax
Jose Pinheiro \email{Jose.Pinheiro@pharma.novartis.com} and Douglas Bates \email{bates@stat.wisc.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{model.matrix}{model.matrix}}, \code{\LinkA{contrasts}{contrasts}},
\code{\LinkA{reStruct}{reStruct}}, \code{\LinkA{formula.reStruct}{formula.reStruct}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
rs1 <- reStruct(list(Dog = ~day, Side = ~1), data = Pixel)
model.matrix(rs1, Pixel)
\end{ExampleCode}
\end{Examples}

