plot.SLOPE: Plot coefficients

View source: R/plot.R

plot.SLOPER Documentation

Plot coefficients

Description

Plot the fitted model's regression coefficients along the regularization path.

Usage

## S3 method for class 'SLOPE'
plot(
  x,
  intercept = FALSE,
  x_variable = c("alpha", "deviance_ratio", "step"),
  magnitudes = FALSE,
  add_labels = FALSE,
  ...
)

Arguments

x

an object of class "SLOPE"

intercept

whether to plot the intercept

x_variable

what to plot on the x axis. "alpha" plots the scaling parameter for the sequence, "deviance_ratio" plots the fraction of deviance explained, and "step" plots step number.

magnitudes

whether to plot the magnitudes of the coefficients

add_labels

whether to add labels (numbers) on the right side of the plot for each coefficient

...

arguments passed to graphics::matplot()

Value

Invisibly returns NULL. The function is called for its side effect of producing a plot.

See Also

SLOPE(), plotDiagnostics()

Other SLOPE-methods: coef.SLOPE(), deviance.SLOPE(), predict.SLOPE(), print.SLOPE(), score()

Examples

fit <- SLOPE(heart$x, heart$y)
plot(fit)

jolars/SLOPE documentation built on June 15, 2025, 1:45 p.m.