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?

  • 1
    $\begingroup$ 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). $\endgroup$
    – Trevor
    Commented Oct 19, 2013 at 1:33
  • $\begingroup$ 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 $\endgroup$ Commented Jul 17, 2014 at 15:53
  • 1
    $\begingroup$ 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 $\endgroup$ Commented Feb 12, 2015 at 14:03

1 Answer 1


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:

cowles.mod <- glm(volunteer ~ sex + neuroticism*extraversion,
                  data=Cowles, family=binomial)
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"):

enter image description here

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

enter image description here

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".

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.