Cluster {MVar}R Documentation

Cluster Analysis.

Description

Performs hierarchical and non-hierarchical cluster analysis in a data set.

Usage

Cluster(data, titles = NA, hierarquico = TRUE, analise = "Obs",  
        corabs = FALSE, normaliza = FALSE, distance = "euclidean",  
        method = "complete", horizontal = FALSE, numgrupos = 0,
        lambda = 2, casc = TRUE)

Arguments

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).

Value

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.

Author(s)

Paulo Cesar Ossani

Marcelo Angelo Cirillo

References

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.

Examples

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) 

[Package MVar version 2.0.9 Index]