Learn R Programming

DAMisc (version 1.3)

ordAveEffPlot: Plot Average Effects of Variables in Proportional Odds Logistic Regression

Description

For objects of class polr the function plots the average effect of a single variable holding all other variables at their observed values.

Usage

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

Arguments

obj
An object of class polr
varname
A string providing the name of the variable for which you want the plot to be drawn.
data
Data used to estimate obj.
R
Number of simulations to generate confidence intervals.
nvals
Number of evaluation points of the function
plot
Logical indicating whether or not the result should be plotted (if TRUE) or returned to the console (if FALSE).
...
Arguments passed down to the call 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

Details

Following the advice of Hanmer and Kalkan (2013) the function calculates the average effect of a variable holding all other variables at observed values and then plots the result.

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(MASS)
data(france)
polr.mod <- polr(vote ~ age + male + retnat + lrself, data=france)
ordAveEffPlot(polr.mod, "lrself", data=france)

Run the code above in your browser using DataLab