Learn R Programming

DAMisc (version 1.3)

mnlAveEffPlot: Average Effects Plot for Multinomial Logistic Regression

Description

Produces a plot of average effects for one variable while holding the others constant at observed values.

Usage

mnlAveEffPlot(obj, varname, data, R = 1500, nvals = 25, plot = TRUE, ...)

Arguments

obj
An object of class multinom.
varname
A string indicating the variable for which the plot is desired.
data
The data used to estimate obj.
R
Number of simulations used to generate confidence bounds.
nvals
Number of evaluation points for the predicted probabilities.
plot
Logical indicating whether a plot should be produced (if TRUE) or numerical results should be returned (if FALSE).
...
Other arguments to be passed down to xyplot.

Value

  • Either a plot or a data frame with variables
  • meanThe average effect (i.e., predicted probability)
  • lowerThe lower 95% confidence bound
  • upperThe upper 95% confidence bound
  • yThe values of the dependent variable being predicted
  • xThe values of the independent variable being manipulated

References

Hanmer, M.J. and K.O. Kalkan. 2013. Behind the Curve: Clarifying the Best Approach to Calculating Predicted Probabilities and Marginal Effects from Limited Dependent Variable Models. American Journal of Political Science. 57(1): 263-277.

Examples

Run this code
library(nnet)
data(france)
mnl.mod <- multinom(vote ~ age + male + retnat + lrself, data=france)
mnlAveEffPlot(mnl.mod, "lrself", data=france)

Run the code above in your browser using DataLab