RobPC {RobPC} | R Documentation |
Robust Panel Clustering Algorithm
Description
Robust Panel Clustering Algorithm
Usage
RobPC(data, k, robclust = FALSE, trim = 0.25)
Arguments
data |
the panel data. It must be array. |
k |
the number of clusters. |
robclust |
a logical arguments. If robclust=TRUE, the function implements the robust panel clustering analysis. Otherwise, it implements the traditional panel clustering analysis. The default value is robclust=TRUE. |
trim |
numeric between 0 and 1. Proportion of points to be trimmed. The default value is 0.25. |
Details
RobPC
function implements the traditional or robust panel clustering analysis without being affected by outliers in the panel data.
Value
a list with 2 elements:
clusters |
integer vector coding cluster membership. If robclust=TRUE, this vector includes codes as k+1 to define outliers clusters. |
clustering_method |
The used clustering method which is "Robust Panel Clustering" or "Panel Clustering". |
Author(s)
Hasan BULUT <hasan.bulut@omu.edu.tr>
References
Bulut et al. (Unpublished). A Robust Clustering Algorithms for Panel Data.
Wang, W., & Lu, Y. (2021). Application of clustering analysis of panel data in economic and social research based on R software. Acad. J. Bus. Manag, 3, 98-104.
Cuesta-Albertos, J. A., Gordaliza, A., & MatrĂ¡n, C. (1997). Trimmed k-means: an attempt to robustify quantizers. The Annals of Statistics, 25(2), 553-576.
Examples
set.seed(123)
n_obs <- 10 # Number of observations (N)
n_time <- 5 # Number of time periods (T)
n_vars <- 3 # Number of variables (D)
data <- array(rnorm(n_obs * n_time * n_vars), dim = c(n_obs, n_time, n_vars))
# Apply the Classical Panel Clustering
result_classic <- RobPC(data,k=3,robclust = FALSE)
result_classic
# Apply the Robust Panel Clustering
result_robust<- RobPC(data,k=3,robclust = TRUE,trim=0.2)
result_robust