I posted this question already on Stack Overflow (here) but it was suggested to ask this question here on StackExchange. So, I have a question concerning different outputs when changing the type-argument in the margins-package in R. Here is a reproducible example:
library(margins) x <- glm(am ~ cyl + hp * wt, data = mtcars, family = binomial) me <- margins(x, type = "response") me2 <- margins(x, type = "link") summary(me) summary(me2)
Both summaries yield different outputs in level but as well as in significance. So my question is, why is the p-value different for both types? And which version is preferable? This is the respective output:
> summary(me) factor AME SE z p lower upper cyl 0.0216 0.0493 0.4377 0.6616 -0.0750 0.1181 hp 0.0027 0.0023 1.1596 0.2462 -0.0018 0.0072 wt -0.5158 0.2685 -1.9209 0.0547 -1.0421 0.0105 > summary(me2) factor AME SE z p lower upper cyl 0.5156 1.1695 0.4409 0.6593 -1.7765 2.8077 hp 0.0515 0.0357 1.4430 0.1490 -0.0185 0.1215 wt -12.2426 7.6784 -1.5944 0.1108 -27.2920 2.8067
This is the package's manual:
They explain that the type "response" returns partial effects, i.e. the contribution of each variable on the outcome scale, conditional on the other variables involved in the link function transformation of the linear predictor, and that type "link" returns true marginal effects, i.e. the marginal contribution of each variable on the scale of the linear predictor.
So, I somehow get that calculating the significance of a linear coefficient is the t-statistic of this exact coefficient divided by its standard error. This should reflect the significance level of the average partial effect. This term might differ if I have to transform the coefficient first to the response scale (e.g. exponential function for exponential link). But nevertheless, I think I do not quite understand the difference between true marginal effects and partial effects and their respective interpretation. Which one should I actually use? The margins-package's vignette states that there is some debate but I cannot imagine any advantages nor disadvantages. Any help would be appreciated. Thank you!