0

From time to time, I've found the 95% CI outputs like so (see image below) using the gtsummary package. Sometimes I've noticed it is because it doesn't like a colon, space or apostrophe in the variable name or because there are NA's in the factor levels. When I've changed the names, the CI is fixed. However this time it does not seem to be the case. Any ideas what might be the cause of this output?

Thank you

fit3 <- glmer(cclintr ~ SEX + Rg + agroup + death +
              psource_group + region + BMI + HOSPVENT + 
              PATMANICU + fibandflutter + MEDHISTO_03 + 
              MEDHISTO_35 + Cerebrovasc_group
              smo_vape + DOCUSYMP_12 + admonth + (1|FACILITY_DISPLAY_ID),
             data= filthosp,
             family = binomial,
             nAGQ = 1, 
             control=glmerControl(optimizer="bobyqa",optCtrl=list(maxfun=2e5)))

#Summary into table 
library(gtsummary)
f2model_tab <- fit3 %>%
  tbl_regression(exponentiate = TRUE ) %>%
  bold_labels() %>%
  bold_p(t= 0.05) 

Output

enter image description here

Adri
  • 121
  • 8
  • Is there a way you can post a reproducible example? Can you also share the output from `broom::tidy(fit3)`. We have made huge changes internally recently that will better identify variables with strange names. Please see if the issue persists in the development version `remotes::install_github("ddsjoberg/gtsummary")`. We are releasing the new version next week when CRAN returns from holiday. – Daniel D. Sjoberg Dec 28 '20 at 21:35
  • @DanielD.Sjoberg, thank you for the quick response. I've added a screenshot of broom::tidy(fit3). working on the reproducible example, however not sure I can upload as I'm working on a locked platform. – Adri Dec 28 '20 at 21:49
  • I understand if you can't upload this particular example, but a similar example would be helpful (at least the same model type that hopefully has the same issue). What is the model type? Does the issue persist with the dev version of gtsummary? – Daniel D. Sjoberg Dec 28 '20 at 21:51
  • Can you update the `broom::tidy()` output to include the column headers? – Daniel D. Sjoberg Dec 28 '20 at 21:53
  • Thanks for adding the additional information. I'll post an answer below. – Daniel D. Sjoberg Dec 28 '20 at 23:03
  • I get a failed to install error when downloading the dev version, says the gert package had a non zero exit status :/ . The model is a glmer mixed effects logistic regression. When I print the summary of fit3, I get the error that model is unidentifiable with large eigenvalue, and asks if I want to rescale vars. All vars are categorical factors, with BM level of admonth having 8 levels. Other vars have average 2 levels max.The counts for BM are pretty low though. – Adri Dec 28 '20 at 23:07

1 Answers1

1

From what we see here, gtsummary is reporting what it should. The issue is that the confidence bounds are HUGE for the BM level of the admonth variable. The coef is -13.8 with standard error 74. If we were to calculate the upper confidence bound ourselves it would be:

-13.8 + 1.96 * 74 = 131.24

Then we're exponentiating to get the odds ratio:

exp(131.24) = 9.92e+56    !!

The tbl_regression() function by default formats and rounds the bounds with the style_ratio() function, which does not use scientific notation (hence printing the HUGE number). You can use the tbl_regression(estimate_fun=) argument to pass another function to round the estimates that uses scientific notation, so the print is not wild looking.

Other than that, I would suggest playing with your model a bit to see if you can get more reasonable estimates.

Happy Programming!

Daniel D. Sjoberg
  • 8,820
  • 2
  • 12
  • 28