Smoothing Scatterplots on Multipanel Displays

DESCRIPTION:

Adds smooth curves to the scatterplots on multipanel displays that are made by graphical functions.

USAGE:

panel.smooth(x, y, span = 2/3, degree = 1, family = c("symmetric", 
     "gaussian"), zero.line = FALSE, evaluation = 50, ...) 

REQUIRED ARGUMENTS:

x
refers to abscissas of points on a panel.
y
refers to ordinates of points on a panel.

OPTIONAL ARGUMENTS:

span
smoothing parameter.
degree
overall degree of locally fitted polynomial. 1 is locally linear fitting and 2 is locally quadratic fitting.
family
the values are "gaussian" or "symmetric". In the first case, local fitting methods are used. In the second case, the default, local fitting is used together with a robustness feature that guards against distortion by outliers.
zero.line
if TRUE, the line y = 0 is drawn on the panel.
evaluation
number of values at which the loess curve is evaluated.

SIDE EFFECTS:

DETAILS:

This function adds smooth curves to the scatterplots on multipanel displays made by graphical functions such as pairs and coplot. The smoothing method used is loess. The fit is evaluated at evaluation equally spaced points from min(x) to max(x) and then graphed by connecting the successive plotting locations by line segments. Graphical parameters may also be supplied as arguments to this function (see ).

BUGS:

panel.smooth does not recognize graphics parameters.

DETAILS:

The function allows a scatterplot smoothing of the points in a plot. It adds the curves using loess smoothing.

SEE ALSO:

,

EXAMPLES:

E.intervals <- co.intervals(ethanol$E, 16, 0.25) 
coplot(NOx ~ C | E, given = E.intervals, data = ethanol, 
        panel = function(x, y) panel.smooth(x, y, span = 1, degree = 1))