pair_cor | R Documentation |
The method computes person correlations for all variables available for the the origins, destinations, and OD-pairs. The OD-pairs information can be either come from a spflow_network_multi or a spflow_models.
pair_cor(object, ...)
## S4 method for signature 'spflow_network_multi'
pair_cor(
object,
id_net_pair = id(object)[["pairs"]][[1]],
spflow_formula,
add_lags_x = TRUE,
add_lags_y = FALSE
)
## S4 method for signature 'spflow_model'
pair_cor(
object,
add_fitted = TRUE,
add_resid = TRUE,
model,
exploit_fit = TRUE
)
object |
A |
... |
Arguments to be passed to methods |
id_net_pair |
A character indicating the id of a |
spflow_formula |
A formula specifying how variables should be used
(for details see section Formula interface in the help page of |
add_lags_x |
A logical, indicating whether spatial lags of the exogenous variables should be included. |
add_lags_y |
A logical, indicating whether spatial lags of the dependent variables should be included. |
add_resid, add_fitted |
Logicals, indicating whether the model residuals and fitted value should be added to the correlation matrix |
model |
A character indicating the model number, that controls different spatial
dependence structures should be one of |
exploit_fit |
A logical, if |
A matrix of pairwise correlations between all variables
Lukas Dargel
spflow_network_multi-class()
, spflow_model-class()
# Used with a spflow_network_multi ...
cor_mat <- pair_cor(multi_net_usa_ge, "ge_ge") # without transformations
cor_image(cor_mat)
cor_mat <- pair_cor( # with transformations and spatial lags
multi_net_usa_ge,
"ge_ge",
y9 ~ . + P_(log(DISTANCE + 1) + .),
add_lags_y = TRUE)
cor_image(cor_mat)
# Used with a model...
gravity_ge <- spflow(
y1 ~ . + P_(DISTANCE),
multi_net_usa_ge,
"ge_ge",
spflow_control(model = "model_1"))
cor_mat <- pair_cor(gravity_ge)
cor_image(cor_mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.