impactspsur {spsur} | R Documentation |
Direct, indirect and total effects estimated for a spatial SUR model
Description
This function is a wrapper for impacts
method
used in spatialreg package. Nevertheless, in this case the same
method is used for both lagsarlm
and
lmSLX
objects. For details of implementation,
see the documentation of impacts
function in
spatialreg package.
The function obtains the multiplier effects, on the explained variable,
of a change in a regressor for the model that has been estimated.
For reasons given below, this function only applies to models with an
autoregressive structure ("slm", "sdm", "sarar" and "gnm") or with spatial lags
of the regressors ("slx", "sdem").
The measurement of the multiplier effects is a bit more complicated than
in a pure time series context because, due to the spatial structure of
the model, part of the impacts spills over non uniformly over the space.
Using the notation introduced by LeSage and Pace (2009) we distinguish
between:
-
Average Direct effects: The average over the N spatial units and Tm time periods of the effect of a unitary change in the value of a explanatory variable on the contemporaneous value of the corresponding explained variable, located in the same point of the intervened regressor. This calculus is solved for all the regressors that appear in the G equations of the model.
-
Average Indirect effects: The average over the N spatial units and Tm time periods of the effects of a unitary change in the value of a explanatory variable on the contemporaneous value of the corresponding explained variable, located in a different spatial unit that that of the intervened regressor. This calculus is solved for all the regressors that appear in the G equations of the model.
-
Average total effects: The sum of Direct and Indirect effects.
The information on the three estimated effects is supplement with an indirect measure of statistical significance obtained from the randomization approach introduced in LeSage and Pace (2009).
Usage
impactspsur (obj, ..., tr = NULL, R = NULL, listw = NULL,
evalues = NULL,tol = 1e-06,
empirical = FALSE, Q = NULL)
Arguments
obj |
|
... |
Arguments passed through to methods in the coda package |
tr |
A vector of traces of powers of the spatial weights matrix created using |
R |
If given, simulations are used to compute distributions for the impact measures, returned as |
listw |
If |
evalues |
vector of eigenvalues of spatial weights matrix for impacts calculations |
tol |
Argument passed to |
empirical |
Argument passed to |
Q |
default NULL, else an integer number of cumulative power series impacts to calculate if |
Details
LeSage and Pace (2009) adapt the classical notion of
'economic multiplier' to the problem of measuring the impact that
a unitary change in the value of a regressor, produced in a certain point
in space, has on the explained variable. The question is interesting
because, due to the spatial structure of the model, the impacts of such
change spill non uniformly over the space. In fact, the reaction of the
explained variable depends on its relative location in relation to the
point of intervention.
To simplify matters, LeSage and Pace (2009) propose to obtain aggregated
multipliers for each regressor, just averaging the N^{2}
impacts
that results from intervening the value of each regressor on each of the
N points in Space, on the explained variable, measured also in each of
the N
points in space. This aggregated average is the so-called
Total effect.
Part of this impact will be absorved by the explained variable located in
the same point of the regressor whose value has been changed (for example,
the k-th regresor in the g-th equation, in the n-th spatial unit) or,
in other words, we expect that [d y_{tgn}]/[d x_{ktgn}] ne 0
. The
aggregated average for the N points in space (n=1,2,...,N) and
Tm time periods is the so-called Direct effect.
The difference between the Total effect and the Direct effect
measures the portion of the impact on the explained variable that leakes
to other points in space, [d y_{tgn}]/[d x_{ktgm}] for n ne m
;
this is the Indirect effect.
impacts
obtains the three multipliers together with an
indirect measure of statistical significance, according to the
randomization approach described in Lesage and Pace (2009). Briefly, they
suggest to obtain a sequence of nsim random matrices of order
(NTmxG) from a multivariate normal distribution
N(0; Sigma), being Sigma the estimated covariance matrix
of the G equations in the SUR model. These random matrices,
combined with the observed values of the regressors and the estimated
values of the parameters of the corresponding spatial SUR model, are used
to obtain simulated values of the explained variables. Then, for each one
of the nsim experiments, the SUR model is estimated, and the effects
are evaluated. The function impacts
obtains the standard
deviations of the nsim estimated effects in the randomization
procedure, which are used to test the significance of the estimated
effects for the original data.
Finally, let us note that this is a SUR model where the G equations
are connected only through the error terms. This means that if we
intervene a regressor in equation g, in any point is space, only
the explained variable of the same equation g should react. The
impacts do not spill over equations. Moreover, the impact of a regressor,
intervened in the spatial unit n, will cross the borders of this
spatial unit only if in the right hand side of the equation there are
spatial lags of the explained variables or of the regressors. In other
words, the Indirect effect is zero for the "sim" and "sem" models.
impacts
produces no output for these two models.
Lastly, it is clear that all the impacts are contemporaneous because the
equations in the SUR model have no time dynamics.
Value
A list of G objects either of class lagImpact
or WXImpact
.
For each of the G objects of the list, if no simulation is carried out the object returned is a list with:
direct | numeric vector |
indirect | numeric vector |
total | numeric vector |
and a matching Qres
list attribute if Q was given.
On the other hand, for each of the G objects of the list, if simulation is carried out the object returned is a list with:
res | a list with three components as for the non-simulation
case, with a matching Qres list attribute if Q was given. |
sres | a list with three mcmc matrices, for the direct,
indirect and total impacts with a matching Qmcmc list attribute
if Q was given. |
Author(s)
Fernando Lopez | fernando.lopez@upct.es |
Roman Minguez | roman.minguez@uclm.es |
Jesus Mur | jmur@unizar.es |
References
Bivand, R.S. and Piras G. (2015). Comparing Implementations of Estimation Methods for Spatial Econometrics. Journal of Statistical Software, 63(18), 1-36. <doi: 10.18637/jss.v063.i18>
LeSage, J., and Pace, R. K. (2009). Introduction to spatial econometrics. Chapman and Hall/CRC.
Lopez, 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. <doi:10.1007/s00168-014-0624-2>
Minguez, R., Lopez, F.A. and Mur, J. (2022). spsur: An R Package for Dealing with Spatial Seemingly Unrelated Regression Models. Journal of Statistical Software, 104(11), 1–43. <doi:10.18637/jss.v104.i11>
Mur, J., Lopez, F., and Herrera, M. (2010). Testing for spatial effects in seemingly unrelated regressions. Spatial Economic Analysis, 5(4), 399-440. <doi:10.1080/17421772.2010.516443>
See Also
Examples
## VIP: The output of the whole set of the examples can be examined
## by executing demo(demo_impactspsur, package="spsur")
###############################################
### PURE CROSS SECTIONAL DATA(G>1; Tm=1) ######
###############################################
#### Example 1: Spatial Phillips-Curve. Anselin (1988, p. 203)
rm(list = ls()) # Clean memory
data(spc)
lwspc <- spdep::mat2listw(Wspc, style = "W")
Tformula <- WAGE83 | WAGE81 ~ UN83 + NMR83 + SMSA | UN80 + NMR80 + SMSA
## For SLM, SDM and SARAR models the output is a list of "lagImpact" objects
## See spatialreg::impacts for details.
spcsur_slm <-spsurml(formula = Tformula, data = spc,
type = "slm", listw = lwspc)
summary(spcsur_slm)
impacts_slm <- impactspsur(spcsur_slm, listw = lwspc, R = 1000)
## Impacts equation 1
summary(impacts_slm[[1]], zstats = TRUE, short = TRUE)
## Impacts equation 2
summary(impacts_slm[[2]], zstats = TRUE, short = TRUE)
## For SLX and SDEM models the output is a list of "WXImpact" objects
## See spatialreg::impacts for details.
## A SUR-SLX model
spcsur_slx <-spsurml(formula = Tformula, data = spc,
type = "slx", listw = lwspc)
summary(spcsur_slx)
impacts_slx <- impactspsur(spcsur_slx, listw = lwspc)
summary(impacts_slx[[1]], zstats = TRUE, short = TRUE)
summary(impacts_slx[[2]], zstats = TRUE, short = TRUE)
## A SUR-SDM model
spcsur_sdm <-spsurml(formula = Tformula, data = spc,
type = "sdm", listw = lwspc)
impacts_sdm <- impactspsur(spcsur_sdm, listw = lwspc, R = 1000)
summary(impacts_sdm[[1]], zstats = TRUE, short = TRUE)
summary(impacts_sdm[[2]], zstats = TRUE, short = TRUE)
## A SUR-SDM model with different spatial lags in each equation
TformulaD <- ~ UN83 + NMR83 + SMSA | UN80
spcsur_sdm2 <-spsurml(formula = Tformula, data = spc, type = "sdm",
listw = lwspc, Durbin = TformulaD)
summary(spcsur_sdm2)
impacts_sdm2 <- impactspsur(spcsur_sdm2, listw = lwspc, R = 1000)
summary(impacts_sdm2[[1]], zstats = TRUE, short = TRUE)
summary(impacts_sdm2[[2]], zstats = TRUE, short = TRUE)
## A SUR-SLX model with different spatial lags in each equation
spcsur_slx2 <-spsurml(formula = Tformula, data = spc,
type = "slx", listw = lwspc, Durbin = TformulaD)
summary(spcsur_slx2)
impacts_slx2 <- impactspsur(spcsur_slx2, listw = lwspc)
summary(impacts_slx2[[1]], zstats = TRUE, short = TRUE)
summary(impacts_slx2[[2]], zstats = TRUE, short = TRUE)
# ####################################
# ######## G=1; Tm>1 ###
# ####################################
#
rm(list = ls()) # Clean memory
data(NCOVR, package="spsur")
nbncovr <- spdep::poly2nb(NCOVR.sf, queen = TRUE)
### Some regions with no links...
lwncovr <- spdep::nb2listw(nbncovr, style = "W", zero.policy = TRUE)
Tformula <- HR80 | HR90 ~ PS80 + UE80 | PS90 + UE90
### A SUR-SLM model
NCOVRSUR_slm <-spsurml(formula = Tformula, data = NCOVR.sf,
type = "slm", listw = lwncovr,
method = "Matrix", zero.policy = TRUE,
control = list(fdHess = TRUE))
summary(NCOVRSUR_slm)
### Use of trW to compute.
Wncovr <- Matrix::Matrix(spdep::listw2mat(lwncovr))
trwncovr <- spatialreg::trW(Wncovr, type = "MC")
impacts_NCOVRSUR_slm <- impactspsur(NCOVRSUR_slm, tr = trwncovr,
R = 1000)
summary(impacts_NCOVRSUR_slm[[1]], zstats = TRUE, short = TRUE)
summary(impacts_NCOVRSUR_slm[[2]], zstats = TRUE, short = TRUE)