library(MASS)
(house.mblogit <- mblogit(Sat ~ Infl + Type + Cont,
data = housing,
weights=Freq))
head(pred.house.mblogit <- predict(house.mblogit))
str(pred.house.mblogit <- predict(house.mblogit,se=TRUE))
head(pred.house.mblogit <- predict(house.mblogit,
type="response"))
str(pred.house.mblogit <- predict(house.mblogit,se=TRUE,
type="response"))
# This takes a bit longer.
data(electors)
(mcre <- mclogit(
cbind(Freq,interaction(time,class))~econ.left/class+welfare/class+auth/class,
random=~1|party.time,
data=within(electors,party.time<-interaction(party,time))))
str(predict(mcre))
str(predict(mcre,type="response"))
str(predict(mcre,se.fit=TRUE))
str(predict(mcre,type="response",se.fit=TRUE))
Run the code above in your browser using DataLab