loess.ci: Loess with confidence intervals

Description Usage Arguments Value Author(s) References Examples

View source: R/loess.ci.R

Description

Calculates a local polynomial regression fit with associated confidence intervals

Usage

1
loess.ci(y, x, p = 0.95, plot = FALSE, ...)

Arguments

y

Dependent variable, vector

x

Independent variable, vector

p

Percent confidence intervals (default is 0.95)

plot

Plot the fit and confidence intervals

...

Arguments passed to loess

Value

A list object with:

loess Predicted values

se Estimated standard error for each predicted value

lci Lower confidence interval

uci Upper confidence interval

df Estimated degrees of freedom

rs Residual scale of residuals used in computing the standard errors

Author(s)

Jeffrey S. Evans <[email protected]>

References

W. S. Cleveland, E. Grosse and W. M. Shyu (1992) Local regression models. Chapter 8 of Statistical Models in S eds J.M. Chambers and T.J. Hastie, Wadsworth & Brooks/Cole.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 x <- seq(-20, 20, 0.1)
 y <- sin(x)/x + rnorm(length(x), sd=0.03)
 p <- which(y == "NaN")
   y <- y[-p]	
   x <- x[-p]
 
 par(mfrow=c(2,2))  
 lci <- loess.ci(y, x, plot=TRUE, span=0.10)
 lci <- loess.ci(y, x, plot=TRUE, span=0.30)
 lci <- loess.ci(y, x, plot=TRUE, span=0.50)
 lci <- loess.ci(y, x, plot=TRUE, span=0.80)

jeffreyevans/spatialEco documentation built on Aug. 11, 2018, 1:08 p.m.