# Presenting marginal effects of logit with fixed effects

I have a traditional logit model with a dichotomous dependent variable and several independent variables. One of the IVs is categorical and in my R code, I treat it as a factor.

In the past, I've presented marginal effects by creating a simulated dataset in which I hold all variables at their mean or median and then increment the variable of interest over its range. I then use the estimated model to get the predicted probability of a given outcome over the range of the variable of interest. This is then easily plotted to create a nice graphical interpretation of the estimated effect of changes in the variable of interest.

But in the fixed effect case, where one variable in the model is a factor, how does one generate an analogous graph?

Do I need a separate estimated effect graph for each value of the factor variable or is there someway to estimate an average effect of the changes in the variable of interest over all the categories in factor variable while all other variables are held at their mean?

• I'd also love an answer to this. What I did is just used the mean value for the fixed factor variable (I am using time and group FE, not individual). – Trevor Oct 19 '13 at 1:33
• I've since learned that logit FE is often inconsistent and should not be used in most cases. Instead, conditional logit can be used, but this presents another set of challenges that I ask about here – biased_estimator Jul 17 '14 at 15:53
• Some more concise terms for "a separate effect graph for each value of the factor variable" would be "small multiples", "faceted", "lattice", or "trellis" graphs. Might make searching easier – shadowtalker Feb 12 '15 at 14:03

In R the effects package can easily help with interpreting such coefficients by producing the appropriate graphs. From CRAN:

effects: Effect Displays for Linear, Generalized Linear, and Other Models

Graphical and tabular effect displays, e.g., of interactions, for various statistical models with linear predictors.

The package comes with two papers by John Fox describing the use of the package (along with examples) and the underlying implementation. The package takes good care of dealing with the subtle details and implementation difficulties for the supported models.

As an example:

require(car)
require(effects)
data(Cowles)
cowles.mod <- glm(volunteer ~ sex + neuroticism*extraversion,
data=Cowles, family=binomial)
Anova(cowles.mod)
plot(effect("neuroticism*extraversion", cowles.mod))
plot(effect("sex", cowles.mod))  ##for dummy, but should be similar for factors


Which will yield:

> Anova(cowles.mod)
Analysis of Deviance Table (Type II tests)

Response: volunteer
LR Chisq Df Pr(>Chisq)
sex                        4.9184  1   0.026572 *
neuroticism                0.3139  1   0.575316
extraversion              22.1372  1  2.538e-06 ***
neuroticism:extraversion   8.6213  1   0.003323 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


And for the graph, which displays the predicted values of Y on the vertical axis, and the effect of X ("neuroticism") on Y given various levels of Z ("extraversion"):

Here's the effect plot for the dummy (but it should work similarly for factors):

Lastly, there seems to be some confusion surrounding partial effects (holding other predictors constant) vs marginal effects (ignoring other predictors). In my understanding the effects package is concerned with displaying "partial effects".

• The gist of this answer seems to be, "yes, use small multiples." – shadowtalker Feb 12 '15 at 14:04
• Well, that, and delegate such decision making to effects package, which knows better (and uses lattice graphics, btw). – landroni Feb 12 '15 at 14:55