\HeaderA{meanvar.rpart}{Mean-Variance Plot for an Rpart Object}{meanvar.rpart}
\aliasA{meanvar}{meanvar.rpart}{meanvar}
\keyword{tree}{meanvar.rpart}
\begin{Description}\relax
Creates a plot on the current graphics device of the deviance of the 
node divided by the number of observations at the node.  Also returns 
the node number.
\end{Description}
\begin{Usage}
\begin{verbatim}
meanvar(tree, ...)

## S3 method for class 'rpart':
meanvar(tree, xlab="ave(y)", ylab="ave(deviance)", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{tree}] fitted model object of class \code{rpart}.  This is assumed to be the result 
of some function that produces an object with the same named 
components as that returned by the \code{rpart} function. 

\item[\code{xlab}] x-axis label for the plot. 

\item[\code{ylab}] y-axis label for the plot. 

\item[\code{...}] additional graphical parameters may be supplied as arguments to this function. 

\end{ldescription}
\end{Arguments}
\begin{Value}
an invisible list containing the following vectors is returned. 

\begin{ldescription}
\item[\code{x}] fitted value at terminal nodes (\code{yval}). 

\item[\code{y}] deviance of node divided by number of observations at node. 

\item[\code{label}] node number. 

\end{ldescription}
\end{Value}
\begin{Section}{Side Effects}
a plot is put on the current graphics device.
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{plot.rpart}{plot.rpart}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
z.auto <- rpart(Mileage ~ Weight, car.test.frame)
meanvar(z.auto, log='xy')
\end{ExampleCode}
\end{Examples}

