-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
emmean support for monotonic effects #1134
Labels
Milestone
Comments
Yes that is true. I am not yet sure, how we shall best handle monotonic effects in emmeans. |
I think this would be handled best if it were in the reference grid as a "factor". |
This issue also seems to be solved by the suggestion I made here: #907 (comment) library(brms)
library(emmeans)
income_options <- c("below_20", "20_to_40", "40_to_100", "greater_100")
income <- factor(sample(income_options, 100, TRUE),
levels = income_options, ordered = TRUE)
mean_ls <- c(30, 60, 70, 75)
ls <- mean_ls[income] + rnorm(100, sd = 7)
dat <- data.frame(income, ls)
fit1 <- brm(ls ~ mo(income), data = dat)
emmeans(fit1, ~ income)
#> income emmean lower.HPD upper.HPD
#> below_20 30.3 27.4 33.2
#> 20_to_40 60.1 57.0 63.3
#> 40_to_100 69.4 66.3 72.6
#> greater_100 75.2 72.7 77.8
#>
#> Point estimate displayed: median
#> HPD interval probability: 0.95 |
Implemented via #1177 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
emmeans
seems unable to find monotonic effects (missing from the reference grid):The text was updated successfully, but these errors were encountered: