data("stemcell", package = "brglm2")
# Adjacent category logit (non-proportional odds)
fit_bracl <- bracl(research ~ as.numeric(religion) + gender, weights = frequency,
data = stemcell, type = "ML")
# Adjacent category logit (proportional odds)
fit_bracl_p <- bracl(research ~ as.numeric(religion) + gender, weights = frequency,
data = stemcell, type = "ML", parallel = TRUE)
# New data
newdata <- expand.grid(gender = c("male", "female"),
religion = c("liberal", "moderate", "fundamentalist"))
# Predictions
sapply(c("class", "probs"), function(what) predict(fit_bracl, newdata, what))
sapply(c("class", "probs"), function(what) predict(fit_bracl_p, newdata, what))
Run the code above in your browser using DataLab