loess.sd: Local Polynomial Regression Fitting with Variability bands

Description Usage Arguments Value Author(s) References See Also Examples

Description

Nonparametric estimation of mean function with variability bands.

Usage

1
2
3
4
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 x.

y

a vector of values for the response variable y.

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 par.

col.smooth

color to be used by lines for drawing the smooths.

span

smoothing parameter for loess.

degree

the degree of the polynomials to be used, see loess.

...

further argument passed to the function loess.

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 [email protected]

References

Weisberg, S. (2005) Applied Linear Regression, 3rd ed., Wiley, New York, pp. 275-278.

See Also

loess

Examples

1
2
3
4
5
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)

Example output

Loading required package: mclust
Package 'mclust' version 5.3
Type 'citation("mclust")' for citing this R package in publications.
Package 'msir' version 1.3.1
Type 'citation("msir")' for citing this R package in publications.
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

msir documentation built on May 2, 2019, 1:08 p.m.