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?
Best Answer
In R the
effects
package can easily help with interpreting such coefficients by producing the appropriate graphs. From CRAN: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:
Which will yield:
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".