library(causaldata)
library(multcomp)
data(nhefs)
nhefs.nmv <- nhefs[which(!is.na(nhefs$wt82)), ]
nhefs.nmv$qsmk <- as.factor(nhefs.nmv$qsmk)
confounders <- c(
"sex", "race", "age", "education", "smokeintensity",
"smokeyrs", "exercise", "active", "wt71"
)
init_params(wt82_71, qsmk,
covariates = confounders,
data = nhefs.nmv
)
out.mod <- outcome_regression(nhefs.nmv, contrasts = list(
age = c(21, 55),
smokeintensity = c(5, 20, 40)
))
print(out.mod)
summary(out.mod)
head(data.frame(preds = predict(out.mod)))
Run the code above in your browser using DataLab