Conversation
|
For #301, I had to include the trends <- datawizard::data_remove(trends, c("Statistic", "SE", "S", "CI", "df", "rowid_dedup"), verbose = FALSE) # nolintYou must check if everything is still ok in this PR, but for contrasts / contrasting slopes, we need the |
|
can we add that if |
Yes, maybe we add a small helper-functions that checks for all unneeded content. Not sure if "dx/dy" will be the only exception. But for now, just checking for that value should work. |
|
For emmeans, using |
data(mtcars)
data(iris)
dat <- mtcars
dat$gear <- as.factor(dat$gear)
dat$cyl <- as.factor(dat$cyl)
dat <<- dat
# Simple
model <- lm(vs ~ cyl, data = dat)
modelbased::estimate_means(model)
#> We selected `by = c("cyl")`.
#> Estimated Marginal Means
#>
#> cyl | Mean | SE | 95% CI
#> -------------------------------------
#> 4 | 0.91 | 0.09 | [ 0.72, 1.09]
#> 6 | 0.57 | 0.11 | [ 0.34, 0.80]
#> 8 | 2.22e-16 | 0.08 | [-0.16, 0.16]
#>
#> Marginal means estimated at cyl
modelbased::estimate_means(model, backend = "marginaleffects")
#> Estimated Marginal Means
#>
#> cyl | Mean | SE | 95% CI | t(29)
#> ------------------------------------------------
#> 4 | 0.91 | 0.09 | [ 0.72, 1.09] | 10.02
#> 6 | 0.57 | 0.11 | [ 0.34, 0.80] | 5.03
#> 8 | 2.22e-16 | 0.08 | [-0.16, 0.16] | 2.76e-15
#>
#> Marginal means estimated at cylCreated on 2025-01-09 with reprex v2.1.1 |

Fixes #298
Fixes #288
Fixes #225
We should try to match the emmeans' output I'd say, i.e., in marginaleffects: