Learn R Programming

spsur (version 1.0.0.4)

spsur3sls: Three Stages Least Squares estimation,3sls, of spatial SUR models.

Description

The function estimates spatial SUR models using three stages least squares, where the instruments are obtained from the spatial lags of the X variables, assumed to be exogenous. The number of equations, time periods and spatial units is not restricted. The user can choose between a Spatial Durbin Model or a Spatial Lag Model, as described below. The estimation procedure allows for the introduction of linear restrictions on the \(\beta\) parameters associated to the regressors.

Usage

spsur3sls(
  Form = NULL,
  data = NULL,
  R = NULL,
  b = NULL,
  W = NULL,
  X = NULL,
  Y = NULL,
  G = NULL,
  N = NULL,
  Tm = NULL,
  p = NULL,
  demean = FALSE,
  type = "slm",
  maxlagW = 2
)

Arguments

Form

An object created with the package Formula that describes the model to be estimated. This model may contain several responses (explained variables) and a varying number of regressors in each equation.

data

An object of class data.frame or a matrix.

R

A row vector of order (1xpr) with the set of r linear constraints on the beta parameters. The first restriction appears in the first p terms, the second restriction in the next p terms and so on. Default = NULL.

b

A column vector of order (rx1) with the values of the linear restrictions on the beta parameters. Default = NULL.

W

A spatial weighting matrix of order (NxN), assumed to be the same for all equations and time periods.

X

A data matrix of order (NTmGxp) with the observations of the regressors The number of covariates in the SUR model is p = \(sum(p_{g})\) where \(p_{g}\) is the number of regressors (including the intercept) in the g-th equation, g = 1,...,G). The specification of X is only necessary if not available a Formula and a data frame. Default = NULL.

Y

A column vector of order (NTmGx1), with the observations of the explained variables. The ordering of the data must be (first) equation, (second) time dimension and (third) Cross-sectional/spatial units. The specification of Y is only necessary if not available a Formula and a data frame. Default = NULL.

G

Number of equations.

N

Number of cross-section or spatial units

Tm

Number of time periods.

p

Number of regressors by equation, including the intercept. p can be a row vector of order (1xG), if the number of regressors is not the same for all the equations, or a scalar, if the G equations have the same number of regressors. The specification of p is only necessary if not available a Formula and a data frame.

demean

Logical value to allow for the demeaning of panel data. In this case, spsurml substracts the individual mean to each spatial or cross-sectional unit. Default = FALSE.

type

Type of spatial model, restricted to cases where lags of the explainded variable appear in the righ hand side of the equations. There are two possibilities: "slm" or "sdm". Default = "slm".

maxlagW

Maximum spatial lag order of the regressors employed to produce spatial instruments for the spatial lags of the explained variables. Default = 2. Note that in case of type="sdm", the default value for maxlagW is set to 3 because the first lag of the regressors, \(WX_{tg}\), can not be used as spatial instruments.

Value

Output of the three-stages Least-Squares estimation of the specified spatial model. A list with:

call Matched call.
type Type of model specified.
betas Estimated coefficients for the regressors.
deltas Estimated spatial coefficients.
se_betas Estimated standard errors for the estimates of \(\beta\) coefficients.
se_deltas Estimated standard errors for the estimates of the spatial coefficients.
cov Estimated covariance matrix for the estimates of beta's and spatial coefficients.
R2 Coefficient of determination for each equation, obtained as the squared of the correlation coefficient between the corresponding explained variable and its estimates. spsur3sls also shows a global coefficient of determination obtained, in the same manner, for the set of G equations.
Sigma Estimated covariance matrix for the residuals of the G equations.
Sigma_corr Estimated correlation matrix for the residuals of the G equations.
Sigma_inv Inverse of Sigma, the (GxG) covariance matrix of the residuals of the SUR model.
residuals Residuals of the model.
df.residuals Degrees of freedom for the residuals.
fitted.values Estimated values for the dependent variables.
G Number of equations.
N Number of cross-sections or spatial units.
Tm Number of time periods.
p Number of regressors by equation (including intercepts).
demean Logical value used for demeaning.
Y Vector Y of the explained variables of the SUR model.
X Matrix X of the regressors of the SUR model.
W Spatial weighting matrix.

Details

spsur3sls can be used to estimate two groups of spatial models:

  • "slm": SUR model with spatial lags of the endogenous in the right hand side of the equations $$y_{tg} = \lambda_{g} Wy_{tg} + X_{tg} \beta_{g} + \epsilon_{tg} $$

  • "sdm": SUR model of the Spatial Durbin type $$ y_{tg} = \lambda_{g} Wy_{tg} + X_{tg} \beta_{g} + WX_{tg} \theta_{g} + \epsilon_{tg} $$

where \(y_{tg}\) and \(\epsilon_{tg}\) are (Nx1) vectors, corresponding to the g-th equation and time period t; \(X_{tg}\) is the matrix of regressors, of order (Nxp_g). Moreover, \(\lambda_{g}\) is a spatial coefficient and W is a (NxN) spatial weighting matrix.

By default, the input of this function is an object created with Formula and a data frame. However, spsur3sls also allows for the direct especification of vector Y and matrix X, with the explained variables and regressors respectively, as inputs (these terms may be the result, for example, of dgp_spsur).

spsur3sls is a Least-Squares procedure in three-stages designed to circumvent the endogeneity problems due to the presence of spatial lags of the explained variable in the right hand side of the equations do the SUR. The instruments are produced internally by spsur3sls using a sequence of spatial lags of the X variables, which are assumed to be exogenous. The user must define the number of (spatial) instruments to be used in the procedure, through the argument maxlagW (i.e. maxlagW=3). Then, the collection of instruments generated is \([WX_{tg}; W*WX_{tg}; W*W*WX_{tg}]\). In the case of a SDM, the first lag of the X matrix already is in the equation and cannot be used as instrument. In the example above, the list of instruments for a SDM model would be \([W^{2}X_{tg}; W^{3}X_{tg}]\).

The first stage of the procedure consists in the least squares of the Y variables on the set of instruments. From this estimation, the procedure retains the estimates of Y in the so-called Yls variables. In the second stage, the Y variables that appear in the right hand side of the equation are substituted by Yls and the SUR model is estimated by Least Squares. The third stage improves the estimates of the second stage through a Feasible Generalized Least Squares estimation of the parameters of the model, using the residuals of the second stage to estimate the Sigma matrix.

The arguments R and b allows to introduce linear restrictions on the beta coefficients of the G equations. spsur3sls, first, introduces the linear restrictions in the SUR model and builds, internally, the corresponding constrained SUR model. Then, the function estimates the restricted model which is shown in the output. The function does not compute the unconstrained model nor test for the linear restrictions. The user may ask for the unconstrained estimation using another spsurml estimation. Moreover, the function wald_betas obtains the Wald test of a set of linear restrictions for an object created previously by spsurml or spsur3sls.

References

  • Mur, J., L<U+00F3>pez, F., and Herrera, M. (2010). Testing for spatial effects in seemingly unrelated regressions. Spatial Economic Analysis, 5(4), 399-440.

  • L<U+00F3>pez, F.A., Mur, J., and Angulo, A. (2014). Spatial model selection strategies in a SUR framework. The case of regional productivity in EU. Annals of Regional Science, 53(1), 197-220.

See Also

spsurml, wald_betas

Examples

Run this code
# NOT RUN {
#################################################
######## CROSS SECTION DATA (G=1; Tm>1) ########
#################################################

#### Example 1: Spatial Phillips-Curve. Anselin (1988, p. 203)
## A SUR model without spatial effects
rm(list = ls()) # Clean memory
data(spc)
Tformula <- WAGE83 | WAGE81 ~ UN83 + NMR83 + SMSA | UN80 + NMR80 + SMSA

## A SUR-SLM model (3SLS Estimation)
spcsur.slm.3sls <-spsur3sls(Form = Tformula, data = spc,
                            type = "slm", W = Wspc)
summary(spcsur.slm.3sls)

## A SUR-SDM model (3SLS Estimation)
spcsur.sdm.3sls <-spsur3sls(Form = Tformula, data = spc,
                            type = "sdm", W = Wspc)
summary(spcsur.sdm.3sls)

#################################################
######## PANEL DATA (G>1; Tm>1)         #########
#################################################

#### Example 2: Homicides + Socio-Economics (1960-90)
# Homicides and selected socio-economic characteristics for continental
# U.S. counties.
# Data for four decennial census years: 1960, 1970, 1980 and 1990.
# https://geodacenter.github.io/data-and-lab/ncovr/
rm(list = ls()) # Clean memory
data(NCOVR)
Tformula <- HR80  | HR90 ~ PS80 + UE80 | PS90 + UE90

## A SUR-SLR model
NCOVRSUR.slm.3sls <-spsur3sls(Form = Tformula, data = NCOVR, type = "slm",
                            W = W, maxlagW = 2)
summary(NCOVRSUR.slm.3sls)

# }

Run the code above in your browser using DataLab