spsurgs3sls {spsur}R Documentation

General Spatial 3SLS for systems of spatial equations.

Description

The function estimates spatial SUR models using general spatial three stages least squares. This is a system instrumental variable procedure which also include GMM estimation when there is spatial correlations in the errors. The procedure allows for additional endogenous regressors in addition to spatial lags of the dependent variable. It could be applied to "slm", "sdm", "sem" and "sarar" spatial models. Furthermore, for non-spatial models including endogenous regressors ("iv"), it could be used to estimate using instrumental variables and Feasible Generalized Least Squares.

Usage

spsurgs3sls(formula = NULL, data = NULL, na.action,
                  listw = NULL, zero.policy = NULL, 
                  type = "slm", Durbin = FALSE,
                  endog = NULL, instruments = NULL,
                  lag.instr = FALSE, initial.value = 0.2, 
                  het = FALSE, trace = TRUE)

Arguments

formula

An object type Formula similar to objects created with the package Formula describing the equations to be estimated in the model. 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.

na.action

A function (default options("na.action")), can also be na.omit or na.exclude with consequences for residuals and fitted values. It may be necessary to set zero.policy to TRUE because this subsetting may create no-neighbour observations.

listw

A listw object created for example by nb2listw from spatialreg package; if nb2listw not given, set to the same spatial weights as the listw argument. It can also be a spatial weighting matrix of order (NxN) instead of a listw object. Default = NULL.

zero.policy

Similar to the corresponding parameter of lagsarlm function in spatialreg package. (NxN) instead of a listw object. Default = NULL.

type

Type of spatial model specification: "sim", "iv", "slm", "sem", "sdm" or "sarar" . Default = "slm".

Durbin

If a formula object and model is type "sdm" the subset of explanatory variables to lag for each equation.

endog

Additional endogenous variables. Default NULL. If not NULL should be specified as a Formula with no dependent variable. Examples: ~ x1 | x2 (x1 endogeous regressor for the first equation and x2 endogeneous regressor for the second equation) or ~ x1 | . (x1 endogenous regressor for the first equation and none endogenous regressors for the second equation)

instruments

external instruments. Default NULL. If not NULL should be specified as a formula with no dependent variable in the same way than previous endog argument.

lag.instr

should the external instruments be spatially lagged?

initial.value

he initial value for rho. It can be either numeric (default is 0.2) or set to 'SAR', in which case the optimization will start from the estimated coefficient of a regression of the 2SLS residuals over their spatial lag (i.e. a spatial AR model)

het

default FALSE: if TRUE uses the methods developed for heteroskedasticity for each equation. Wrapper using spreg function.

trace

A logical value to show intermediate results during the estimation process. Default = TRUE.

Details

spsurg3sls generalize the spreg function to multiequational spatial SUR models. The methodology to estimate spatial SUR models by Generalized 3SLS follows the steps outlined in Kelejian and Piras (pp. 304-305). The summary of the algorithm is the next one:

Value

Object of spsur class with the output of the three-stages least-squares estimation of the specified spatial model. A list with:

call Matched call.
type Type of model specified.
Durbin Value of Durbin argument.
coefficients Estimated coefficients for the regressors.
deltas Estimated spatial coefficients.
rest.se Estimated standard errors for the estimates of \beta coefficients.
deltas.se Estimated standard errors for the estimates of the spatial coefficients.
resvar 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.
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).
Y If data is NULL, vector Y of the explained variables of the SUR model.
X If data is NULL, matrix X of the regressors of the SUR model.
W Spatial weighting matrix.
zero.policy Logical value of zero.policy .
listw_style Style of neighborhood matrix W.

Author(s)

Fernando López fernando.lopez@upct.es
Román Mínguez roman.minguez@uclm.es
Jesús Mur jmur@unizar.es

References

See Also

spreg, spsur3sls, stsls, spsurml

Examples


#### Example 1: Spatial Phillips-Curve. Anselin (1988, p. 203)
rm(list = ls()) # Clean memory
data(spc)
lwspc <- spdep::mat2listw(Wspc, style = "W")
## No endogenous regressors  
Tformula <- WAGE83 | WAGE81 ~ UN83 + NMR83 + SMSA | UN80 + NMR80 + SMSA
## Endogenous regressors and Instruments
Tformula2 <- WAGE83 | WAGE81 ~  NMR83 | NMR80 
## Endogenous regressors: UN83 , UN80
## Instrumental variable: SMSA

## A IV model with endogenous regressors only in first equation
spciv <- spsurgs3sls(formula = Tformula2, data = spc,
                      type = "iv", listw = lwspc,
                      endog = ~ UN83 | ., 
                      instruments = ~ SMSA | .)
summary(spciv)
print(spciv)
#########################################################################
## A SLM model with endogenous regressors 
spcslm <- spsurgs3sls(formula = Tformula2, data = spc,
                              endog = ~ UN83 | ., 
                              instruments = ~ SMSA |.,
                              type = "slm", 
                              listw = lwspc)
summary(spcslm)
print(spcslm)                           
impacts_spcslm <- impactspsur(spcslm, listw = lwspc, R = 1000)
summary(impacts_spcslm[[1]], zstats = TRUE, short = TRUE)
summary(impacts_spcslm[[2]], zstats = TRUE, short = TRUE)
#########################################################################
## A SDM model with endogenous regressors 
spcsdm <- spsurgs3sls(formula = Tformula2, data = spc,
                   endog = ~ UN83 | UN80, 
                   instruments = ~ SMSA | SMSA,
                   type = "sdm", listw = lwspc,
                   Durbin =  ~  NMR83 | NMR80)
summary(spcsdm)
## Durbin only in one equation
spcsdm2 <- spsurgs3sls(formula = Tformula2, data = spc,
                    endog = ~ UN83 | UN80, 
                    instruments = ~ SMSA | SMSA,
                    type = "sdm", listw = lwspc,
                    Durbin =  ~  NMR83 | .)
summary(spcsdm2)
#########################################################################
## A SEM model with endogenous regressors 
spcsem <- spsurgs3sls(formula = Tformula2, data = spc,
                      endog = ~ UN83 | UN80, 
                      instruments = ~ SMSA | SMSA,
                      type = "sem", listw = lwspc)
summary(spcsem)
print(spcsem)                           
#########################################################################
## A SARAR model with endogenous regressors 
spcsarar <- spsurgs3sls(formula = Tformula2, data = spc,
                        endog = ~ UN83 | UN80, 
                        instruments = ~ SMSA | SMSA,
                        type = "sarar", listw = lwspc)
summary(spcsarar)
print(spcsarar)                           
impacts_spcsarar <- impactspsur(spcsarar, listw = lwspc, R = 1000)
summary(impacts_spcsarar[[1]], zstats = TRUE, short = TRUE)
summary(impacts_spcsarar[[2]], zstats = TRUE, short = TRUE)

[Package spsur version 1.0.2.5 Index]