modelbased icon indicating copy to clipboard operation
modelbased copied to clipboard

estimate_contrasts with glm binomial to obtain probabilities

Open ManuelSpinola opened this issue 3 years ago • 0 comments

library(emmeans) library(modelbased)

How can I obtain the contrast in probabilities. When I use the argument, transform = "response", I got Odds ratio, not probabilities.

neuralgia_mod <- glm(Pain ~ Sex, family = binomial(), data = neuralgia)

estimate_contrasts(neuralgia_mod, transform = "response")
Marginal Contrasts Analysis

Level1 | Level2 | Odds_ratio |       95% CI |   SE |  df |     z |     p
------------------------------------------------------------------------
F      |      M |       0.28 | [0.09, 0.82] | 0.15 | Inf | -2.31 | 0.021

Marginal contrasts estimated for Sex
p-value adjustment method: Holm (1979)


I can obtain probabilities with emmeans:

emmeans(neuralgia_mod, "Sex", type = "response") %>%
regrid() %>%
pairs(type = "response")

 contrast estimate    SE  df z.ratio p.value
 F - M        -0.3 0.121 Inf  -2.474  0.0134

ManuelSpinola avatar Oct 26 '21 18:10 ManuelSpinola