"n={n} | N={N} | p={p} | N_obs={N_obs} | N_miss={N_miss} | N_nonmiss={N_nonmiss} | p_miss={p_miss} | p_nonmiss={p_nonmiss} | p.std.error={p.std.error} | deff={deff} | n_unweighted={n_unweighted} | N_unweighted={N_unweighted} | p_unweighted={p_unweighted}"
"N_obs={N_obs} | N_miss={N_miss} | N_nonmiss={N_nonmiss} | p_miss={p_miss} | p_nonmiss={p_nonmiss}"
"mean={mean} | N_obs={N_obs} | N_miss={N_miss} | N_nonmiss={N_nonmiss} | p_miss={p_miss} | p_nonmiss={p_nonmiss}"

dplyr::pull(...) (`actual`) not equal to "**OR**" (`expected`).

`actual`:   "**OR** **(95% CI)**"
`expected`: "**OR**"

skip_if_not(is_pkg_installed(c("broom.helpers", "broom", "survival", "survey"), reference_pkg = "gtsummary"))
# first passing method three way, and checking equality of results
c(trial[c("response", "age")] |> na.omit() |> nrow(),
trial[c("response", "trt")] |> na.omit() |> nrow()),
c(glm(response ~ age, trial, family = binomial) |> coef() |> getElement("age"),
glm(response ~ trt, trial, family = binomial) |> coef() |> getElement("trtDrug B")),
survival::coxph(survival::Surv(ttdeath, death) ~ age, trial, id = response) |>
survival::coxph(survival::Surv(ttdeath, death) ~ trt, trial, id = response) |>
glm(response ~ age, trial, family = binomial) |>
label = list(age = "AGE", marker = "MARKER"),
# check that trt is removed from include appropriately
# check that ttdeath and death are removed from include
dplyr::select(ttdeath, death, age, marker) |>
broom::tidy(conf.level = 0.9, conf.int = TRUE) |>
estimate_fun = label_style_sigfig(digits = 4)
pvalue_fun = label_style_pvalue(digits = 3)
lm(age ~ marker + grade, trial) |> broom::tidy()
# test the dots are passed on to broom.helpers, and the tidy function
# expect error when both or neither x/y specified
trial |> dplyr::rename(`Tx Effect` = trt),
# error with an incorrect argument passed
# introduce an error in the `tbl_regression()` step
tidy_fun = \(x, ...) stop("Inducing an error")
# check function works with a survey.design object
dclus2 <- survey::svydesign(id = ~dnum + snum, weights = ~pw, data = apiclus2)
survey::svyglm(api00 ~ ell + meals + mobility, design = dclus2)
survey::svyglm(api00 ~ ell, design = dclus2) |> broom::tidy()