View source: R/gs2slshet.R View source: R/impacts.R
impacts.gstsls | R Documentation |
Generate impacts for spreg lag and sarar models
Generate impacts for objects of class sarar_gmm created in sphet
## S3 method for class 'gstsls'
impacts(
obj,
...,
tr = NULL,
R = NULL,
listw = NULL,
evalues = NULL,
tol = 1e-06,
empirical = FALSE,
Q = NULL,
KPformula = FALSE,
prt = TRUE
)
obj |
A spreg spatial regression object created by |
... |
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 |
a listw object |
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 |
KPformula |
default FALSE, else inference of the impacts based on Kelejian and Piras (2020) |
prt |
prints the KP summary of the VC matrix |
Estimate of the Average Total, Average Direct, and Average Indirect Effects
Estimate of the Average Total, Average Direct, and Average Indirect Effects
Roger Bivand, Gianfranco Piras (2015). Comparing Implementations of Estimation Methods for Spatial Econometrics. Journal of Statistical Software, 63(18), 1-36. https://www.jstatsoft.org/v63/i18/. Harry Kelejian, Gianfranco Piras (2020). Spillover effects in spatial models: Generalization and extensions. Journal of Regional Science, 60(3), 425-442. Gianfranco Piras, Paolo Postiglione (2022). A deeper look at impacts in spatial Durbin model with sphet. Geographical Analysis, 54(3), 664-684.
data(columbus, package="spdep")
listw <- spdep::nb2listw(col.gal.nb)
res <- spreg(CRIME~HOVAL + INC, data=columbus , listw= listw,
het = TRUE, verbose = FALSE, model = "sarar")
summary(res)
effects <- impacts(res, listw = listw, R = 399)
summary(effects)
data(boston, package="spData")
Wb <- as(spdep::nb2listw(boston.soi), "CsparseMatrix")
ev <- eigen(Wb)$values
trMatb <- spatialreg::trW(Wb, type="mult")
sarar1 <- spreg(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) +
I(RM^2) + AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT),
data = boston.c, listw = Wb, model = "sarar")
summary(sarar1)
impacts(sarar1, KPformula = TRUE)
summary(impacts(sarar1, tr = trMatb, R=1000), zstats=TRUE, short=TRUE)
summary(impacts(sarar1, evalues = ev, R=1000), zstats=TRUE, short=TRUE)
sarar2 <- spreg(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) +
I(RM^2) + AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT),
data = boston.c, listw = Wb, model = "sarar", Durbin = TRUE)
summary(sarar2)
impacts(sarar2, evalues = ev, KPformula = TRUE)
impacts(sarar2, evalues = ev)
impacts(sarar2, listw = spdep::nb2listw(boston.soi))
impacts(sarar2, tr = trMatb)
summary(impacts(sarar2, evalues = ev, R=1000), zstats=TRUE, short=TRUE)
sarar3 <- spreg(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) +
I(RM^2) + AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT),
data = boston.c, listw = Wb, model = "sarar", Durbin = ~CRIM + TAX)
summary(sarar3)
impacts(sarar3, evalues = ev)
impacts(sarar3, evalues = ev, KPformula = TRUE)
impacts(sarar3, evalues = ev, KPformula = TRUE, tr = trMatb)
impacts(sarar3, listw = spdep::nb2listw(boston.soi))
impacts(sarar3, tr = trMatb)
summary(impacts(sarar3, listw = spdep::nb2listw(boston.soi), R=1000), zstats=TRUE, short=TRUE)
sarar4 <- spreg(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) +
I(RM^2) + AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B ,
data = boston.c, listw = Wb, model = "sarar", Durbin = ~CRIM + TAX + log(LSTAT))
summary(sarar4)
impacts(sarar4, evalues = ev)
summary(impacts(sarar4, evalues = ev, R=1000), zstats=TRUE, short=TRUE)
sarar5 <- spreg(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) + I(RM^2) + AGE + log(DIS),
data = boston.c, listw = Wb, model = "sarar", Durbin = ~ TAX + log(LSTAT))
summary(sarar5)
impacts(sarar5, evalues = ev)
summary(impacts(sarar4, tr = trMatb, R=1000), zstats=TRUE, short=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.