plot.gainstable: Plot '"gainstable"' Object

View source: R/plotGainsTable.R

plot.gainstableR Documentation

Plot "gainstable" Object

Description

An S3 method to make different plots using entries of gains table.

Usage

## S3 method for class 'gainstable'
plot(
  x,
  y = NULL,
  type = 1,
  col = c("#BEBEBE", "#26484F", "#8B4500"),
  legend = TRUE,
  ... = NULL
)

Arguments

x

An object of class "gainstable", created with the function gainstable.

y

NULL.

type

Plot type. See "Details".

col

Colors to be used for plot.

legend

A logical value indicating whether legend to appear. See "Details"

...

NULL. Used for S3 generic/method consistency.

Details

Currently three types are available. type = 1 shows lift and cumulative lift against population depth. type = 2 shows response rate and cumulative response rate against population depth. type = 3 shows cumulative capture rate of positive responses against population depth. For type 1 and 2, three colors and for 3, two colors are required. If more than required specified, then first 3 (for type 1, 2) or 2 (for type 3) colors are used. If less than required specified, then specified colors are repeated. If legend is TRUE, then legend appears in the plot. For type 1 and 2, legend position is "topright", for 3, "bottomright".

See Also

gainstable, rocit

Examples

data("Loan")
class <- Loan$Status
score <- Loan$Score
rocit_emp <- rocit(score = score, class = class, negref = "FP")
# ----------------------------------------------------------------
gtable <- gainstable(rocit_emp)
# ----------------------------------------------------------------
plot(gtable)
plot(gtable, legend = FALSE)
plot(gtable, col = 2:4)
plot(gtable, type = 2, col = 2:4)
plot(gtable, type = 3, col = 2:3)

ROCit documentation built on May 29, 2024, 2:15 a.m.