-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
estimate_contrasts with transform = "response" for a logistic model does not give estimates in terms of probabilities #215
Comments
Can you update the package and check again? This works for me: g <- glm(vs ~ factor(am), data = mtcars, family = binomial())
modelbased::estimate_contrasts(g, contrast = "am", transform = "response")
#> Marginal Contrasts Analysis
#>
#> Level1 | Level2 | Odds ratio | 95% CI | SE | df | z | p
#> ------------------------------------------------------------------------
#> am0 | am1 | 0.50 | [0.12, 2.10] | 0.37 | Inf | -0.95 | 0.344
#>
#> Marginal contrasts estimated at am
#> p-value adjustment method: Holm (1979) Created on 2022-10-16 by the reprex package (v2.0.1) |
I really think we should be updating the CRAN version soon. This issue keeps resurfacing here, and we keep asking users to update to the GitHub version. |
yes right, I'll submit soon then (I'm testing some of the improvements) |
Thank you Dominique.
May be I am confused but I was expecting the difference in probabilities
not in odds ratios, like the help says.
I can have the difference in probabilities using the emmeans package:
em <- emmeans(g, "am", type = "response") |>
regrid()
pairs(em)
contrast estimate SE df z.ratio p.value
am0 - am1 -0.17 0.177 Inf -0.960 0.3370
El dom, 16 oct 2022 a las 2:47, Dominique Makowski (<
***@***.***>) escribió:
… Can you update the package and check again? This works for me:
g <- glm(vs ~ factor(am), data = mtcars, family = binomial())
modelbased::estimate_contrasts(g, contrast = "am", transform = "response")#> Marginal Contrasts Analysis#> #> Level1 | Level2 | Odds ratio | 95% CI | SE | df | z | p#> ------------------------------------------------------------------------#> am0 | am1 | 0.50 | [0.12, 2.10] | 0.37 | Inf | -0.95 | 0.344#> #> Marginal contrasts estimated at am#> p-value adjustment method: Holm (1979)
Created on 2022-10-16 by the reprex package <https://reprex.tidyverse.org>
(v2.0.1)
—
Reply to this email directly, view it on GitHub
<#215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFI3FBYJVRRHYHDZ7KJNCP3WDO6JVANCNFSM6AAAAAARFIHXWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
***@***.*** ***@***.***>
***@***.***
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When doing estimate_contrasts with transform = "response" for a logistic model the estimates are not in terms of probabilities like the help page said:
"Thus for a logistic model, "none" will give estimations expressed in log-odds (probabilities on logit scale) and "response" in terms of probabilities."
The text was updated successfully, but these errors were encountered: