data(birthwt, package="MASS")
birthwt$smoke <- factor(birthwt$smoke, labels=c("no","yes"))
birthwt$race <- factor(birthwt$race, labels=c("white","black","other"))
## Hierarchical regression: one response, nested sets of predictors.
## Blocks are deduced from the equation in which each predictor enters.
m1 <- glmCoin("bwt ~ age + lwt", birthwt)
m2 <- glmCoin("bwt ~ age + lwt + smoke", birthwt)
m3 <- glmCoin("bwt ~ age + lwt + smoke + race", birthwt)
coefTable(list(m1, m2, m3), note=TRUE)
## Standardized coefficients: quantitative terms only, then all of them
coefTable(m3, columns=c("coef","sta"))
coefTable(m3, columns=c("coef","sta"), stfactors="x")
## Confidence intervals instead of standard errors, with fewer decimals
coefTable(list(m1, m2, m3), columns=c("coef","sig","ci"), digits=2, digits.se=1)
## Logistic regression: odds ratios beside the coefficients
g <- glmCoin(c("bwt ~ age + lwt", "low ~ age + lwt, binomial"), birthwt)
coefTable(g, columns=c("coef","sig","exp"), footer=c("n_obs","r2"))
## Multinomial response: one block of columns per category
data(housing, package="MASS")
h <- glmCoin("Sat ~ Infl + Type + Cont, multinomial", housing, weights="Freq")
coefTable(h, blocks="variable", columns=c("coef","sig"))
Run the code above in your browser using DataLab