r.full <- lm(Fertility ~ . , swiss)
r.nox <- lm(Fertility ~ . -Examination - Catholic, swiss)
r.grp <- lm(Fertility ~ . -Education - Catholic + CutQ(Catholic), swiss)
r.gam <- glm(Fertility ~ . , swiss, family=Gamma(link="identity"))
r.gama <- glm(Fertility ~ .- Agriculture , swiss, family=Gamma(link="identity"))
TMod(r.full, r.nox, r.grp, r.gam, r.gama)
# display confidence intervals
TMod(r.full, r.nox, r.gam, FUN = function(est, se, tval, pval, lci, uci){
gettextf("%s [%s, %s]",
Format(est, fmt=Fmt("num")),
Format(lci, digits=3),
Format(uci, digits=2)
)
})
# cbind interface is not supported!!
# d.titanic <- reshape(as.data.frame(Titanic),
# idvar = c("Class","Sex","Age"),
# timevar="Survived",
# direction = "wide")
#
# r.glm0 <- glm(cbind(Freq.Yes, Freq.No) ~ 1, data=d.titanic, family="binomial")
# r.glm1 <- glm(cbind(Freq.Yes, Freq.No) ~ Class, data=d.titanic, family="binomial")
# r.glm2 <- glm(cbind(Freq.Yes, Freq.No) ~ ., data=d.titanic, family="binomial")
d.titanic <- Untable(Titanic)
r.glm0 <- glm(Survived ~ 1, data=d.titanic, family="binomial")
r.glm1 <- glm(Survived ~ Class, data=d.titanic, family="binomial")
r.glm2 <- glm(Survived ~ ., data=d.titanic, family="binomial")
TMod(r.glm0, r.glm1, r.glm2)
Run the code above in your browser using DataLab