Show the code
library(ggeffects)
m <- lm(Petal.Width ~ Petal.Length + Species, data = iris)
marginaleffects::avg_slopes(m, variables = "Species")
Contrast Estimate Std. Error z Pr(>|z|) S 2.5 %
mean(versicolor) - mean(setosa) 0.435 0.103 4.23 <0.001 15.4 0.234
mean(virginica) - mean(setosa) 0.838 0.145 5.76 <0.001 26.9 0.553
97.5 %
0.637
1.123
Term: Species
Type: response
Columns: term, contrast, estimate, std.error, statistic, p.value, s.value, conf.low, conf.high, predicted_lo, predicted_hi, predicted