Skip to content
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

Open
ManuelSpinola opened this issue Oct 14, 2022 · 4 comments

Comments

@ManuelSpinola
Copy link

ManuelSpinola commented Oct 14, 2022

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."

g <- glm(vs ~ factor(am), data = mtcars, family = binomial())

estimate_contrasts(g, contrast = "am", transform = "response")

Marginal Contrasts Analysis

Level1 | Level2 | Difference |        95% CI |   SE |  df |     z |     p
-------------------------------------------------------------------------
am0    |    am1 |      -0.69 | [-2.13, 0.74] | 0.73 | Inf | -0.95 | 0.344

Marginal contrasts estimated at am
p-value adjustment method: Holm (1979)
@DominiqueMakowski
Copy link
Member

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)

@IndrajeetPatil
Copy link
Member

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.

@DominiqueMakowski
Copy link
Member

yes right, I'll submit soon then (I'm testing some of the improvements)

@ManuelSpinola
Copy link
Author

ManuelSpinola commented Oct 16, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants