simplereg: Simple linear and nonparametric regression

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/simplereg.R

Description

Simple linear and nonparametric regression

Usage

1
simplereg(x, y, type = "lin", sp = NULL)

Arguments

x

numerical vector, input x values.

y

numerical vector, input y values.

type

character, type of regression; available options are: lin (linear regression, the default), pol (local polynomial regression of degree 2), ks (nonparametric kernel smoothing).

sp

numeric, parameter to control the degree of smoothing; span for local polynomial regression and bandwidth for ksmooth.

Value

An object of class simplereg, i.e. a list with the following objects:

Author(s)

Marco Sandri, Paola Zuccolotto, Marica Manisera (basketball.analyzer.help@gmail.com)

References

P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.

See Also

loess, ksmooth

Examples

1
2
3
4
5
Pbox.sel <- subset(Pbox, MIN >= 500)
X <- Pbox.sel$AST/Pbox.sel$MIN
Y <- Pbox.sel$TOV/Pbox.sel$MIN
Pl <- Pbox.sel$Player
mod <- simplereg(x=X, y=Y, type="lin")

BasketballAnalyzeR documentation built on July 2, 2020, 2:14 a.m.