## to estimate the relationship between an unmeasured confounder and outcome
## needed to tip analysis
tip_or(1.2, exposure_confounder_effect = -2)
## to estimate the number of unmeasured confounders specified needed to tip
## the analysis
tip_or(1.2, exposure_confounder_effect = -2, confounder_outcome_effect = .99)
## 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_or(confounder_outcome_effect = 2.5, or_correction = TRUE)
}
Run the code above in your browser using DataLab