Local polynomial regression plot type

Description

Type function for plotting a LOESS (LOcal regrESSion) fit. Arguments are passed to loess.

Usage

type_loess(
  span = 0.75,
  degree = 2,
  family = "gaussian",
  control = loess.control(),
  se = TRUE,
  level = 0.95
)

Arguments

span the parameter \(\alpha\) which controls the degree of smoothing.
degree the degree of the polynomials to be used, normally 1 or 2. (Degree 0 is also allowed, but see the ‘Note’.)
family if “gaussian” fitting is by least-squares, and if “symmetric” a re-descending M estimator is used with Tukey’s biweight function. Can be abbreviated.
control control parameters: see loess.control.
se logical. If TRUE (the default), confidence intervals are drawn.
level the confidence level required if se = TRUE. Default is 0.95.

Examples

library("tinyplot")

# "loess" type convenience string
tinyplot(dist ~ speed, data = cars, type = "loess")

# Use `type_loess()` to pass extra arguments for customization
tinyplot(dist ~ speed, data = cars, type = type_loess(span = 0.5, degree = 1))