'Wald confidence interval in gtsummary

Is there a way to specify the method of calculating confidence interval in gtsummary. Am asking this because of some inconsistencies with profile confidence intervals by confint fuction. Have a look at the pvalues and CIs of var1 and var2 below:

library(tidyverse)
library(gtsummary)

set.seed(2021)

testdata <- tibble(
  var1 = rbinom(1114, 1, 0.12),
  var2 = rbinom(1114, 1, 0.82),
  var3 = rbinom(1114, 1, 0.60),
  var4 = rbinom(1114, 1, 0.18),
  var5 = rbinom(1114, 1, 0.12),
  var6 = rbinom(1114, 1, 0.05),
  var7 = rbinom(1114, 1, 0.63),
  var8 = rbinom(1114, 1, 0.20),
  var9 = rbinom(1114, 1, 0.06),
  var10 = rbinom(1114, 1, 0.40),
  var11 = rbinom(1114, 1, 0.35),
  var12 = rbinom(1114, 1, 0.32),
  outcome = rbinom(1114, 1, 0.04)
) %>%
  mutate(across(.cols = everything(),
                ~factor(., levels = c(0, 1),
                        labels = c("No", "Yes"))))



mvariate.regress <- function(outcome, covariates, mydata) {
  form <- paste(outcome, "~",
                paste(covariates, collapse = " + "))

  model1 <- glm(as.formula(form),
                data = mydata, family = binomial)

  model1

}


ipvars <- paste0("var", 1:12)

mlogitfit <- mvariate.regress("outcome", ipvars, testdata)


mlogitfit %>%
  tbl_regression(
    exponentiate = TRUE
  ) %>%
  bold_p() %>%
  bold_p(t = 0.05) %>%
  bold_labels() %>%
  modify_header(label = "**Variable**",
                estimate = "**adjusted OR**") %>%
  modify_table_styling(
    columns = c("ci", "estimate"),
    rows = reference_row %in% TRUE,
    missing_symbol = "Ref"
  )

I would get the desired results if I were to use confint.default function



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source