lift
.panel.lift(x, y, ...)panel.lift2(x, y, pct = 0, ...)
panel.xyplot
panel.lift
plots the data with a simple (black) 45 degree reference line.panel.lift2
is the default for lift
and plots the
data points with a shaded region encompassing the space between to the random model and perfect model trajectories. The color of the region is determined by the lattice reference.line
information (see example below).
lift
, panel.xyplot
, xyplot
, trellis.par.setset.seed(1)
simulated <- data.frame(obs = factor(rep(letters[1:2], each = 100)),
perfect = sort(runif(200), decreasing = TRUE),
random = runif(200))
regionInfo <- trellis.par.get("reference.line")
regionInfo$col <- "lightblue"
trellis.par.set("reference.line", regionInfo)
lift2 <- lift(obs ~ random + perfect, data = simulated)
lift2
xyplot(lift2, auto.key = list(columns = 2))
## use a different panel function
xyplot(lift2, panel = panel.lift)
Run the code above in your browser using DataLab