impacts_matrix,spflow_model-method | R Documentation |
Marginal effect in spatial econometric models are observation dependent. Here we compute the changes to all observations that follow from changes in a one variable for one (or multiple) observations. Here, these effects are represented as a matrix with the same dimension as the dependent variable.
## S4 method for signature 'spflow_model'
impacts_matrix(
object,
...,
change_net,
change_var,
change_obs = 1L,
x_is_log = FALSE
)
object |
an |
... |
arguments passed on to |
change_net |
a character of length one, identifying one of the
|
change_var |
a character of length one, identifying one variable The character musts refer to the variable and its name to the id of |
change_obs |
A numeric that identifies the observation(s) to change (by position) |
x_is_log |
A logical, if |
A Matrix
Lukas Dargel
predict_effect
model9 <- spflow(
spflow_formula = y9 ~ . + P_(DISTANCE),
spflow_networks = multi_net_usa_ge,
id_net_pair = "ge_ge")
# effect matrix, summary and decomposition
MI <- impacts_matrix(model9,change_net = "ge",change_var = "X", change_obs = 8)
total_effect <- sum(MI)
intra_effect <- MI[8,8]
origi_effect <- sum(MI[,8]) - intra_effect
desti_effect <- sum(MI[8,]) - intra_effect
netwo_effect <- sum(MI[-8,-8])
total_effect == (intra_effect + origi_effect + desti_effect + netwo_effect)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.