Description Usage Arguments Value Examples
Generate impacts for objects of class error_sphet created in sphet
1 2 3 4 5 6 7 8 9 10 11 12 |
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 |
Estimate of the Average Total, Average Direct, and Average Indirect Effects
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(sphet)
require("sf", quietly=TRUE)
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
col.gal.nb <- spdep::read.gal(system.file("weights/columbus.gal", package="spData")[1])
listw <- spdep::nb2listw(col.gal.nb)
error1 <- spreg(CRIME ~ INC + HOVAL, columbus, listw, Durbin=TRUE,
model = "error")
summary(error1)
impacts(error1)
summary(impacts(error1))
error2 <- spreg(CRIME ~ INC + HOVAL, columbus, listw, Durbin= ~ INC,
model = "error")
impacts(error2)
error3 <- spreg(CRIME ~ HOVAL, columbus, listw, Durbin= ~ INC,
model = "error")
summary(impacts(error3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.