autoplot.PLR {LorenzRegression} | R Documentation |
Plots for the penalized Lorenz regression
Description
autoplot
generates summary plots for an object of class "PLR"
and returns them as ggplot
objects.
The plot
method is a wrapper around autoplot
that directly displays the plot,
providing a more familiar interface for users accustomed to base R plotting.
Usage
## S3 method for class 'PLR'
autoplot(
object,
type = c("explained", "traceplot", "diagnostic"),
traceplot.which = "BIC",
score.df = NULL,
...
)
## S3 method for class 'PLR'
plot(x, ...)
Arguments
object |
An object of class "PLR" . The object might also have S3 classes "PLR_boot" and/or "PLR_cv" (both inherit from class "PLR" )
|
type |
A character string indicating the type of plot. Possible values are "explained" , "traceplot" and "diagnostic" .
If "explained" is selected, the graph displays the Lorenz curve of the response and concentration curve(s) of the response with respect to the estimated index. More specifically, there is one concentration curve per selection method available.
If "traceplot" is selected, the graph displays a traceplot, where the horizontal axis is -log(lambda), lambda being the value of the penalty parameter. The vertical axis gives the value of the estimated coefficient attached to each covariate.
If "diagnostic" is selected, the graph displays a faceted plot, where each facet corresponds to a different value of the grid parameter. Each plot shows the evolution of the scores of each available selection method. For comparability reasons, the scores are normalized such that the larger the better and the optimum is attained in 1.
|
traceplot.which |
This argument indicates the value of the grid parameter for which the traceplot should be produced (see arguments grid.value and grid.arg in function Lorenz.Reg ).
It can be an integer indicating the index in the grid determined via grid.value .
Alternatively, it can be a character string indicating the selection method. In this case the index corresponds to the optimal value according to that selection method.
|
score.df |
A data.frame providing the scores to be displayed if type is set to "diagnostic" . For internal use only.
|
... |
Additional arguments passed to function Lorenz.graphs
|
x |
An object of class "PLR" . The object might also have S3 classes "PLR_boot" and/or "PLR_cv" (both inherit from class "PLR" )
|
Details
The available selection methods depend on the classes of the object: BIC is always available, bootstrap is available if object
inherits from "PLR_boot"
, cross-validation is available if object
inherits from "PLR_cv"
Value
autoplot
returns a ggplot
object representing the desired graph. plot
directly displays this plot.
See Also
Lorenz.Reg
Examples
## For examples see example(Lorenz.Reg), example(Lorenz.boot) and example(PLR.CV)
[Package
LorenzRegression version 2.0.0
Index]