# NOT RUN {
require(dplyr)
require(sjlabelled)
## Continuous outcome.
data(birthwt, package = "MASS")
birthwt <- birthwt %>%
mutate(
smoke = factor(smoke, labels = c("Non-smoker", "Smoker")),
race = factor(race, labels = c("White", "African American", "Other"))
) %>%
var_labels(
bwt = 'Birth weight (g)',
smoke = 'Smoking status',
race = 'Race'
)
model_norm <- lm(bwt ~ smoke + race, data = birthwt)
glm_coef(model_norm, labels = model_labels(model_norm))
## Logistic regression.
data(diet, package = "Epi")
model_binom <- glm(chd ~ fibre, data = diet, family = binomial)
model_binom %>%
glm_coef(labels = c("Constant", "Fibre intake (g/day)"))
model_binom %>%
glm_coef(labels = c("Constant", "Fibre intake (g/day)"), type = "ext")
## For more examples, please read the Vignette on Regression.
# }
Run the code above in your browser using DataLab