In R, there are two packages: emmeans and margins. The first implements the LS-means known from SAS, here called estimated marginal means, the second implements the margins command from Stata. I understand the idea of the LS-means (prediction on a grid of level of categories and averaged continuous predictors). Marginal means are equal to raw means, if the design if balanced. But how does it relate to marginal effects?
An effect is a difference of two means. We have simple effects, where we compare means on two levels of a categorical predictor. We have main effects, where we compare "global averages" across all levels of a categorical predictor. But what is a marginal effect? And does it relate to marginal mean?
I heard it's related to change of the response based on change in predictors, but isn't that what the model coefficients tell us? Like "a unit change in X1, ceteris paribus, changes the response by 32.1 units". So how the marginal effect relates to the model coefficients?
To summarize, what are the relationships, if any, between:
- marginal effect and marginal mean
- marginal effect and model coefficient
- marginal effect and main/simple effect