\HeaderA{chart.Regression}{Takes a set of returns and relates them to a market benchmark in a scatterplot}{chart.Regression}
\keyword{ts}{chart.Regression}
\keyword{multivariate}{chart.Regression}
\keyword{distribution}{chart.Regression}
\keyword{models}{chart.Regression}
\keyword{hplot}{chart.Regression}
\begin{Description}\relax
Uses a scatterplot to display the relationship of a set of returns to a market benchmark.  Fits a linear model and overlays the resulting model.  Also overlays a Loess line for comparison.
\end{Description}
\begin{Usage}
\begin{verbatim}
chart.Regression(Ra, Rb, Rf, excess.returns = FALSE, reference.grid = TRUE, main = "Title", ylab = NULL, xlab = NULL, xlim = NA, colorset = 1:12, symbolset = 1:12, element.color = "darkgray", legend.loc = NULL, ylog = FALSE, fit = c("loess", "linear", "conditional", "quadratic"), span = 2/3, degree = 1, family = c("symmetric", "gaussian"), ylim = NA, evaluation = 50, legend.cex = 0.8, cex = 0.8, lwd = 2, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{Ra}] a vector of returns to test, e.g., the asset to be examined 
\item[\code{Rb}] a matrix, data.frame, or timeSeries of benchmark(s) to test the asset against 
\item[\code{Rf}] risk free rate, in same period as the returns 
\item[\code{excess.returns}] logical; should excess returns be used? 
\item[\code{reference.grid}] if true, draws a grid aligned with the points on the x and y axes 
\item[\code{main}] set the chart title, same as in \code{\LinkA{plot}{plot}} 
\item[\code{ylab}] set the y-axis title, same as in \code{\LinkA{plot}{plot}} 
\item[\code{xlab}] set the x-axis title, same as in \code{\LinkA{plot}{plot}} 
\item[\code{xlim}] set the x-axis limit, same as in \code{\LinkA{plot}{plot}} 
\item[\code{colorset}] color palette to use 
\item[\code{symbolset}] symbols to use, see also 'pch' in \code{\LinkA{plot}{plot}} 
\item[\code{element.color}] provides the color for drawing chart elements, such as the box lines, axis lines, etc. Default is "darkgray" 
\item[\code{legend.loc}] places a legend into one of nine locations on the chart: bottomright, bottom, bottomleft, left, topleft, top, topright, right, or center. 
\item[\code{ylog}] Not used 
\item[\code{fit}] for values of "loess", "linear", or "conditional", plots a line to fit the data.  Conditional lines are drawn separately for positive and negative benchmark returns.  "Quadratic" is not yet implemented. 
\item[\code{span}] passed to loess line fit, as in \code{\LinkA{loess.smooth}{loess.smooth}} 
\item[\code{degree}] passed to loess line fit, as in \code{\LinkA{loess.smooth}{loess.smooth}} 
\item[\code{family}] passed to loess line fit, as in \code{\LinkA{loess.smooth}{loess.smooth}} 
\item[\code{ylim}] set the y-axis limit, same as in \code{\LinkA{plot}{plot}} 
\item[\code{evaluation}] passed to loess line fit, as in \code{\LinkA{loess.smooth}{loess.smooth}} 
\item[\code{cex}] set the cex size, same as in \code{\LinkA{plot}{plot}} 
\item[\code{legend.cex}] set the legend size 
\item[\code{lwd}] set the line width for fits, same as in \code{\LinkA{lines}{lines}} 
\item[\code{...}] any other passthru parameters to \code{\LinkA{plot}{plot}} 
\end{ldescription}
\end{Arguments}
\begin{Value}
scatterplot with fitted lines
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{References}\relax
Chapter 7 of Ruppert(2004) gives an extensive overview of CAPM, its assumptions and deficiencies.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{plot}{plot}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(managers)
chart.Regression(managers[, 1:2, drop = FALSE], managers[, 8, drop = FALSE], Rf = managers[, 10, drop = FALSE], excess.returns = TRUE, fit = c("loess", "linear"), legend.loc = "topleft")
\end{ExampleCode}
\end{Examples}

