\HeaderA{predict.gls}{Predictions from a gls Object}{predict.gls}
\keyword{models}{predict.gls}
\begin{Description}\relax
The predictions for the linear model represented by \code{object} are
obtained at the covariate values defined in \code{newdata}.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'gls':
predict(object, newdata, na.action, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object inheriting from class \code{gls}, representing
a generalized least squares fitted linear model.
\item[\code{newdata}] an optional data frame to be used for obtaining the
predictions. All variables used in the linear model must be present
in the data frame. If missing, the fitted values are returned.
\item[\code{na.action}] a function that indicates what should happen when
\code{newdata} contains \code{NA}s.  The default action
(\code{na.fail}) causes the function to print an error message and
terminate if there are any incomplete observations.
\item[\code{...}] some methods for this generic require additional
arguments.  None are used in this method.
\end{ldescription}
\end{Arguments}
\begin{Value}
a vector with the predicted values.
\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{gls}{gls}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary,
           correlation = corAR1(form = ~ 1 | Mare))
newOvary <- data.frame(Time = c(-0.75, -0.5, 0, 0.5, 0.75))
predict(fm1, newOvary)
\end{ExampleCode}
\end{Examples}

