heckit5rob: Robust Heckit Fit: Switching Regressions

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

View source: R/heckit5rob.R

Description

Fits the switching regression model with probit selection using a robust two-stage estimator

Usage

1
heckit5rob(selection, outcome1, outcome2, data, control = heckitrob.control())

Arguments

selection

formula, the selection equation

outcome1

formula, first outcome equation

outcome2

formula, second outcome equation

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 heckit5rob is called.

control

a list of parameters for controlling the fitting process

Details

Compute robust two-stage extimates of the switching regression model with probit selection. The robust probit is fitted in the first stage. In the second stage the Mallows type M-estimators are used. The values of the tuning constants and the robustness weights can be modified in heckitrob.control.

Value

Object of class "heckit5rob".

coefficients

a named vector of coefficients

stage1

object of class glmrob that contains (first stage) robust probit fit

stage21

object of class rlm that contains second stage first regime robust fit. Note that the standard errors in this object are biased, since they are not corrected for the uncertainty in the first estimation step. Use vcov1 below

stage22

object of class rlm that contains second stage second regime robust fit. Note that the standard errors in this object are biased, since they are not corrected for the uncertainty in the first estimation step. Use vcov2 below

vcov1

variance matrix of the second stage first regime

vcov2

variance matrix of the second stage second regime

sigma1

the standard error of the error term of the outcome equation when y_1=1

sigma2

the standard error of the error term of the outcome equation when y_1=0

IMR1

inverse Mills ratio for the case when y_1=1

IMR2

inverse Mills ratio for the case when y_1=0

call

the matched call

method

method of estimation, currently only "robust two-stage" is implemented

converged

logical. Did all the estimators converge?

iterations

list containing the numbers of iterations

Author(s)

Mikhail Zhelonkin, Marc G. Genton, Elvezio Ronchetti

References

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

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. doi: 10.18637/jss.v099.i04

See Also

glmrob, rlm, ssmrob, heckitrob, heckitrob.control

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
## 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 Aug. 20, 2021, 5:08 p.m.