Learn R Programming

hspm (version 1.1)

ivregimes: Estimation of regime models with endogenous variables

Description

The function ivregimes deals with the estimation of regime models. Most of the times the variable identifying the regimes reveals some spatial aspects of the data (e.g., administrative boundaries). The model includes exogenous as well as endogenous variables among the regressors.

Usage

ivregimes(formula, data, rgv = NULL, vc = c("homoskedastic", "robust", "OGMM"))

Value

An object of class ivregimes. A list of five elements. The first element of the list contains the estimation results. The other elements are needed for printing the results.

Arguments

formula

a symbolic description of the model of the form y ~ x_f | x_v | h_f | h_v where y is the dependent variable, x_f are the regressors that do not vary by regimes, x_v are the regressors that vary by regimes, h_f are the fixed instruments and h_v are the instruments that vary by regimes.

data

the data of class data.frame.

rgv

an object of class formula to identify the regime variables

vc

one of c("homoskedastic", "robust", "OGMM"). If "OGMM" an optimal weighted GMM is used to estimate the VC matrix.

Author

Gianfranco Piras and Mauricio Sarrias

Details

The basic (non spatial) model with endogenous variables can be written in a general way as: $$ y = \begin{bmatrix} X_1& 0 \\ 0 & X_2 \\ \end{bmatrix} \begin{bmatrix} \beta_1 \\ \beta_2 \\ \end{bmatrix} + X\beta + \begin{bmatrix} Y_1& 0 \\ 0 & Y_2 \\ \end{bmatrix} \begin{bmatrix} \pi_1 \\ \pi_2 \\ \end{bmatrix} + Y\pi + \varepsilon $$ where \(y = [y_1^\prime,y_2^\prime]^\prime\), and the \(n_1 \times 1\) vector \(y_1\) contains the observations on the dependent variable for the first regime, and the \(n_2 \times 1\) vector \(y_2\) (with \(n_1 + n_2 = n\)) contains the observations on the dependent variable for the second regime. The \(n_1 \times k\) matrix \(X_1\) and the \(n_2 \times k\) matrix \(X_2\) are blocks of a block diagonal matrix, the vectors of parameters \(\beta_1\) and \(\beta_2\) have dimension \(k_1 \times 1\) and \(k_2 \times 1\), respectively, \(X\) is the \(n \times p\) matrix of regressors that do not vary by regime, \(\beta\) is a \(p\times 1\) vector of parameters. The three matrices \(Y_1\) (\(n_1 \times q\)), \(Y_2\) (\(n_2 \times q\)) and \(Y\) (\(n \times r\)) with corresponding vectors of parameters \(\pi_1\), \(\pi_2\) and \(\pi\), contain the endogenous variables. Finally, \(\varepsilon = [\varepsilon_1^\prime,\varepsilon_2^\prime]^\prime\) is the \(n\times 1\) vector of innovations. The model is estimated by two stage least square. In particular:

  • If vc = "homoskedastic", the variance-covariance matrix is estimated by \(\sigma^2(\hat Z^\prime \hat Z)^{-1}\), where \(\hat Z= PZ\), \(P= H(H^\prime H)^{-1}H^\prime\), \(H\) is the matrix of instruments, and \(Z\) is the matrix of all exogenous and endogenous variables in the model.

  • If vc = "robust", the variance-covariance matrix is estimated by \((\hat Z^\prime \hat Z)^{-1}(\hat Z^\prime \hat\Sigma \hat Z) (\hat Z^\prime \hat Z)^{-1}\), where \(\hat\Sigma\) is a diagonal matrix with diagonal elements \(\hat\sigma_i\), for \(i=1,...,n\).

  • Finally, if vc = "OGMM", the model is estimated in two steps. In the first step, the model is estimated by 2SLS yielding the residuals \(\hat \varepsilon\). With the residuals, the diagonal matrix \(\hat \Sigma\) is estimated and is used to construct the matrix \(\hat S = H^\prime \hat \Sigma H\). Then \(\eta_{OWGMM}=(Z^\prime H\hat S^{-1}H^\prime Z)^{-1}Z^\prime H\hat S^{-1}H^\prime y\), where \(\eta_{OWGMM}\) is the vector of all the parameters in the model, The variance-covariance matrix is: \(n(Z^\prime H\hat S^{-1}H^\prime Z)^{-1}\).

Examples

Run this code
data("natreg")
form   <- HR90  ~ 0 | MA90 + PS90 + RD90 + UE90 | 0 | MA90 + PS90 + RD90 + FH90 + FP89 + GI89
split  <- ~ REGIONS
mod <- ivregimes(formula = form, data = natreg, rgv = split, vc = "robust")
summary(mod)
mod1 <- ivregimes(formula = form, data = natreg, rgv = split, vc = "OGMM")
summary(mod1)
form1   <- HR90  ~ MA90 + PS90 |  RD90 + UE90 -1 | MA90 + PS90 | RD90 + FH90 + FP89 + GI89 -1
mod2 <- ivregimes(formula = form1, data = natreg, rgv = split, vc = "homoskedastic")
summary(mod2)

Run the code above in your browser using DataLab