data(bmt)
dfactor(bmt) <- cause1f~cause
drelevel(bmt,ref=3) <- cause3f~cause
dlevels(bmt)
mreg <- mlogit(cause1f~+1,bmt)
summary(mreg)
mreg <- mlogit(cause1f~tcell+platelet,bmt)
summary(mreg)
mreg3 <- mlogit(cause3f~tcell+platelet,bmt)
summary(mreg3)
## inverse information standard errors
lava::estimate(coef=mreg3$coef,vcov=mreg3$II)
## predictions based on seen response or not
newdata <- data.frame(tcell=c(1,1,1),platelet=c(0,1,1),cause1f=c("2","1","0"))
predictmlogit(mreg,newdata,response=FALSE)
predictmlogit(mreg,newdata)
Run the code above in your browser using DataLab