Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lf

Locfit term in Additive Model formula


Description

This function is used to specify a smooth term in a gam() model formula.

This function is designed to be used with the S-Plus gam() function. For R users, there are at least two different gam() functions available. Most current distributions of R will include the mgcv library by Simon Wood; lf() is not compatable with this function.

On CRAN, there is a gam package by Trevor Hastie, similar to the S-Plus version. lf() should be compatable with this, although it's untested.

Usage

lf(..., alpha=0.7, deg=2, scale=1, kern="tcub", ev=rbox(), maxk=100)

Arguments

...

numeric predictor variable(s)

alpha, deg, scale, kern, ev, maxk

these are as in locfit.raw.

See Also

Examples

## Not run:   
# fit an additive semiparametric model to the ethanol data.
stopifnot(require(gam))
# The `gam' package must be attached _before_ `locfit', otherwise
# the following will not work.
data(ethanol, package = "lattice")
fit <- gam(NOx ~ lf(E) + C, data=ethanol)
op <- par(mfrow=c(2, 1))
plot(fit)
par(op)

## End(Not run)

locfit

Local Regression, Likelihood and Density Estimation

v1.5-9.4
GPL (>= 2)
Authors
Catherine Loader [aut], Jiayang Sun [ctb], Lucent Technologies [cph], Andy Liaw [cre]
Initial release
2020-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.