Learn R Programming

ssmrob (version 1.0)

ssmrob: Robust Sample Selection Model

Description

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

Usage

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

Value

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

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.

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. 10.1111/rssb.12136

Zhelonkin, M., Ronchetti, E. (2021) Robust Analysis of Sample Selection Models through the R Package ssmrob. Journal of Statistical Software, 99, 4, p. 1-35. 10.18637/jss.v099.i04

See Also

heckitrob, heckit5rob

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab