| impacts.error_sphet | R Documentation | 
Generate impacts for objects of class error_sphet created in sphet
## S3 method for class 'error_sphet'
impacts(
  obj,
  ...,
  tr = NULL,
  R = NULL,
  listw = NULL,
  evalues = NULL,
  tol = 1e-06,
  empirical = FALSE,
  Q = NULL
)
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
library(sphet)
require("sf", quietly=TRUE)
columbus <- st_read(system.file("shapes/columbus.gpkg", 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.