rocplot
command generates a receiver operator
characteristic plot to compare the in-sample (default) or out-of-sample
fit for two logit or probit regressions.rocplot(y1, y2, fitted1, fitted2, cutoff = seq(from=0, to=1, length=100),
lty1 = "solid", lty2 = "dashed", lwd1 = par("lwd"), lwd2 = par("lwd"),
col1 = par("col"), col2 = par("col"), main, xlab, ylab,
plot = TRUE, ...)
lty1
) and
the second model (lty2
), defaulting to solid and dashed,
respectively.lwd1
) and the second model (lwd2
), defaulting to 1 for both.col1
) and the second model (col2
), defaulting to
black for both.TRUE
, which generates a plot to the
selected device. If FALSE
, returns a list of
items (see below).xlab
, ylab
, and main
.plot = TRUE
, rocplot
generates an ROC plot for
two logit or probit models. If plot = FALSE
, rocplot
returns a list with the following elements:plot
, lines
.data(turnout)
z.out1 <- zelig(vote ~ race + educate + age, model = "logit",
data = turnout)
z.out2 <- zelig(vote ~ race + educate, model = "logit",
data = turnout)
rocplot(z.out1$y, z.out2$y, fitted(z.out1), fitted(z.out2))
Run the code above in your browser using DataLab