Cluster {MVar} | R Documentation |
Performs hierarchical and non-hierarchical cluster analysis in a data set.
Cluster(data, titles = NA, hierarquico = TRUE, analise = "Obs", corabs = FALSE, normaliza = FALSE, distance = "euclidean", method = "complete", horizontal = FALSE, numgrupos = 0, lambda = 2, casc = TRUE)
data |
Data to be analyzed. |
titles |
Titles of the graphics, if not set, assumes the default text. |
hierarquico |
Hierarchical groupings (default = TRUE), for non-hierarchical groupings (method K-Means), only for case Analysis = "Obs". |
analise |
"Obs" for analysis on observations (default), "Var" for analysis on variables. |
corabs |
Matrix of absolute correlation case Analyze = "Var" (default = FALSE). |
normaliza |
Normalizes the data only for case Analyze = "Obs" (default = TRUE). |
distance |
Metric of the distances in case of hierarchical groupings: "euclidean" (default), "maximum", "manhattan", "canberra", "binary" or "minkowski". Case Analysis = "Var" the metric will be the correlation matrix, according to corabs. |
method |
Method for analyzing hierarchical groupings: "complete" (default), "ward.D", "ward.D2", "single", "average", "mcquitty", "median" or "centroid". |
horizontal |
Horizontal dendrogram (default = FALSE). |
numgrupos |
Number of groups to be formed. |
lambda |
Value used in the minkowski distance. |
casc |
Cascade effect in the presentation of the graphics (default = TRUE). |
Several graphics.
tabres |
Table with similarities and distances of the groups formed. |
groups |
Original data with groups formed. |
resgroups |
Results of the groups formed. |
sqt |
Total sum of squares. |
mtxD |
Matrix of the distances. |
Paulo Cesar Ossani
Marcelo Angelo Cirillo
MINGOTI, S. A. analise de dados atraves de metodos de estatistica multivariada: uma abordagem aplicada. Belo Horizonte: UFMG, 2005. 297 p.
FERREIRA, D. F. Estatistica Multivariada. 2a ed. revisada e ampliada. Lavras: Editora UFLA, 2011. 676 p.
RENCHER, A. C. Methods of multivariate analysis. 2th. ed. New York: J.Wiley, 2002. 708 p.
data(DataQuan) # set of quantitative data data <- DataQuan[,2:8] rownames(data) <- DataQuan[1:nrow(DataQuan),1] Res <- Cluster(data, hierarquico = TRUE, analise = "Obs", corabs = FALSE, normaliza = FALSE, distance = "euclidean", method = "ward.D", horizontal = FALSE, numgrupos = 2) print("Table with similarities and distances:"); Res$tabres print("groups formed:"); Res$groups print("Table with the results of the groups:"); Res$resgroups print("Total sum of squares:"); Res$sqt print("distance Matrix:"); Res$mtxD write.table(file=file.path(tempdir(),"SimilarityTable.csv"), Res$tabres, sep=";", dec=",",row.names = FALSE) write.table(file=file.path(tempdir(),"Groupeddata.csv"), Res$groups, sep=";", dec=",",row.names = TRUE) write.table(file=file.path(tempdir(),"GroupResults.csv"), Res$resgroups, sep=";", dec=",",row.names = TRUE)