## to estimate the relationship between an unmeasured confounder and outcome
## needed to tip analysis
tip_with_binary(1.2, exposed_confounder_prev = 0.5, unexposed_confounder_prev = 0)
## to estimate the number of unmeasured confounders specified needed to tip
## the analysis
tip_with_binary(1.2,
exposed_confounder_prev = 0.5,
unexposed_confounder_prev = 0,
confounder_outcome_effect = 1.1)
## Example with broom
if (requireNamespace("broom", quietly = TRUE) &&
requireNamespace("dplyr", quietly = TRUE)) {
glm(am ~ mpg, data = mtcars, family = "binomial") %>%
broom::tidy(conf.int = TRUE, exponentiate = TRUE) %>%
dplyr::filter(term == "mpg") %>%
dplyr::pull(conf.low) %>%
tip_with_binary(exposed_confounder_prev = 1, confounder_outcome_effect = 1.15)
}
Run the code above in your browser using DataLab