# NOT RUN {
require(serp)
set.seed(1)
n <- 100
y <- factor(rbinom(n, 1, 0.3))
x <- rnorm(n)
#p <- runif(n)
m1 <- glm(y ~ x, family = binomial())
erroR(m1, type = "brier")
erroR(m1, type = "logloss")
erroR(m1, type = "misclass")
erroR(m1, type = "misclass", thresh=0.3)
# using data.frame
df <- data.frame(y, fitted(m1))
erroR(df, type = "brier")
m2 <- serp(rating ~ temp + contact, slope = "parallel", link = "logit",
data = wine)
erroR(m2, type = "brier")
erroR(m2, type = "logloss")
erroR(m2, type = "misclass")
# }
Run the code above in your browser using DataLab