ocME | R Documentation |
This function calculates marginal effects for an ordered chioce model and their standard errors. Either an ordered probit or logit model can be accommodated.
ocME(w, rev.dum = TRUE, digits = 3)
w |
an ordered probit or logit model object estimated by |
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. |
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.
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. |
One method is defined as follows:
print
:print the key output of marginal effects.
Changyou Sun (edwinsun258@gmail.com)
Greene, W.H. 2003. Econometric Analysis (5th ed.). Prentice Hall, New York. 1026 P.
ocProb
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.