# NOT RUN {
data("housing", package = "MASS")
# Maximum likelihood using brmultinom with baseline category 'Low'
houseML1 <- brmultinom(Sat ~ Infl + Type + Cont, weights = Freq,
data = housing, type = "ML", ref = 1)
# New data
newdata <- expand.grid(Infl = c("Low", "Medium"),
Type = c("Tower", "Atrium", "Terrace"),
Cont = c("Low", NA, "High"))
## Predictions
sapply(c("class", "probs"), function(what) predict(houseML1, newdata, what))
# }
Run the code above in your browser using DataLab