\Header{trls.influence}{Regression diagnostics for trend surfaces}
\alias{plot.trls}{trls.influence}
\keyword{spatial}{trls.influence}
\begin{Description}\relax
This function provides the basic quantities which are used in
forming a variety of diagnostics for checking the quality of
regression fits for trend surfaces calculated by \code{surf.ls}.
\end{Description}
\begin{Usage}
\begin{verbatim}
trls.influence(object)
## S3 method for class 'trls':
plot(x, border = "red", col = NA, pch = 4, cex = 0.6,
     add = FALSE, div = 8, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object, x}] Fitted trend surface model from \code{surf.ls}

\item[\code{div}] scaling factor for influence circle radii in \code{plot.trls}

\item[\code{add}] add influence plot to existing graphics if \code{TRUE}

\item[\code{border, col, pch, cex, ...}] additional graphical parameters

\end{ldescription}
\end{Arguments}
\begin{Value}
\code{trls.influence} returns a list with components:

\begin{ldescription}
\item[\code{r}] raw residuals as given by \code{residuals.trls}

\item[\code{hii}] diagonal elements of the Hat matrix

\item[\code{stresid}] standardised residuals

\item[\code{Di}] Cook's statistic

\end{ldescription}
\end{Value}
\begin{References}\relax
Unwin, D. J., Wrigley, N. (1987) Towards a general-theory of
control point distribution effects in trend surface models.
\emph{Computers and Geosciences,} \bold{13}, 351--355.

Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{surf.ls}}, \code{\Link{influence.measures}}, \code{\Link{plot.lm}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
library(MASS)  # for eqscplot
data(topo, package = "MASS")
topo2 <- surf.ls(2, topo)
infl.topo2 <- trls.influence(topo2)
(cand <- as.data.frame(infl.topo2)[abs(infl.topo2$stresid) > 1.5, ])
cand.xy <- topo[as.integer(rownames(cand)), c("x", "y")]
trsurf <- trmat(topo2, 0, 6.5, 0, 6.5, 50)
eqscplot(trsurf, type = "n")
contour(trsurf, add = TRUE, col = "grey")
plot(topo2, add = TRUE, div = 3)
points(cand.xy, pch = 16, col = "orange")
text(cand.xy, labels = rownames(cand.xy), pos = 4, offset = 0.5)
\end{ExampleCode}
\end{Examples}

