# NOT RUN {
data(efc)
fit <- lm(neg_c_7 ~ e42dep + c161sex, data = efc)
pred_vars(fit)
resp_var(fit)
resp_val(fit)
link_inverse(fit)(2.3)
# example from ?stats::glm
counts <- c(18, 17, 15, 20, 10, 20, 25, 13, 12)
outcome <- gl(3, 1, 9)
treatment <- gl(3, 3)
m <- glm(counts ~ outcome + treatment, family = poisson())
link_inverse(m)(.3)
# same as
exp(.3)
outcome <- as.numeric(outcome)
m <- glm(counts ~ log(outcome) + as.factor(treatment), family = poisson())
var_names(m)
# model.frame and model_frame behave slightly different
library(splines)
m <- lm(neg_c_7 ~ e42dep + ns(c160age), data = efc)
head(model.frame(m))
head(model_frame(m))
# }
Run the code above in your browser using DataLab