Title: | Spatially-Clustered Data Analysis |
---|---|
Description: | Contains functions for statistical data analysis based on spatially-clustered techniques. The package allows estimating the spatially-clustered spatial regression models presented in Cerqueti, Maranzano \& Mattera (2024), "Spatially-clustered spatial autoregressive models with application to agricultural market concentration in Europe", arXiv preprint 2407.15874 <doi:10.48550/arXiv.2407.15874>. Specifically, the current release allows the estimation of the spatially-clustered linear regression model (SCLM), the spatially-clustered spatial autoregressive model (SCSAR), the spatially-clustered spatial Durbin model (SCSEM), and the spatially-clustered linear regression model with spatially-lagged exogenous covariates (SCSLX). From release 0.0.2, the library contains functions to estimate spatial clustering based on Adiajacent Matrix K-Means (AMKM) as described in Zhou, Liu \& Zhu (2019), "Weighted adjacent matrix for K-means clustering", Multimedia Tools and Applications, 78 (23) <doi:10.1007/s11042-019-08009-x>. |
Authors: | Paolo Maranzano [aut, cre, cph]
|
Maintainer: | Paolo Maranzano <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.2 |
Built: | 2025-02-20 03:30:30 UTC |
Source: | https://github.com/cran/SCDA |
The 'Data_RC_PM_RM_JABES2024' dataset was created merging information from the Eurostat regional database (<https://ec.europa.eu/eurostat/web/regions/database>). it is a spatial dataset to replicate the results for 2010 from Cerqueti, R., Maranzano, P. & Mattera, R. "Spatially-clustered spatial autoregressive models with application to agricultural market concentration in Europe". arXiv preprints (<https://doi.org/10.48550/arXiv.2407.15874>). Data contained in this file refer to the agricultural sector industry for 222 European regions (NUTS-2 classification) for 2010. For more information see the database 'Economic accounts for agriculture by NUTS 2 region' (agr_r_accts, DOI:10.2908/agr_r_accts). The file includes 6 mixed-type objects:
data(Data_RC_PM_RM_JABES2024)
data(Data_RC_PM_RM_JABES2024)
Data2010
is a spatial data frame (sf/data.frame) with 222 rows, 13 variables and a geometry representing the regions' polygons:
Reference year for the data, that is, 2010
Extended name (English-translated) of the regions
Eurostat NUTS-2 code of the regions
Gini index for the standard output of farms and agricultural holdings in each region
Regional per capita GDP measured as Euros PPS 2020
Share of employment in agriculture: relevance of agricultural industry on the regional labor market
Hours worked per agro-employed: agricultural labor market intensity
Gross value added per agro-employed: agricultural productivity intensity
Investment per agro-employed: propensity to invest according to the economic size
Share of agricultural GVA on total GVA: relevance of agricultural industry on the regional economy
Share of agricultural land: relevance of agricultural industry on the regional activities
Average altitude: geography and landscape
Heating degree days (HDD): proxy of temperature and weather conditions
All source data files prepared by Paolo Maranzano (Department of Economics, Management and Statistics, University of Milano-Bicocca, Italy).
Eurostat – Economic accounts for agriculture by NUTS 2 region' (agr_r_accts, DOI:10.2908/agr_r_accts)
The 'Data_RC_PM_RM_JABES2024' dataset was created merging information from the Eurostat regional database (<https://ec.europa.eu/eurostat/web/regions/database>). it is a spatial dataset to replicate the results for 2020 from Cerqueti, R., Maranzano, P. & Mattera, R. "Spatially-clustered spatial autoregressive models with application to agricultural market concentration in Europe". arXiv preprints (<https://doi.org/10.48550/arXiv.2407.15874>). Data contained in this file refer to the agricultural sector industry for 222 European regions (NUTS-2 classification) for 2020. For more information see the database 'Economic accounts for agriculture by NUTS 2 region' (agr_r_accts, DOI:10.2908/agr_r_accts). The file includes 6 mixed-type objects:
data(Data_RC_PM_RM_JABES2024)
data(Data_RC_PM_RM_JABES2024)
Data2020
is a data frame with 222 rows, 13 variables and a geometry representing the regions' polygons:
Reference year for the data, that is, 2020
Extended name (English-translated) of the regions
Eurostat NUTS-2 code of the regions
Gini index for the standard output of farms and agricultural holdings in each region
Regional per capita GDP measured as Euros PPS 2020
Share of employment in agriculture: relevance of agricultural industry on the regional labor market
Hours worked per agro-employed: agricultural labor market intensity
Gross value added per agro-employed: agricultural productivity intensity
Investment per agro-employed: propensity to invest according to the economic size
Share of agricultural GVA on total GVA: relevance of agricultural industry on the regional economy
Share of agricultural land: relevance of agricultural industry on the regional activities
Average altitude: geography and landscape
Heating degree days (HDD): proxy of temperature and weather conditions
All source data files prepared by Paolo Maranzano (Department of Economics, Management and Statistics, University of Milano-Bicocca, Italy).
Eurostat – Economic accounts for agriculture by NUTS 2 region' (agr_r_accts, DOI:10.2908/agr_r_accts)
Automatically selects the optimal number of clusters (X-axis) based on elbow criterion computed on a metric (Y-axis). Potential metrics are the AIC and the BIC. The function can be applied to any other context in which the objective is to find the optimal X producing an elbow in Y.
Elbow_finder(x, y, Plot = TRUE)
Elbow_finder(x, y, Plot = TRUE)
x |
Numeric (m x 1) |
y |
Numeric (m x 1) |
Plot |
|
Returns the following outputs:
x_max_dist: optimal value of x (i.e., the x satisfying the elbow rule)
y_max_dist: optimal value of y (i.e., the y satisfying the elbow rule)
Scatterplot (non-compulsory) of x and y with connecting lines and vertical line in correspondence of the optimal value of x.
## Compute the Elbow criterion on two generic vectors x and y x <- 1:10 y <- c(10,9,6,5,4,3,2,1,1,1) Elbow_finder(x,y,Plot = TRUE)
## Compute the Elbow criterion on two generic vectors x and y x <- 1:10 y <- c(10,9,6,5,4,3,2,1,1,1) Elbow_finder(x,y,Plot = TRUE)
The 'Data_RC_PM_RM_JABES2024' dataset was created merging information from the Eurostat regional database (<https://ec.europa.eu/eurostat/web/regions/database>). it is a spatial dataset to replicate the results for 2020 from Cerqueti, R., Maranzano, P. & Mattera, R. "Spatially-clustered spatial autoregressive models with application to agricultural market concentration in Europe". arXiv preprints (<https://doi.org/10.48550/arXiv.2407.15874>). Data contained in this file refer to the agricultural sector industry for 222 European regions (NUTS-2 classification) for 2020. For more information see the database 'Economic accounts for agriculture by NUTS 2 region' (agr_r_accts, DOI:10.2908/agr_r_accts). The file includes 6 mixed-type objects:
data(Data_RC_PM_RM_JABES2024)
data(Data_RC_PM_RM_JABES2024)
listW
is a list of 222 spatial weights (style = "W", zero.policy=TRUE) for the European NUTS-2 regions
All source data files prepared by Paolo Maranzano (Department of Economics, Management and Statistics, University of Milano-Bicocca, Italy).
Eurostat – GISCO Territorial units for statistics (NUTS) (https://ec.europa.eu/eurostat/web/gisco/geodata/statistical-units/territorial-units-statistics)
Perform spatial clustering using K-means and AMKM (Adjacent Matrix K-Means) algorithms on sf data.
SC_AMKM( Data_sf, IndexCol, Method, Distance = "euclidean", MinNc = 2, MaxNc = 10, Metric = "silhouette", RidDim = "pca", CenterVars = T, ScaleVars = T, MakePlot = T, ExplainedVariance = 0.9, KeepCoord = T, Seed = 123456789, Verbose = T, CRS = 4326 )
SC_AMKM( Data_sf, IndexCol, Method, Distance = "euclidean", MinNc = 2, MaxNc = 10, Metric = "silhouette", RidDim = "pca", CenterVars = T, ScaleVars = T, MakePlot = T, ExplainedVariance = 0.9, KeepCoord = T, Seed = 123456789, Verbose = T, CRS = 4326 )
Data_sf |
A |
IndexCol |
|
Method |
|
Distance |
|
MinNc |
|
MaxNc |
|
Metric |
|
RidDim |
|
CenterVars |
|
ScaleVars |
|
MakePlot |
|
ExplainedVariance |
|
KeepCoord |
|
Seed |
|
Verbose |
|
CRS |
|
AMKM calculations is done decomposing the input dataset in two subset. The first one contains the features while the second one contains the coordinates (longitude and latitude). A dissimilarity matrix is calculated on both subset using the parameter distance for the feature and the Great Circle distance for coordinates. Then an adjacent matrix (n x n) is computed on every dissimilarity matrix using gaussian kernel. To reduce the dimensionality of the adjacent matrix a dimentionality reduction method is necessary (see RidDim param. for more) K-means is applied with no modification at its original algorithm.
A list object containing the following outputs:
df: n row dataframe with the following columns : ID, Longitude, Latitude and Cluster (the optimal partition)
plot: Display cluster partition in a map.
Camilla Lionetti <[email protected]>, Francesco Caccia <[email protected]>
library(sp) library(sf) data("meuse") dati<-meuse dati<-subset(dati,select=sapply(dati,is.numeric)) dati<-st_as_sf(dati, coords = c("x", "y"),crs =28992) SC <- SC_AMKM(Data_sf=dati,IndexCol=0, Method="AMKM",MinNc = 5,MaxNc = 5 ,CRS=28992)
library(sp) library(sf) data("meuse") dati<-meuse dati<-subset(dati,select=sapply(dati,is.numeric)) dati<-st_as_sf(dati, coords = c("x", "y"),crs =28992) SC <- SC_AMKM(Data_sf=dati,IndexCol=0, Method="AMKM",MinNc = 5,MaxNc = 5 ,CRS=28992)
Estimates spatially-clustered spatial regression (SCSR) models, such as the spatially-clustered linear regression model (SCLM), the spatially-clustered spatial autoregressive model (SCSAR), the spatially-clustered spatial durbin model (SCSEM), and the spatially-clustered linear regression model with spatially-lagged exogenous covariates and response variable (SCSLX). Estimation is performed via cluster-wise maximum likelihood as presented in <https://arxiv.org/abs/2407.15874>.
SCSR_Estim( Formula, Data_sf, listW, G = 2, Phi = 1, Type = c("SCLM", "SCSAR", "SCSEM", "SCSLX"), CenterVars = FALSE, ScaleVars = FALSE, Maxitr = 100, RelTol = 10^-6, AbsTol = 10^-5, Verbose = TRUE, Seed = 123456789 )
SCSR_Estim( Formula, Data_sf, listW, G = 2, Phi = 1, Type = c("SCLM", "SCSAR", "SCSEM", "SCSLX"), CenterVars = FALSE, ScaleVars = FALSE, Maxitr = 100, RelTol = 10^-6, AbsTol = 10^-5, Verbose = TRUE, Seed = 123456789 )
Formula |
a symbolic description of the regression model to be fit. The details of model specification are given for |
Data_sf |
A |
listW |
|
G |
Integer value. Number of clusters to be considered. When 'G=1', the pooled regression (no clusterwise) is estimated. Default is 'G = 2'. |
Phi |
Non-negative (>=0) real value. Spatial penalty parameter. Default is 'Phi = 1'. |
Type |
Character. Declares which model specification has to be estimated. Admitted strings are:
|
CenterVars |
|
ScaleVars |
|
Maxitr |
Integer value. Maximum number of iterations for the iterative algorithm. Convergence criterion is fixed to |
RelTol |
Tolerance for the relative improvement in the log-likelihood (exit criterion) from iteration k to k+1. Default is |
AbsTol |
Tolerance for the absolute improvement in the log-likelihood (exit criterion) from iteration k to k+1. Default is |
Verbose |
|
Seed |
Integer value. Define the random number generator (RNG) state for random number generation in R.
Deafult is |
The package SCSR
computes the spatially-clustered spatial regression models based on the spatialreg
package (see <https://cran.r-project.org/web/packages/spatialreg/index.html>).
SCSAR model is estimated using the function lagsarlm
; SCSEM model is estimated using the function errorsarlm
; SCSLX model is estimated using the function lmSLX
.
SCLM model is estimated using the lm
function from package stats
.
Thus, estimated SCSAR, SCSEM and SCSLX models belong to class Sarlm
, while estimated SCLM belongs to class lm
.
We kindly refer to the package spatialreg
for any detail regarding computational aspects (e.g., optimization).
Also, we refer to the package spdep
for computational details on the spatial weighting matrix via listw2mat(...)
, nb2listw(...)
and nb2mat(...)
from the spdep
package.
For computional details on the spatially-clustered models, we kindly refer to Cerqueti, R., Maranzano, P. & Mattera, R. "Spatially-clustered spatial autoregressive models with application to agricultural market concentration in Europe". arXiv preprints (<doi:10.48550/arXiv.2407.15874>)
A list object containing the following outputs:
ClusterFitModels: G-dimensional list containing the estimated clustered regression models of class lm
or Sarlm
Beta: (G x p) matrix of cluster-wise or pooled regression coefficients
Sig: G-dimensional vector of cluster-wise standard deviations
VCov: (p x p x G) array of cluster-wise variance-covariance matrices of coefficients
W_g: G-dimensional list containing for the g-th cluster with cardinality n_g a (n_g x n_g) spatial weighting matrix
listW_g: G-dimensional list containing for the g-th cluster the weights list
Group: (n x 1) vector of group assignment
sBeta: (n x p) matrix of location-wise regression coefficients
sSig: (n x 1) vector of location-wise standard deviations
MLE: Estimated maximum log-likelihood
Iter: The number of iteration needed to satisfy the convergence criterion and end up the clustering iterative loop
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SCLM <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCLM", Phi = 0.50)
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SCLM <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCLM", Phi = 0.50)
Computes the likelihood-based information criteria (i.e, Akaike's IC, Bayesian IC, and Hannan–Quinn IC) for every SCSR model given by the combination of the G and Phi contained in the G.set
and Phi.set
inputs and provides the associated likelihood-based information criteria.
Given the minimization rule, SCSR_InfoCrit
automatically identifies the optimal number of clusters for every criterion.
SCSR_InfoCrit( Formula, Data_sf, listW, Phi.set = c(0.5, 1), G.set = c(2, 3, 4), Type = c("SCLM", "SCSAR", "SCSEM", "SCSLX"), CenterVars = TRUE, ScaleVars = TRUE, Maxitr = 200, RelTol = 10^-6, AbsTol = 10^-5, Verbose = TRUE, Seed = 123456789 )
SCSR_InfoCrit( Formula, Data_sf, listW, Phi.set = c(0.5, 1), G.set = c(2, 3, 4), Type = c("SCLM", "SCSAR", "SCSEM", "SCSLX"), CenterVars = TRUE, ScaleVars = TRUE, Maxitr = 200, RelTol = 10^-6, AbsTol = 10^-5, Verbose = TRUE, Seed = 123456789 )
Formula |
a symbolic description of the regression model to be fit. The details of model specification are given for |
Data_sf |
A |
listW |
|
Phi.set |
Non-negative (>=0) real-valued vector. Sequence of spatial penalty parameter. Default is |
G.set |
Integer vector. Sequence of clusters to be considered. Default is |
Type |
Character. Declares which model specification has to be estimated. Admitted strings are:
|
CenterVars |
|
ScaleVars |
|
Maxitr |
Integer value. Maximum number of iterations for the iterative algorithm. Convergence criterion is fixed to |
RelTol |
Tolerance for the relative improvement in the log-likelihood (exit criterion) from iteration k to k+1. Default is |
AbsTol |
Tolerance for the absolute improvement in the log-likelihood (exit criterion) from iteration k to k+1. Default is |
Verbose |
|
Seed |
Integer value. Define the random number generator (RNG) state for random number generation in R.
Deafult is |
Given the vectors G.set = c(2,3,4) and Phi.set = c(0.50,1), the function 'SCSR_InfoCrit' will compute 3x2=6 models, each at a given combination of G and Phi. For computional details on the spatially-clustered models, we kindly refer to Cerqueti, R., Maranzano, P. & Mattera, R. "Spatially-clustered spatial autoregressive models with application to agricultural market concentration in Europe". arXiv preprints (<doi:10.48550/arXiv.2407.15874>)
A list object containing the following outputs:
IC: a data.frame
object containing one row for each combination of the supplied vectors G.set and Phi.set and 5 columns (G,Phi,AIC,BIC,HQC).
OptimPars: a data.frame
object with 3 rows (criteria) and 2 columns (Parameters) with the optimal combination of G and Phi for every criterion.
Paolo Maranzano <>
Raffaele Mattera <>
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR_IC <- SCSR_InfoCrit(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, listW=listW, Type="SCSAR", Maxitr = 100, Phi.set = c(0.50,1), G.set=c(2,3))
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR_IC <- SCSR_InfoCrit(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, listW=listW, Type="SCSAR", Maxitr = 100, Phi.set = c(0.50,1), G.set=c(2,3))
lm
or Sarlm
.Extracts the numerical values for the regression parameters (i.e., estimated spatial parameters, regression coefficients, and residuals variance) for a given spatial regression model of class lm
or Sarlm
as defined in package spatialreg
.
The function can be applied to the output of any SCSR model and contained in the ClusterFitModels
output of SCSR_Estim
function.
SpatReg_Extract(SRModel)
SpatReg_Extract(SRModel)
SRModel |
Estimated spatial or non-spatial regression model of class |
A named vector
containing numerical values for the estimated spatial parameters (e.g., in SAR or
in SEM), regression coefficients, and residuals variance for the input model in
SRModel
.
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SpatReg_Extract(SRModel = SCSAR$ClusterFitModels[[1]]) SpatReg_Extract(SRModel = SCSAR$ClusterFitModels[[2]]) SpatReg_Extract(SRModel = SCSAR$ClusterFitModels[[3]])
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SpatReg_Extract(SRModel = SCSAR$ClusterFitModels[[1]]) SpatReg_Extract(SRModel = SCSAR$ClusterFitModels[[2]]) SpatReg_Extract(SRModel = SCSAR$ClusterFitModels[[3]])
lm
or Sarlm
.Computes a set of goodness-of-fit indices (e.g., likelihood-based information criteria, Wald and LR test, Moran's I statistic) for a given spatial regression model of class lm
or Sarlm
as defined in package spatialreg
.
The function can be applied to the output of any SCSR model and contained in the ClusterFitModels
output of SCSR_Estim
function.
SpatReg_GoF(SRModel_list, SRModel_W_list)
SpatReg_GoF(SRModel_list, SRModel_W_list)
SRModel_list |
List of estimated spatial or non-spatial regression model of class |
SRModel_W_list |
List of |
A matrix
containing 15 goodness-of-fit indices (e.g., likelihood-based information criteria, Wald and LR test, Moran's I statistic) for the list of models given as a input in SRModel_list
.
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) reglist <- c(SCSAR$ClusterFitModels[1],SCSAR$ClusterFitModels[2],SCSAR$ClusterFitModels[3]) Wlist <- c(SCSAR$listW_g[1],SCSAR$listW_g[2],SCSAR$listW_g[3]) SpatReg_GoF(SRModel_list = reglist,SRModel_W_list = Wlist)
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) reglist <- c(SCSAR$ClusterFitModels[1],SCSAR$ClusterFitModels[2],SCSAR$ClusterFitModels[3]) Wlist <- c(SCSAR$listW_g[1],SCSAR$listW_g[2],SCSAR$listW_g[3]) SpatReg_GoF(SRModel_list = reglist,SRModel_W_list = Wlist)
) for a given spatial regression model of class lm
or Sarlm
.Computes a set of in-sample performance metrics (i.e., AIC, BIC, RMSE, Sigma, and Pseudo R$^2$) for a given spatial regression model of class lm
or Sarlm
as defined in package spatialreg
.
The function can be applied to the output of any SCSR model and contained in the ClusterFitModels
output of SCSR_Estim
function.
SpatReg_Perf(SRModel)
SpatReg_Perf(SRModel)
SRModel |
Estimated spatial or non-spatial regression model of class |
A named vector
containing numerical values for the estimated performance metrics (i.e., AIC, BIC, RMSE, Sigma, and Pseudo R) for the input model in
SRModel
.
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SpatReg_Perf(SRModel = SCSAR$ClusterFitModels[[1]]) SpatReg_Perf(SRModel = SCSAR$ClusterFitModels[[2]]) SpatReg_Perf(SRModel = SCSAR$ClusterFitModels[[3]])
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SpatReg_Perf(SRModel = SCSAR$ClusterFitModels[[1]]) SpatReg_Perf(SRModel = SCSAR$ClusterFitModels[[2]]) SpatReg_Perf(SRModel = SCSAR$ClusterFitModels[[3]])
metric for a given spatial regression model of class lm
or Sarlm
.Computes the Pseudo R metric for a given spatial regression model of class
lm
or Sarlm
as defined in package spatialreg
.
The function can be applied to the output of any SCSR model and contained in the ClusterFitModels
output of SCSR_Estim
function.
SpatReg_PseudoR2(SRModel)
SpatReg_PseudoR2(SRModel)
SRModel |
Estimated spatial or non-spatial regression model of class |
A numeric
value reporting the Pseudo R for the input model in
SRModel
.
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SpatReg_PseudoR2(SRModel = SCSAR$ClusterFitModels[[1]]) SpatReg_PseudoR2(SRModel = SCSAR$ClusterFitModels[[2]]) SpatReg_PseudoR2(SRModel = SCSAR$ClusterFitModels[[3]])
data(Data_RC_PM_RM_JABES2024, package="SCDA") SCSAR <- SCSR_Estim(Formula = "Gini_SO ~ GDPPC_PPS2020 + Share_AgroEmp", Data_sf = Data2020, G=3, listW=listW, Type="SCSAR", Phi = 0.50) SpatReg_PseudoR2(SRModel = SCSAR$ClusterFitModels[[1]]) SpatReg_PseudoR2(SRModel = SCSAR$ClusterFitModels[[2]]) SpatReg_PseudoR2(SRModel = SCSAR$ClusterFitModels[[3]])