lm0 <- lm(sr ~ pop15 + pop75, data = LifeCycleSavings)
lm1 <- lm(sr ~ dpi + ddpi, data = LifeCycleSavings)
lm2 <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
(mtable123 <- mtable("Model 1"=lm0,"Model 2"=lm1,"Model 3"=lm2))
# Some other output formats
write.mtable(mtable123)
file123 <- "mtable123.txt"
write.mtable(mtable123,file=file123)
file.show(file123)
toLatex(mtable123)
texfile123 <- "mtable123.tex"
cat(toLatex(mtable123),sep="\n",file=texfile123)
file.show(texfile123)
berkeley <- aggregate(wtable(Admit,Freq)~.,data=UCBAdmissions)
berk0 <- glm(cbind(Admitted,Rejected)~1,data=berkeley,family="binomial")
berk1 <- glm(cbind(Admitted,Rejected)~Gender,data=berkeley,family="binomial")
berk2 <- glm(cbind(Admitted,Rejected)~Gender+Dept,data=berkeley,family="binomial")
mtable(berk0,berk1,berk2)
mtable(berk0,berk1,berk2,coef.style="stat")
mtable(berk0,berk1,berk2,coef.style="ci")
mtable(berk0,berk1,berk2,coef.style="ci.vertical")
mtable(berk0,berk1,berk2,coef.style="ci.horizontal")
mtable(berk0,berk1,berk2,coef.style="all")
mtable(berk0,berk1,berk2,coef.style="all.nostar")
mtable(by(berkeley,berkeley$Dept,function(x)glm(cbind(Admitted,Rejected)~Gender,data=x,family="binomial")))
mtable(By(~Gender,glm(cbind(Admitted,Rejected)~Dept,family="binomial"),data=berkeley))
Run the code above in your browser using DataLab