Learn R Programming

Rchoice (version 0.3-6)

effect.hetprob: Get average marginal effects for heterokedastic binary models

Description

Obtain the average marginal effects from hetprob class model.

Usage

# S3 method for hetprob
effect(object, vcov = NULL, digits = max(3, getOption("digits") - 2), ...)

# S3 method for effect.hetprob summary(object, ...)

# S3 method for effect.hetprob print(x, ...)

# S3 method for summary.effect.hetprob print(x, digits = max(3, getOption("digits") - 3), ...)

Value

An object of class effect.heprob.

Arguments

object

an object of class hetprob and effect.hetprob for summary and print method.

vcov

an estimate of the asymptotic variance-covariance matrix of the parameters for a hetprob object.

digits

the number of digits.

...

further arguments.Ignored.

x

an object of class effect.hetprob.

Author

Mauricio Sarrias.

Details

This function allows to obtain the average marginal effects (not the marginal effects at the mean). The standard errors are computed using Delta Method.

Examples

Run this code
# \donttest{
# Data
library("AER")
data("PSID1976")
PSID1976$lfp  <- as.numeric(PSID1976$participation == "yes")
PSID1976$kids <- with(PSID1976, factor((youngkids + oldkids) > 0,
                                      levels = c(FALSE, TRUE), 
                                      labels = c("no", "yes")))
                                      PSID1976$finc <-  PSID1976$fincome / 10000
                                 
# Average marginal effects for heteroskedastic Probit model
labor_het <- hetprob(lfp ~  age + I(age^2) + finc + education + factor(kids) | 
                            factor(kids) + finc,              
                     data = PSID1976,                        
                     link = "probit")
eff_labor_het <- effect(labor_het)
summary(eff_labor_het)
# }

Run the code above in your browser using DataLab