plot.simplereg {BasketballAnalyzeR}R Documentation

Plot simple regression from a 'simplereg' object

Description

Plot simple regression from a 'simplereg' object

Usage

## S3 method for class 'simplereg'
plot(
  x,
  labels = NULL,
  subset = NULL,
  Lx = 0.01,
  Ux = 0.99,
  Ly = 0.01,
  Uy = 0.99,
  title = "Simple regression",
  xtitle = NULL,
  ytitle = NULL,
  repel = TRUE,
  ...
)

Arguments

x

an object of class simplereg.

labels

character, labels for subjects.

subset

an optional vector specifying a subset of observations to be highlighted in the graph or subset='quant' to highligh observations with coordinates above and below the upper and lower quantiles of the variables on the x- and y-axis (Lx, Ux, Ly, Uy).

Lx

numeric; if subset='quant', lower quantile for the variable on the x-axis (default = 0.01).

Ux

numeric; if subset='quant', upper quantile for the variable on the x-axis (default = 0.99).

Ly

numeric; if subset='quant', lower quantile for the variable on the y-axis (default = 0.01).

Uy

numeric; if subset='quant', upper quantile for the variable on the y-axis (default = 0.99).

title

character, plot title.

xtitle

character, x-axis label.

ytitle

character, y-axis label.

repel

logical, if TRUE (the default) text labels repel away from each other.

...

other graphical parameters.

Value

A ggplot2 object

Author(s)

Marco Sandri, Paola Zuccolotto, Marica Manisera (basketballanalyzer.help@unibs.it)

References

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

See Also

simplereg

Examples

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")
plot(mod)

[Package BasketballAnalyzeR version 0.5.0 Index]