Learn R Programming

asbio (version 0.2-1)

loess.surf: loess 2D and 3D smooth plots

Description

The function serves as wrapper for loess and lets one make 2D or 3D smoother plots using loess specifications.

Usage

loess.surf(Y, X, span = 0.75, degree = 1, family = "gaussian", phi = 20, 
theta = 50, xlab = "X", ylab = "Y", zlab = "Fit", line.col = 1, 
line.type = 1, scale = TRUE, duplicate = "error", expand = 0.5, ...)

Arguments

Y
A numeric response vector.
X
A numeric explanatory vector or a two column matrix for 3D smooths.
span
Span paramter, i.e. the size of the local neighborhood.
degree
Indicates whether linear degree = 1 or quadratic models degree = 2 are to be applied to each local neighborhood.
family
Type of error distribution to be optimized in fitting. The default, "gaussian" is fitting with least squares. Fitting with Tukey's biweight M-Estimator is used if family = "symmetric".
phi
Parameter from persp,phi provides the colatitude viewing angle.
theta
Parameter from persp theta gives the azimuthmal direction .
xlab
X-axis label.
ylab
Y-axis label.
zlab
Z-axis label
line.col
Color of loess fit line.
line.type
Line type for loess fit.
scale
Logical from persp If scale is TRUE the x, y and z coordinates are transformed separately. If scale is FALSE the coordinates are scaled so that aspect ratios are retained.
duplicate
Argument from interp from library akima. Consists of a character string indicating how to handle duplicate data points. The default, duplicate = "error" produces an error message.
expand
Argument from persp, a expansion factor applied to the z coordinates.
...
Additional arguments from plot

Value

  • Output is a 2D or 3D smooth plot.

References

Wilcox, R. R. (2005) Introduction to Robust Estimation and Hypothesis Testing, Second Edition. Elsevier, Burlington, MA.

See Also

loess

Examples

Run this code
X1<-sort(rnorm(100))
X2<-rexp(100)
Y<-rgamma(100,1,2)
loess.surf(Y,cbind(X1,X2))

Run the code above in your browser using DataLab