## to estimate the relationship between an unmeasured confounder and outcome
## needed to tip analysis
tip_coef(1.2, exposure_confounder_effect = -2)
## to estimate the number of unmeasured confounders specified needed to tip
## the analysis
tip_coef(1.2, exposure_confounder_effect = -2, confounder_outcome_effect = -0.05)
## Example with broom
if (requireNamespace("broom", quietly = TRUE) &&
requireNamespace("dplyr", quietly = TRUE)) {
lm(wt ~ mpg, data = mtcars) %>%
broom::tidy(conf.int = TRUE) %>%
dplyr::filter(term == "mpg") %>%
dplyr::pull(conf.low) %>%
tip_coef(confounder_outcome_effect = 2.5)
}
Run the code above in your browser using DataLab