0

I ran the model below and want to get the marginal effects of "PMSC0to6"(0~6), depending on "Ceasefire2"(binary).

result_PMSC06_CF <- glm(Participatory_Peace ~ sxp  + GDPpc + wartype + coldwar + Ceasefire2*PMSC0to6,
family = binomial(link = "logit"))

So I ran the following,

Sm4_2 <- summary(margins(result_PMSC06_CF, 
                         at = list(Ceasefire2 = 0:1))) %>% 
  dplyr::filter(factor == "PMSC0to6") %>% 
  as.data.frame()

However, I am wondering if I need to put other variables than "Ceasefire2" and "PMSC0to6".

So the question is,

  1. Is Sm4_2 above right to get the marginal effect of PMSC0to6?
  2. If it is not should I put the means of the other variables in at = list()?

Thank you very much in advance.

STUCKINR
  • 1
  • 1

1 Answers1

0

The short answers to your questions:

  1. Yes.

  2. Probably not.

The longer answer to 2.:

In logistic regression, the marginal effect of any covariate varies with respect to all of the covariates. There are a few different approaches to "collapsing" a range of marginal effects into a single marginal effect per covariate:

  • Marginal partial effect (the default in margins::margins) - more detail here
  • Marginal effect for representative cases - pick some representative points, which may or may not be exactly represented in the sample, and calculate the marginal effects at those points (this is generally a manual process and requires some level of familiarity with the subject data)
  • Average marginal effect - compute the marginal effect for all points in the sample and take the mean
  • Marginal effect at means - compute the mean of all covariates and compute the marginal effect at that point, as your second question suggests

The marginal effect at the means is generally not a good option, for reasons discussed here:

Note that some other packages available for R, as well as Stata’s margins and mfx packages enable calculation of so-called “marginal effects at means” (i.e., the marginal effect for a single observation that has covariate values equal to the means of the sample as a whole). The substantive interpretation of these is fairly ambiguous. While it was once common practice to estimate MEMs - rather than AMEs or MERs - this is now considered somewhat inappropriate because it focuses on cases that may not exist (e.g., the average of a 0/1 variable is not going to reflect a case that can actually exist in reality) and we are often interested in the effect of a variable at multiple possible values of covariates, rather than an arbitrarily selected case that is deemed “typical” in this way.

All of the other options, including the marginal partial effect calculated by your current code, are valid and useful under different circumstances. But depending on your end goal, it's probably worthwhile to look at how other covariates impact the marginal effect of Ceasefire2 by adding those covariates to the at argument as part of the EDA process.

tfehring
  • 394
  • 2
  • 6