ocME: Marginal Effect for Ordered Choice Model

View source: R/ocME.r

ocMER Documentation

Marginal Effect for Ordered Choice Model

Description

This function calculates marginal effects for an ordered chioce model and their standard errors. Either an ordered probit or logit model can be accommodated.

Usage

ocME(w, rev.dum = TRUE, digits = 3)

Arguments

w

an ordered probit or logit model object estimated by polr from the MASS library.

rev.dum

a logical value (default of TRUE) of whether to revise the estimates and standard erros for binary independant variables. If FALSE, derivatives are taken on binary independant variables as continuous variables.

digits

number of digits for output.

Details

Marginal effects from an ordered probit or logit model is calculated. Marginal effects are calculated at the mean of the independent variables. rev.dum = TRUE allows marginal effects for dummy variables are calculated differently, instead of treating them as continuous variables. The standard errors are computed by delta method. The software of LIMDEP is used to compare and benchmark the results.

Value

Return a list object of class "ocME" with the following components:

w

input of an ordered choice model

out

a list object of marginal effects, standard errors, t-values, and p-values by factor level.

Methods

One method is defined as follows:

print:

print the key output of marginal effects.

Author(s)

Changyou Sun (edwinsun258@gmail.com)

References

Greene, W.H. 2003. Econometric Analysis (5th ed.). Prentice Hall, New York. 1026 P.

See Also

ocProb

Examples

# Loading data from the MASS library
library(MASS)
data(housing) 
str(housing); head(housing)

# Fit an ordered choice model with polr from the MASS library
# This is the original specification used in MASS.
fm <- Sat ~ Infl + Type + Cont
ra <- polr(fm, data = housing, weights = Freq, Hess = TRUE, method = "probit")
rb <- polr(fm, data = housing, weights = Freq, Hess = TRUE, method = "logistic")
summary(ra); summary(rb)

# Compute the marginal effect
mea <- ocME(w = ra); mea
meb <- ocME(w = rb); meb
meb$out

erer documentation built on Sept. 26, 2024, 5:06 p.m.