ssmrob: Robust Sample Selection Model

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/ssmrob.R

Description

Compute robust two-stage estimates of truncated selection model (Tobit-2) and switching regression model (Tobit-5).

Usage

1
ssmrob(selection, outcome, data, control = heckitrob.control())

Arguments

selection

formula, the selection equation

outcome

formula(s), the outcome equation(s)

data

an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which ssmrob is called.

control

a list of parameters for controlling the fitting process

Details

Outcome equation may be a simple formula for the case of Heckman selection model, or a list of two formulas for the case of switching regressions.

Value

Object of class "heckitrob" or object of class "heckit5rob".

Author(s)

Mikhail Zhelonkin, Marc G. Genton, Elvezio Ronchetti

References

Amemiya, T. (1984) Tobit Models: a Survey. Journal of Econometrics, 24, p. 3-61.

Heckman, J.J. (1979) Sample Selection Bias as a Specification Error. Econometrica, 47, p. 153-161.

Zhelonkin, M., Genton M.G., and Ronchetti, E. (2016) Robust Inference in Sample Selection Models. Journal of the Royal Statistical Society, Series B, 78, p. 805-827. doi: 10.1111/rssb.12136

See Also

heckitrob, heckit5rob

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# sample selection model (Tobit-2)
# Zhelonkin, Genton, Ronchetti (2016): page 823
data(MEPS2001)
selectEq <- dambexp ~ age + female + educ + blhisp + totchr + ins
outcomeEq <- lnambx ~ age + female + educ + blhisp + totchr + ins
meps.fit <- ssmrob(selectEq, outcomeEq, data = MEPS2001, control = heckitrob.control(tcc = 3.2))
summary(meps.fit)

# switching regressions example (Tobit-5)
## Not run: 
library(mvtnorm)
set.seed(2)
N <- 5000
beta1 <- c(0, 1.0, 1.0, 0.75)
beta21 <- c(0, 1.5, 1.0, 0.5)
beta22 <- c(1, -1.5, 1.0, 0.5)
covm <- diag(3)
covm[lower.tri(covm)] <- c(0.75, 0.5, 0.25)
covm[upper.tri(covm)] <- covm[lower.tri(covm)]
eps <- rmvnorm(N, rep(0, 3), covm)
x1 <- rmvnorm(N, mean=c(0, -1, 1), sigma=diag(c(1, 0.5, 1)))
x21 <- x1 
x22 <- x1
x21[, 3] <- rnorm(N, 1, 1)
x22[, 3] <- rnorm(N, 1, 1)
x1beta1 <- beta1[1] + x1[, 1]*beta1[2] + x1[, 2]*beta1[3] + x1[, 3]*beta1[4]
x21beta21 <- beta21[1] + x21[, 1]*beta21[2] + x21[, 2]*beta21[3] + x21[, 3]*beta21[4]
x22beta22 <- beta22[1] + x22[, 1]*beta22[2] + x22[, 2]*beta22[3] + x22[, 3]*beta22[4]
y1 <- ifelse(x1beta1 + eps[, 1] > 0, 1, 0)
y2 <- ifelse(y1 > 0.5, x21beta21 + eps[, 2],
x22beta22 + eps[, 3])
srsim.fit <- ssmrob(y1 ~ x1, list(y2 ~ x21, y2 ~ x22), 
control = heckitrob.control(weights.x1 = "hat", weights.x2 = "covMcd"))
summary(srsim.fit)

## End(Not run)

ssmrob documentation built on April 2, 2020, 5:07 p.m.