\Header{predict.lm}{Predicting from Linear Model Fits}
\alias{predict.mlm}{predict.lm}
\keyword{regression}{predict.lm}
\begin{Usage}
\begin{verbatim}
predict[.lm](object, newdata = model.frame(object), se.fit = FALSE,  
             scale = NULL, df = Inf, 
             interval = c("none", "confidence", "prediction"), level = 0.95)
\end{verbatim}
\end{Usage}
\begin{Description}
\texttt{predict.lm} produces predicted values, obtained by evaluating
the regression function in the frame \texttt{newdata}.  If the logical
\texttt{se.fit} is \texttt{TRUE}, standard errors of the predictions are
calculated.  If the numeric argument \texttt{scale} is set (with optional
\texttt{df}), it is used as the residual standard deviation in the
computation of the standard errors, otherwise this is extracted from
the model fit.  Setting \texttt{intervals} specifies computation of
confidence or prediction (tolerance) intervals at the specified
\texttt{level}.\end{Description}
\begin{Value}
\texttt{predict.lm} produces a vector of predictions or a matrix of
predictions and bounds with column names \texttt{fit}, \texttt{lwr}, and
\texttt{upr} if \texttt{interval} is set. If \texttt{se.fit} is
\texttt{TRUE}, a list with the following components is returned

\begin{ldescription}
\item[\texttt{fit}] vector or matrix as above
\item[\texttt{se.fit}] standard error of predictions
\item[\texttt{residual.scale}] residual standard deviations
\item[\texttt{df}] degrees of freedom for residual
\end{ldescription}
\end{Value}
\begin{SeeAlso}
The model fitting function \texttt{\Link{lm}}, \texttt{\Link{predict}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Predictions
x <- rnorm(15)
y <- x + rnorm(15)
predict(lm(y ~ x))
predict(lm(y ~ x), data.frame(x = seq(-3, 3, 0.1)), se = TRUE)
\end{ExampleCode}
\end{Examples}

