0

If I want to perform logistic regression, I can use three different ways:

  • manually :
fit1 <- (glm(outcome~A+B,family=binomial,data=database))
summary(fit1)
exp(confint(fit1))
exp(coefficients(fit1)
  • function tbl_regression from gtsumary package
fit1 <- (glm(outcome~A+B,family=binomial,data=database))
tbl_regression(fit1, exponentiate = TRUE)
  • function logistic.display from epiDisplay package
fit1 <- (glm(outcome~A+B,family=binomial,data=database))
logistic.display(fit1)

Adjusted OR and p-value are the same with the three methods.

But I am surprised to see that 95%CI from tbl_regression and manual calculation are different from 95%CI from logistic.display...

enter image description here

However, only the 95%CI from the logistic.display function matches the p-value (whitch should include 1 if p-value > 0.05).

Does anybody know why?

B_slash_
  • 309
  • 2
  • 17
  • it should be exp(x)/(1+exp(x)) , not exp(x) – StupidWolf Jul 01 '20 at 20:23
  • I still does not understand why 95% CI in tbl_regression and in logistic.display are different? 95% CI from logistic.display seems to be right according to not significant pvalue (CI contains 1).... Maybe @DanielDSjoberg could help us? – B_slash_ Apr 15 '21 at 09:17
  • The gtsummary package matches the base R summary function and the broom::tidy() function. You need to reach out to the authors of the epiDisplay package to identify why their CI does not match any other. IF you provide a reproducible example, meaning code and data that I can run on my machine, I may be able to provide more clear direction. But only if that is provided. – Daniel D. Sjoberg Apr 15 '21 at 13:11
  • FYI, I ran the example from the help file of `epiDisplay::logistic.display()`, and it prints curde and adjusted odds ratios, along with p-values from Wald and LRT methods. My guess is you're mixing the univariate and multivariable models. – Daniel D. Sjoberg Apr 15 '21 at 13:19
  • The data can be found here: https://jpst.it/2tJ0s – B_slash_ Apr 15 '21 at 13:27
  • the code ```dataB <- read.table("clipboard", header = T, dec = ".", sep = "\t")``` ```fit1 <- glm(outcome~A+D,family=binomial,data=dataB)``` ```tbl_regression(fit1, exponentiate = T)``` return 95%CI which does not contains 1, but the pvalue is > 0.05 for variable A... I can't find where is the mistake! – B_slash_ Apr 15 '21 at 13:28
  • this line does not run `dataB <- read.table("clipboard", header = T, dec = ".", sep = "\t")` – Daniel D. Sjoberg Apr 15 '21 at 13:33
  • You have to copy the data first (and then run the first line, which will paste the data and create the dataframe) – B_slash_ Apr 15 '21 at 13:41
  • The CI method and the p-value method don't always align. (You can google the reasons this may happen.) If you want your CI to match the p-value in this case, you can use Wald confidence intervals, and they can be calculated with `confint.default()`. If you're using `tbl_regression()`, there is an example here: http://www.danieldsjoberg.com/gtsummary/reference/vetted_models.html#examples – Daniel D. Sjoberg Apr 15 '21 at 13:57
  • I would rather prefer to have the pvalue matched on the CI, is it possible? – B_slash_ Apr 15 '21 at 14:00
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/231175/discussion-between-daniel-d-sjoberg-and-b-slash). – Daniel D. Sjoberg Apr 15 '21 at 14:02

0 Answers0