Title: | Robust Estimation of Probit Models with Endogeneity |
---|---|
Description: | Package provides a set of tools for robust estimation and inference for probit model with endogenous covariates. The current version contains a robust two-step estimator. For technical details, see Naghi, Varadi and Zhelonkin (2022), <doi:10.1016/j.ecosta.2022.05.001>. |
Authors: | Mikhail Zhelonkin [aut, cre] , Andre Bik [aut], Andrea Naghi [aut] |
Maintainer: | Mikhail Zhelonkin <[email protected]> |
License: | GPL-2 |
Version: | 0.1 |
Built: | 2024-12-18 06:38:08 UTC |
Source: | CRAN |
Package provides a set of tools for robust estimation of probit models with endogeneity.
Package: | epmrob |
Type: | Package |
Version: | 1.0 |
Date: | 2023-06-14 |
License: | GPL-2 |
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Maintainer: Mikhail Zhelonkin <[email protected]>
Naghi, A. A., Varadi, M., & Zhelonkin, M. (2022). Robust Estimation of Probit Models with Endogeneity. Econometrics and Statistics. doi:10.1016/j.ecosta.2022.05.001
Returns the coefficients of the robust two-stage estimator for endogenous probit model.
## S3 method for class 'epmrob' coef(object, ...)
## S3 method for class 'epmrob' coef(object, ...)
object |
object of class " |
... |
currently not used. |
Returns a list of two vectors of parameters of two stages.
R |
coefficients of the reduced equation. |
O |
coefficients of the outcome equation. |
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Fits the endogenous probit model using a robust two-stage estimator.
epmrob(reduced, outcome, data, control = rob.control())
epmrob(reduced, outcome, data, control = rob.control())
reduced |
formula, the reduced equation. |
outcome |
formula, the outcome equation. |
data |
an optional data frame containing the variables in the model. If not found in data, the variables are taken from |
control |
a list of parameterse for controlling the fitting process. |
Compute robust two-step estimates of the endogenous probit model. The robust linear regression is fitted in the first stage. In the second stage a Mallows-type M-estimator is used instead of the probit MLE.
The values of the tuning constants and the robustness weights can be modified in rob.control
.
Object of class "epmrob".
coefficients |
a named vector of coefficients |
stage1 |
object of class |
stage2 |
object of class |
vcov |
variance matrix of the second stage |
call |
the matched call |
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Naghi, A. A., Varadi, M., and Zhelonkin, M. (2022). Robust Estimation of Probit Models with Endogeneity. Econometrics and Statistics. doi:10.1016/j.ecosta.2022.05.001
Extracts the variance covariance matrix of the robust endogenous probit model fit by applying a bootstrap.
epmrob.vcov(object, B = 200, control = rob.control())
epmrob.vcov(object, B = 200, control = rob.control())
object |
object of class " |
B |
the number of samples used in the bootstrapping process used to calculate the variance covariance matrix. |
control |
a list of parameters for controlling the fitting process. |
The variance covariance matrix is estimated by applying a bootstrap
Variance covariance matrix of the entire estimation procedure. Variance covariance matrix of the reduced stage or outcome stage can be extracted using the vcov
function for the corresponding stage estimator, e.g. vcov(epmrob.object$stage1)
or vcov(epmrob.object$stage2)
.
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Compute robust two-stage estimates of probit model with endogeneity.
IVProbitRob(reduced, outcome, data, control = rob.control())
IVProbitRob(reduced, outcome, data, control = rob.control())
reduced |
formula, the reduced function. |
outcome |
formula, the outcome function. |
data |
an optional data fram containing the varaibles in the model. If not found in data, the variables are taken from |
control |
a list of parameters for controlling the fitting process. |
Compute robust two-step estimates of the endogenous probit model.
Object of class "epmrob".
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Naghi, A. A., Varadi, M., & Zhelonkin, M. (2022). Robust Estimation of Probit Models with Endogeneity. Econometrics and Statistics. doi:10.1016/j.ecosta.2022.05.001
library(mvtnorm) N <- 2000 M <- 500 cont.frac = 0.01 rho = 0.5 sigma = matrix(c(1, rho, rho, 1), 2, 2) gamma1 = 1 gamma2 = c(0.6, 0.4) alpha1 = c(0.5) beta1 = 0.5 set.seed(123) X1 = rnorm(N,0,1) X2 = rnorm(N,0,1) X3 = rnorm(N,0,1) eps = rmvnorm(N, mean =rep(0,2), sigma = sigma) Y1 = X1*gamma1 + X2*gamma2[1] + X3*gamma2[2] + eps[,1] Y2 = ifelse(X1*beta1 + Y1*alpha1 + eps[,2] > 0, 1, 0) dat.exmpl <- data.frame(Y2, Y1, X1, X2, X3) names(dat.exmpl) <- c("int", "endo", "exo", "ivrbl", "ivrbl2") ivp.fit <- IVProbitRob(endo ~ exo + ivrbl + ivrbl2, int ~ endo + exo, data = dat.exmpl, control = rob.control(weights.x1 = "hat", weights.x2 = "hat")) ivp.fit
library(mvtnorm) N <- 2000 M <- 500 cont.frac = 0.01 rho = 0.5 sigma = matrix(c(1, rho, rho, 1), 2, 2) gamma1 = 1 gamma2 = c(0.6, 0.4) alpha1 = c(0.5) beta1 = 0.5 set.seed(123) X1 = rnorm(N,0,1) X2 = rnorm(N,0,1) X3 = rnorm(N,0,1) eps = rmvnorm(N, mean =rep(0,2), sigma = sigma) Y1 = X1*gamma1 + X2*gamma2[1] + X3*gamma2[2] + eps[,1] Y2 = ifelse(X1*beta1 + Y1*alpha1 + eps[,2] > 0, 1, 0) dat.exmpl <- data.frame(Y2, Y1, X1, X2, X3) names(dat.exmpl) <- c("int", "endo", "exo", "ivrbl", "ivrbl2") ivp.fit <- IVProbitRob(endo ~ exo + ivrbl + ivrbl2, int ~ endo + exo, data = dat.exmpl, control = rob.control(weights.x1 = "hat", weights.x2 = "hat")) ivp.fit
epmrob
object
Print an object generated by epmrob
.
## S3 method for class 'epmrob' print(x, digits = 4, ...)
## S3 method for class 'epmrob' print(x, digits = 4, ...)
x |
object of |
digits |
number of significant digits to be printed. |
... |
currently not used. |
No return value.
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
summary.epmrob
Print a summary.epmrob
object.
## S3 method for class 'summary.epmrob' print(x, digits = 4, ...)
## S3 method for class 'summary.epmrob' print(x, digits = 4, ...)
x |
object of class |
digits |
number of nonzero digits after comma. |
... |
currently not used. |
No return value.
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Auxiliary function used for fitting the endogenous probit models. Contains control sequences, tuning constants and robustness weight functions.
rob.control(acc = 1e-04, maxit = 50, weights.x1 = c("none", "hat", "robCov", "covMcd"), weights.x2 = c("none", "hat", "robCov", "covMcd"), clevel1 = 0.95, tcc = 1.345)
rob.control(acc = 1e-04, maxit = 50, weights.x1 = c("none", "hat", "robCov", "covMcd"), weights.x2 = c("none", "hat", "robCov", "covMcd"), clevel1 = 0.95, tcc = 1.345)
acc |
positive convergence level. |
maxit |
integer giving the maximum number of iterations. |
weights.x1 |
vector of robustness weights controlling for the leverage effect in the reduced equation. |
weights.x2 |
vector of robustness weights controlling for the leverage effect in the outcome equation. |
clevel1 |
value for the critical level for the first stage. |
tcc |
tuning constant c for Huber's psi-function for the first, reduced, stage. |
A list with the arguments as components.
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Summarizes robust fit of endogenous probit models.
## S3 method for class 'epmrob' summary(object, ...)
## S3 method for class 'epmrob' summary(object, ...)
object |
object of class " |
... |
currently not used. |
object of class "summary.epmrob
".
Mikhail Zhelonkin, Andre Bik, Andrea Naghi
Auxiliary function. Computation of the leverage weights based on robust Mahalanobis distance.
xweights(X, weight, clevel1)
xweights(X, weight, clevel1)
X |
matrix of explanatory variables. |
weight |
method used to calculated the weighting. |
clevel1 |
the critical level used for calculating the Mahalanobis distance. |
Vector of weights.
Mikhail Zhelonkin, Andre Bik, Andrea Naghi