do_smooth | R Documentation |
Fit a smooth curve to the series using LOESS with automatic smoothness selection using generalized cross validation (default) or AIC to select the optimal span. The smooth is tested against the linear model fit using an ANOVA.
do_smooth(data, y, alpha, crit, rob, lmod, n.pow, power)
data |
A data frame. |
y |
The outcome variable. |
alpha |
The significance level to be used in the test against the linear model. |
crit |
A charater, "gcv" or "aic". The criterion for choosing the optimal span. |
rob |
Set to TRUE to perform a robust LOESS. Very experimental! |
lmod |
The linear model which the smooth should be compared against. |
Defaults to a linear model if for some reason a smooth cannot be fitted.
A list with elements cv containing the estimated coefficient of variation around the smooth and the lowest detectable trend the last 10 years, an estimate of Kendall's tau, its p-value, the coefficient of determination, estimated contaminant level for the last year along with its confidence interval, the fitted smooth curve and the span used.
Erik Lampa
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.