loess.sd {msir} | R Documentation |
Local Polynomial Regression Fitting with Variability bands
Description
Nonparametric estimation of mean function with variability bands.
Usage
loess.sd(x, y = NULL, nsigma = 1, ...)
panel.loess(x, y, col = par("col"), bg = NA, pch = par("pch"), cex = 1,
col.smooth = "red", span = 2/3, degree = 2, nsigma = 1, ...)
Arguments
x |
a vector of values for the predictor variable |
y |
a vector of values for the response variable |
nsigma |
a multiplier for the standard deviation function. |
col , bg , pch , cex |
numeric or character codes for the color(s), point type and size of points; see also |
col.smooth |
color to be used by |
span |
smoothing parameter for |
degree |
the degree of the polynomials to be used, see |
... |
further argument passed to the function |
Value
The function loess.sd
computes the loess smooth for the mean function and the mean plus and minus k
times the standard deviation function.
The function panel.loess
can be used to add to a scatterplot matrix panel a smoothing of mean function using loess with variability bands at plus and minus nsigmas
times the standard deviation.
Author(s)
Luca Scrucca luca.scrucca@unipg.it
References
Weisberg, S. (2005) Applied Linear Regression, 3rd ed., Wiley, New York, pp. 275-278.
See Also
Examples
data(cars)
plot(cars, main = "lowess.sd(cars)")
lines(l <- loess.sd(cars))
lines(l$x, l$upper, lty=2)
lines(l$x, l$lower, lty=2)