do_smooth: do_smooth

View source: R/do_smooth.R

do_smoothR Documentation

do_smooth

Description

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.

Usage

do_smooth(data, y, alpha, crit, rob, lmod, n.pow, power)

Arguments

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.

Details

Defaults to a linear model if for some reason a smooth cannot be fitted.

Value

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.

Author(s)

Erik Lampa


NRM-MOC/MoCiS documentation built on March 27, 2023, 7:35 p.m.