amap/0000755000176200001440000000000014326676332011204 5ustar liggesusersamap/NAMESPACE0000644000176200001440000000110613275576575012433 0ustar liggesusersuseDynLib(amap, .registration = TRUE, .fixes = "C_") export("Kmeans","acp","pca","K","W","varrob", "acpgen","acprob","plot2","plotAll", "plot.acp","print.acp","biplot.acp","pop","diss") S3method("print","acp") S3method("plot","acp") S3method("biplot","acp") S3method("print","pop") export("Dist","hcluster","hclusterpar") export("matlogic","burt","afc") importFrom("graphics", "arrows", "axis", "barplot", "box", "lines", "par", "plot", "plot.new", "plot.window", "points", "text", "title") importFrom("stats", "biplot", "sd", "var") amap/demo/0000755000176200001440000000000012444343274012123 5ustar liggesusersamap/demo/amap.R0000755000176200001440000000355710336325616013177 0ustar liggesusers################################################### ### chunk number 1: ################################################### cat("\n------ CLUSTERING TOOLS -------\n") cat("\n------ Hierarchical clustering -------\n") data(USArrests) h = hcluster(USArrests) plot(h) readline("Next") ################################################### ### chunk number 2: ################################################### cat("\n------ Hierarchical clustering using function heatmap -------\n") heatmap(as.matrix(USArrests), hclustfun=hcluster, distfun=function(u){u}) readline("Next") ################################################### ### chunk number 3: ################################################### cat("\n------ Parralelized Hierarchical clustering -------\n") h = hclusterpar(USArrests,nbproc=4) readline("Next") ################################################### ### chunk number 4: ################################################### cat("\n------ K-means clustering -------\n") Kmeans(USArrests,centers=3,method="correlation") readline("Next") ################################################### ### chunk number 5: ################################################### cat("\n------ ROBUST TOOLS -------\n") cat("\n------ A robust variance computation -------\n") data(lubisch) lubisch <- lubisch[,-c(1,8)] varrob(scale(lubisch),h=1) readline("Next") ################################################### ### chunk number 6: ################################################### cat("\n------ A robust principal component analysis -------\n") p <- acpgen(lubisch,h1=1,h2=1/sqrt(2)) plot(p) readline("Next") ################################################### ### chunk number 6: ################################################### cat("\n------ Another robust principal component analysis -------\n") p <- acprob(lubisch,h=4) plot(p) readline("Next") amap/demo/00Index0000644000176200001440000000002610264436346013254 0ustar liggesusersamap Amap demo file amap/exec/0000755000176200001440000000000013466255342012126 5ustar liggesusersamap/exec/amap.php0000644000176200001440000001437013466255271013563 0ustar liggesusers
AMAP Demo Web application V0-3

Upload your data (text-tabulated file)

File Description:
A first Column
A first line
Separator

$MAX_FILE) exit("File size: $taillefichier; max allowed: $MAX_FILE"); } /* ================================== */ /* We write R code in file $ID/prog.R */ /* ================================== */ $fp=fopen("$ID/prog.R",'w'); fwrite($fp,"library(amap)\n"); fwrite($fp,"library(ctc)\n"); /* Read Data */ fwrite($fp,"data <- read.delim('$ID/data.txt',header=$HEADER,row.names=$ROWNAMES,sep='$SEP') \n" ); fwrite($fp,"data <- scale(data) \n"); fwrite($fp,"pca <- acprob(data,h=1) \n"); /* Number of columns to keep ( number of column to keep 90 % of * variance)*/ fwrite($fp,"cumVarNorm <- cumsum(pca\$sdev ^ 2) / sum(pca\$sdev ^ 2)\n"); fwrite($fp,"ncol <- max(which( cumVarNorm< 0.9)) +1 \n"); fwrite($fp,"ncol \n"); fwrite($fp,"data <- pca\$scores[,1:ncol] \n"); /* Hierarchical clustering */ fwrite($fp,"hr0 <- hclusterpar(data) \n"); fwrite($fp,"hc0 <- hclusterpar(t(data)) \n"); fwrite($fp,"hr <- as.dendrogram(hr0) \n"); fwrite($fp,"hc <- as.dendrogram(hc0) \n"); /* A pdf file */ fwrite($fp,"pdf(file='$ID/Rplots.pdf') \n"); fwrite($fp,"plot(pca) \n"); fwrite($fp,"biplot(pca) \n"); fwrite($fp,"plot2.acp(pca) \n"); fwrite($fp,"heatmap(as.matrix(data),Colv=hc,Rowv=hr) \n"); fwrite($fp,"dev.off() \n"); /* Some png images */ fwrite($fp,"bitmap(file='$ID/pcaplot.png') \n"); fwrite($fp,"plot(pca) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"bitmap(file='$ID/pcabiplot.png') \n"); fwrite($fp,"biplot(pca) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"bitmap(file='$ID/pcaplot2.png') \n"); fwrite($fp,"plot2.acp(pca) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"bitmap(file='$ID/heatmap.png') \n"); fwrite($fp,"heatmap(as.matrix(data),Colv=hc,Rowv=hr) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"r2atr(hc0,file='$ID/cluster.atr') \n"); fwrite($fp,"r2gtr(hr0,file='$ID/cluster.gtr') \n"); fwrite($fp,"r2cdt(hr0,hc0,data ,file='$ID/cluster.cdt') \n"); fclose($fp); /* ===================== */ /* Send command (R batch)*/ /* ===================== */ system("$R_BIN --no-save < $ID/prog.R > $ID/prog.R.out 2> $ID/prog.R.warnings"); /* ===================================== */ /* We create html page including results */ /* ===================================== */ echo "

Amap Demo results

"; echo "A pdf file

"; echo "

"; echo "

"; echo "

"; echo "

"; echo "3 files for Freeview"; echo " or Treeview: "; echo "cdt "; echo "atr "; echo "gtr "; echo "

"; /* Signature */ echo "

This results made by amap, Code use: prog.R, Out: prog.R.out, Warnings: prog.R.warnings."; } ?>

amap/data/0000755000176200001440000000000012444343274012110 5ustar liggesusersamap/data/lubisch.tab.gz0000644000176200001440000000212111655554615014652 0ustar liggesusersYn0 +H"MѮȝMc`hR~| |2.\ַM~ܿ˔og-dXDMJ'R5*BJC+UT^Pp~*Af.bzB5xbVJB+-V͠:d1N#eb 9 j8% H8]0TWO(P,WXpR\ije21Vd0'eHuu-dم&b eA=f -Y9Y,9 =T+BC & |=\à0\%B sE?T&ƜXX*"enAv18%xzY ?ۦUM!ۖ') ,P` n[5LuN޶栈Fv BV6[ܶ048rX·m8(et@'NYnwcXmQX(TDܕ1TܯhR"'|ecVvY1ɲ IܯԲ P;M_r0fiĊ{ ** g)ѐi8k JZPs" rNcU JwGAU+24ӋP /~ؘhtǪ;(:ŲWgEr0!+ t V=0(Iw,8)Z#Z庇ZvS3r5}PÉ]]h"Y [xVrEO wwVWR *:j'!.d[Ĭ\yY\%;(rbǘ򛜝XQ]AݳSk\]IkTWt{J%T6Vt@ =Cuh%L; dVر.n>=nv^ga'n +ݩ,薳9Yd݂(WU&4wj:(=0C\uNuYamap/man/0000755000176200001440000000000014326050134011741 5ustar liggesusersamap/man/dist.Rd0000644000176200001440000001324414326050134013177 0ustar liggesusers\name{Dist} \title{Distance Matrix Computation} \usage{ Dist(x, method = "euclidean", nbproc = 2, diag = FALSE, upper = FALSE) } \alias{Dist} \arguments{ \item{x}{numeric matrix or (data frame) or an object of class "exprSet". Distances between the rows of \code{x} will be computed.} \item{method}{the distance measure to be used. This must be one of \code{"euclidean"}, \code{"maximum"}, \code{"manhattan"}, \code{"canberra"}, \code{"binary"}, \code{"pearson"}, \code{"abspearson"}, \code{"correlation"}, \code{"abscorrelation"}, \code{"spearman"} or \code{"kendall"}. Any unambiguous substring can be given.} \item{nbproc}{integer, Number of subprocess for parallelization} \item{diag}{logical value indicating whether the diagonal of the distance matrix should be printed by \code{print.dist}.} \item{upper}{logical value indicating whether the upper triangle of the distance matrix should be printed by \code{print.dist}.} } \description{ This function computes and returns the distance matrix computed by using the specified distance measure to compute the distances between the rows of a data matrix. } \details{ Available distance measures are (written for two vectors \eqn{x} and \eqn{y}): \describe{ \item{\code{euclidean}:}{Usual square distance between the two vectors (2 norm).} \item{\code{maximum}:}{Maximum distance between two components of \eqn{x} and \eqn{y} (supremum norm)} \item{\code{manhattan}:}{Absolute distance between the two vectors (1 norm).} \item{\code{canberra}:}{\eqn{\sum_i |x_i - y_i| / |x_i + y_i|}{% sum(|x_i - y_i| / |x_i + y_i|)}. Terms with zero numerator and denominator are omitted from the sum and treated as if the values were missing. } \item{\code{binary}:}{(aka \emph{asymmetric binary}): The vectors are regarded as binary bits, so non-zero elements are `on' and zero elements are `off'. The distance is the \emph{proportion} of bits in which only one is on amongst those in which at least one is on.} \item{\code{pearson}:}{Also named "not centered Pearson" \eqn{1 - \frac{\sum_i x_i y_i}{\sqrt{\sum_i x_i^2 % \sum_i y_i^2}}}{% 1 - sum(x_i y_i) / sqrt [sum(x_i^2) sum(y_i^2)]}. } \item{\code{abspearson}:}{Absolute Pearson \eqn{1 - \left| \frac{\sum_i x_i y_i}{\sqrt{\sum_i x_i^2 % \sum_i y_i^2}} \right| }{% 1 - |sum(x_i y_i) / sqrt [sum(x_i^2) sum(y_i^2)] |}. } \item{\code{correlation}:}{Also named "Centered Pearson" \eqn{1 - corr(x,y)}. } \item{\code{abscorrelation}:}{Absolute correlation \eqn{1 - | corr(x,y) |} with \eqn{ corr(x,y) = \frac{\sum_i x_i y_i -\frac1n \sum_i x_i \sum_i% y_i}{% frac: 2nd part \sqrt{\left(\sum_i x_i^2 -\frac1n \left( \sum_i x_i \right)^2 % \right)% \left( \sum_i y_i^2 -\frac1n \left( \sum_i y_i \right)^2 % \right)} }}. } \item{\code{spearman}:}{Compute a distance based on rank. \eqn{\sum(d_i^2)}{sum (d_i^2)} where \eqn{d_i} is the difference in rank between \eqn{x_i} and \eqn{y_i}. \code{Dist(x,method="spearman")[i,j] =} \code{cor.test(x[i,],x[j,],method="spearman")$statistic} } \item{\code{kendall}:}{Compute a distance based on rank. \eqn{\sum_{i,j} K_{i,j}(x,y)} with \eqn{K_{i,j}(x,y)} is 0 if \eqn{x_i, x_j} in same order as \eqn{y_i,y_j}, 1 if not. } } Missing values are allowed, and are excluded from all computations involving the rows within which they occur. If some columns are excluded in calculating a Euclidean, Manhattan or Canberra distance, the sum is scaled up proportionally to the number of columns used. If all pairs are excluded when calculating a particular distance, the value is \code{NA}. The functions \code{as.matrix.dist()} and \code{as.dist()} can be used for conversion between objects of class \code{"dist"} and conventional distance matrices and vice versa. } \value{ An object of class \code{"dist"}. The lower triangle of the distance matrix stored by columns in a vector, say \code{do}. If \code{n} is the number of observations, i.e., \code{n <- attr(do, "Size")}, then for \eqn{i < j <= n}, the dissimilarity between (row) i and j is \code{do[n*(i-1) - i*(i-1)/2 + j-i]}. The length of the vector is \eqn{n*(n-1)/2}, i.e., of order \eqn{n^2}. The object has the following attributes (besides \code{"class"} equal to \code{"dist"}): \item{Size}{integer, the number of observations in the dataset.} \item{Labels}{optionally, contains the labels, if any, of the observations of the dataset.} \item{Diag, Upper}{logicals corresponding to the arguments \code{diag} and \code{upper} above, specifying how the object should be printed.} \item{call}{optionally, the \code{\link{call}} used to create the object.} \item{methods}{optionally, the distance method used; resulting form \code{\link{dist}()}, the (\code{\link{match.arg}()}ed) \code{method} argument.} } \references{ Mardia, K. V., Kent, J. T. and Bibby, J. M. (1979) \emph{Multivariate Analysis.} London: Academic Press. Wikipedia \url{https://en.wikipedia.org/wiki/Kendall_tau_distance} } \note{Multi-thread (parallelisation) is disable on Windows.} \seealso{ \code{\link[cluster]{daisy}} in the \file{cluster} package with more possibilities in the case of \emph{mixed} (contiuous / categorical) variables. \code{\link[stats]{dist}} \code{\link{hcluster}}. } \examples{ x <- matrix(rnorm(100), nrow=5) Dist(x) Dist(x, diag = TRUE) Dist(x, upper = TRUE) ## compute dist with 8 threads Dist(x,nbproc=8) Dist(x,method="abscorrelation") Dist(x,method="kendall") } \keyword{multivariate} \keyword{cluster} amap/man/hcluster.Rd0000644000176200001440000001361213275363601014074 0ustar liggesusers\name{hcluster} \title{Hierarchical Clustering} \alias{hcluster} \alias{hclusterpar} \description{ Hierarchical cluster analysis. } \usage{ hcluster(x, method = "euclidean", diag = FALSE, upper = FALSE, link = "complete", members = NULL, nbproc = 2, doubleprecision = TRUE) } \arguments{ \item{x}{ A numeric matrix of data, or an object that can be coerced to such a matrix (such as a numeric vector or a data frame with all numeric columns). Or an object of class "exprSet". } \item{method}{the distance measure to be used. This must be one of \code{"euclidean"}, \code{"maximum"}, \code{"manhattan"}, \code{"canberra"}, \code{"binary"}, \code{"pearson"}, \code{"abspearson"}, \code{"correlation"}, \code{"abscorrelation"}, \code{"spearman"} or \code{"kendall"}. Any unambiguous substring can be given.} \item{diag}{logical value indicating whether the diagonal of the distance matrix should be printed by \code{print.dist}.} \item{upper}{logical value indicating whether the upper triangle of the distance matrix should be printed by \code{print.dist}.} \item{link}{the agglomeration method to be used. This should be (an unambiguous abbreviation of) one of \code{"ward"}, \code{"single"}, \code{"complete"}, \code{"average"}, \code{"mcquitty"}, \code{"median"} or \code{"centroid"},\code{"centroid2"}.} \item{members}{\code{NULL} or a vector with length size of \code{d}.} \item{nbproc}{integer, number of subprocess for parallelization [Linux & Mac only]} \item{doubleprecision}{True: use of double precision for distance matrix computation; False: use simple precision} } \value{ An object of class \bold{hclust} which describes the tree produced by the clustering process. The object is a list with components: \item{merge}{an \eqn{n-1} by 2 matrix. Row \eqn{i} of \code{merge} describes the merging of clusters at step \eqn{i} of the clustering. If an element \eqn{j} in the row is negative, then observation \eqn{-j} was merged at this stage. If \eqn{j} is positive then the merge was with the cluster formed at the (earlier) stage \eqn{j} of the algorithm. Thus negative entries in \code{merge} indicate agglomerations of singletons, and positive entries indicate agglomerations of non-singletons.} \item{height}{a set of \eqn{n-1} non-decreasing real values. The clustering \emph{height}: that is, the value of the criterion associated with the clustering \code{method} for the particular agglomeration.} \item{order}{a vector giving the permutation of the original observations suitable for plotting, in the sense that a cluster plot using this ordering and matrix \code{merge} will not have crossings of the branches.} \item{labels}{labels for each of the objects being clustered.} \item{call}{the call which produced the result.} \item{method}{the cluster method that has been used.} \item{dist.method}{the distance that has been used to create \code{d} (only returned if the distance object has a \code{"method"} attribute).} There is a \code{\link{print}} and a \code{\link{plot}} method for \code{hclust} objects. The \code{plclust()} function is basically the same as the plot method, \code{plot.hclust}, primarily for back compatibility with S-plus. Its extra arguments are not yet implemented. } \details{ This function is a mix of function \code{hclust} and function \code{dist}. \code{hcluster(x, method = "euclidean",link = "complete") = hclust(dist(x, method = "euclidean"),method = "complete"))} It use twice less memory, as it doesn't store distance matrix. For more details, see documentation of \code{hclust} and \code{Dist}. } \note{Multi-thread (parallelisation) is disable on Windows.} \author{ The \code{hcluster} function is based on C code adapted from Cran Fortran routine by Antoine Lucas. } \seealso{ \code{\link{Dist}}, \code{\link[stats]{hclust}}, \code{\link[stats]{kmeans}}. } \references{ Antoine Lucas and Sylvain Jasson, \emph{Using amap and ctc Packages for Huge Clustering}, R News, 2006, vol 6, issue 5 pages 58-60. } \examples{ data(USArrests) hc <- hcluster(USArrests,link = "ave") plot(hc) plot(hc, hang = -1) ## Do the same with centroid clustering and squared Euclidean distance, ## cut the tree into ten clusters and reconstruct the upper part of the ## tree from the cluster centers. hc <- hclust(dist(USArrests)^2, "cen") memb <- cutree(hc, k = 10) cent <- NULL for(k in 1:10){ cent <- rbind(cent, colMeans(USArrests[memb == k, , drop = FALSE])) } hc1 <- hclust(dist(cent)^2, method = "cen", members = table(memb)) opar <- par(mfrow = c(1, 2)) plot(hc, labels = FALSE, hang = -1, main = "Original Tree") plot(hc1, labels = FALSE, hang = -1, main = "Re-start from 10 clusters") par(opar) ## other combinaison are possible hc <- hcluster(USArrests,method = "euc",link = "ward", nbproc= 1, doubleprecision = TRUE) hc <- hcluster(USArrests,method = "max",link = "single", nbproc= 2, doubleprecision = TRUE) hc <- hcluster(USArrests,method = "man",link = "complete", nbproc= 1, doubleprecision = TRUE) hc <- hcluster(USArrests,method = "can",link = "average", nbproc= 2, doubleprecision = TRUE) hc <- hcluster(USArrests,method = "bin",link = "mcquitty", nbproc= 1, doubleprecision = FALSE) hc <- hcluster(USArrests,method = "pea",link = "median", nbproc= 2, doubleprecision = FALSE) hc <- hcluster(USArrests,method = "abspea",link = "median", nbproc= 2, doubleprecision = FALSE) hc <- hcluster(USArrests,method = "cor",link = "centroid", nbproc= 1, doubleprecision = FALSE) hc <- hcluster(USArrests,method = "abscor",link = "centroid", nbproc= 1, doubleprecision = FALSE) hc <- hcluster(USArrests,method = "spe",link = "complete", nbproc= 2, doubleprecision = FALSE) hc <- hcluster(USArrests,method = "ken",link = "complete", nbproc= 2, doubleprecision = FALSE) } \keyword{multivariate} \keyword{cluster} amap/man/diss.Rd0000644000176200001440000000232310677417044013206 0ustar liggesusers\name{diss} \alias{diss} \title{Compute a dissimilarity matrix} \description{ Compute a dissimilarity matrix from a data set (containing only factors). } \usage{ diss(x, w=rep(1,ncol(x)) ) } \arguments{ \item{x}{A matrix or data frame containing only factors.} \item{w}{A vector of weight, by default each variable has got same weight} } \details{ %% Dissimilarity between individual i and j are number of common factors %% substracted to number of different factors. Case of N individuals described by P categorical variables: each element (i,j) of the signed similarities array is computed by sommation over the P variables of the contributions of each variable, multiplied by the weight of the variable. The contribution of a given categorical variable is +1 if the individual i and j are in the same class, and is -1 if they are not. } \value{ A dissimilarity matrix. } \author{Antoine Lucas} \seealso{ \code{\link{Dist}}, \code{\link{pop}} } \examples{ data <- matrix(c(1,1,1,1,1 ,1,2,1,2,1 ,2,3,2,3,2 ,2,4,3,3,2 ,1,2,4,2,1 ,2,3,2,3,1),ncol=5,byrow=TRUE) diss(data) ## With weights diss(data,w=c(1,1,2,2,3)) } \keyword{multivariate} \keyword{cluster} amap/man/Kmeans.Rd0000644000176200001440000000462111654604066013463 0ustar liggesusers\name{Kmeans} \alias{Kmeans} \title{ K-Means Clustering } \description{ Perform k-means clustering on a data matrix. } \usage{ Kmeans(x, centers, iter.max = 10, nstart = 1, method = "euclidean") } \arguments{ \item{x}{ A numeric matrix of data, or an object that can be coerced to such a matrix (such as a numeric vector or a data frame with all numeric columns). Or an object of class "exprSet". } \item{centers}{ Either the number of clusters or a set of initial cluster centers. If the first, a random set of rows in \code{x} are chosen as the initial centers. } \item{iter.max}{ The maximum number of iterations allowed. } \item{nstart}{If \code{centers} is a number, how many random sets should be chosen?} \item{method}{the distance measure to be used. This must be one of \code{"euclidean"}, \code{"maximum"}, \code{"manhattan"}, \code{"canberra"}, \code{"binary"}, \code{"pearson"} , \code{"abspearson"} , \code{"abscorrelation"}, \code{"correlation"}, \code{"spearman"} or \code{"kendall"}. Any unambiguous substring can be given.} } \details{ The data given by \code{x} is clustered by the k-means algorithm. When this terminates, all cluster centres are at the mean of their Voronoi sets (the set of data points which are nearest to the cluster centre). The algorithm of Lloyd--Forgy is used; method="euclidean" should return same result as with function \link[stats]{kmeans}. } \note{ An objective: to allow NA values. } \value{ A list with components: \item{cluster}{ A vector of integers indicating the cluster to which each point is allocated. } \item{centers}{A matrix of cluster centres.} \item{withinss}{The within-cluster sum of square distances for each cluster.} \item{size}{The number of points in each cluster.} } \seealso{ \code{\link{hcluster}},\code{\link[stats]{kmeans}}. } \examples{ ## a 2-dimensional example x <- rbind(matrix(rnorm(100, sd = 0.3), ncol = 2), matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2)) colnames(x) <- c("x", "y") (cl <- Kmeans(x, 2)) plot(x, col = cl$cluster) points(cl$centers, col = 1:2, pch = 8, cex=2) ## random starts do help here with too many clusters (cl <- Kmeans(x, 5, nstart = 25)) plot(x, col = cl$cluster) points(cl$centers, col = 1:5, pch = 8) Kmeans(x, 5,nstart = 25, method="abscorrelation") } \keyword{multivariate} \keyword{cluster} amap/man/acprob.Rd0000644000176200001440000000426513275363475013526 0ustar liggesusers\name{acprob} \alias{acprob} \title{Robust principal component analysis} \description{Robust principal component analysis} \usage{ acprob(x,h,center=TRUE,reduce=TRUE,kernel="gaussien") } \arguments{ \item{x}{Matrix / data frame} \item{h}{Scalar: bandwidth of the Kernel} \item{kernel}{The kernel used. This must be one of '"gaussien"', '"quartic"', '"triweight"', '"epanechikov"' , '"cosinus"' or '"uniform"' } \item{center}{A logical value indicating whether we center data} \item{reduce}{A logical value indicating whether we "reduce" data i.e. divide each column by standard deviation} } \details{ \code{acpgen} compute robust pca. i.e. spectral analysis of a robust variance instead of usual variance. Robust variance: see \code{\link{varrob}} } \value{ An object of class \bold{acp} The object is a list with components: \item{sdev}{the standard deviations of the principal components.} \item{loadings}{the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors). This is of class \code{"loadings"}: see \code{\link[stats]{loadings}} for its \code{print} method.} \item{scores}{if \code{scores = TRUE}, the scores of the supplied data on the principal components.} \item{eig}{Eigen values} } \keyword{multivariate} \references{ H. Caussinus, M. Fekri, S. Hakam and A. Ruiz-Gazen, \emph{A monitoring display of multivariate outliers} Computational Statistics & Data Analysis, Volume 44, Issues 1-2, 28 October 2003, Pages 237-252 Caussinus, H and Ruiz-Gazen, A. (1993): \emph{Projection Pursuit and Generalized Principal Component Analyses, in New Directions in Statistical Data Analysis and Robustness} (eds. Morgenthaler et al.), pp. 35-46. Birk\"auser Verlag Basel. Caussinus, H. and Ruiz-Gazen, A. (1995). \emph{Metrics for Finding Typical Structures by Means of Principal Component Analysis. In Data Science and its Applications} (eds Y. Escoufier and C. Hayashi), pp. 177-192. Tokyo: Academic Press. Antoine Lucas and Sylvain Jasson, \emph{Using amap and ctc Packages for Huge Clustering}, R News, 2006, vol 6, issue 5 pages 58-60. } \author{Antoine Lucas} \seealso{\link[stats]{princomp} \link{acpgen}} amap/man/acpgen.Rd0000644000176200001440000000762313275363445013513 0ustar liggesusers\name{acpgen} \alias{acpgen} \alias{K} \alias{W} \title{Generalised principal component analysis} \description{Generalised principal component analysis} \usage{ acpgen(x,h1,h2,center=TRUE,reduce=TRUE,kernel="gaussien") K(u,kernel="gaussien") W(x,h,D=NULL,kernel="gaussien") } \arguments{ \item{x}{Matrix or data frame} \item{h}{Scalar: bandwidth of the Kernel} \item{h1}{Scalar: bandwidth of the Kernel for W} \item{h2}{Scalar: bandwidth of the Kernel for U} \item{kernel}{The kernel used. This must be one of '"gaussien"', '"quartic"', '"triweight"', '"epanechikov"' , '"cosinus"' or '"uniform"' } \item{center}{A logical value indicating whether we center data} \item{reduce}{A logical value indicating whether we "reduce" data i.e. divide each column by standard deviation} \item{D}{A product scalar matrix / une matrice de produit scalaire} \item{u}{Vector} } \details{ \code{acpgen} compute generalised pca. i.e. spectral analysis of \eqn{U_n . W_n^{-1}}{Un / Wn}, and project \eqn{X_i}{Xi} with \eqn{W_n^{-1}}{1/Wn} on the principal vector sub-spaces. \eqn{X_i}{Xi} a column vector of \eqn{p} variables of individu \eqn{i} (input data) \code{W} compute estimation of noise in the variance. \deqn{W_n=\frac{\sum_{i=1}^{n-1}\sum_{j=i+1}^{n}K(||X_i-X_j||_{V_n^{-1}}/h)(X_i-X_j)(X_i-X_j)'}{\sum_{i=1}^{n-1}\sum_{j=i+1}^{n}K(||X_i-X_j||_{V_n^{-1}}/h)}}{W: see latex doc} with \eqn{V_n}{Vn} variance estimation; \code{U} compute robust variance. \eqn{U_n^{-1} = S_n^{-1} - 1/h V_n^{-1}}{1/Un = 1/Sn - 1 / (h Vn)} \deqn{S_n=\frac{\sum_{i=1}^{n}K(||X_i||_{V_n^{-1}}/h)(X_i-\mu_n)(X_i-\mu_n)'}{\sum_{i=1}^nK(||X_i||_{V_n^{-1}}/h)}}{S: see latex doc} with \eqn{\mu_n} estimator of the mean. %\eqn{\delta=K(|| X_i-X_j||)} with K: a kernel. \code{K} compute kernel, i.e. gaussien: \deqn{\frac{1}{\sqrt{2\pi}} e^{-u^2/2}}{ 1/sqrt(2pi) exp(-u^2/2)} quartic: \deqn{\frac{15}{16}(1-u^2)^2 I_{|u|\leq 1} }{ 15/16 (1-u^2)^2 if |u| < 1} triweight: \deqn{\frac{35}{32}(1-u^2)^3 I_{|u|\leq 1} }{ 35/32 (1-u^2)^3 if |u| < 1} epanechikov: \deqn{\frac{3}{4}(1-u^2) I_{|u|\leq 1} }{ 3/4 (1-u^2) if |u| < 1} cosinus: \deqn{\frac{\pi}{4}\cos(\frac{\pi}{2}u) I_{|u|\leq 1} }{ pi/4 cos (u * pi/2) if |u| < 1} } \value{ An object of class \bold{acp} The object is a list with components: \item{sdev}{the standard deviations of the principal components.} \item{loadings}{the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors). This is of class \code{"loadings"}: see \code{\link[stats]{loadings}} for its \code{print} method.} \item{scores}{if \code{scores = TRUE}, the scores of the supplied data on the principal components.} \item{eig}{Eigen values} } \examples{ data(lubisch) lubisch <- lubisch[,-c(1,8)] p <- acpgen(lubisch,h1=1,h2=1/sqrt(2)) plot(p,main='ACP robuste des individus') # See difference with acp p <- princomp(lubisch) class(p)<- "acp" } \references{ H. Caussinus, M. Fekri, S. Hakam and A. Ruiz-Gazen, \emph{A monitoring display of multivariate outliers} Computational Statistics & Data Analysis, Volume 44, Issues 1-2, 28 October 2003, Pages 237-252 Caussinus, H and Ruiz-Gazen, A. (1993): \emph{Projection Pursuit and Generalized Principal Component Analyses, in New Directions in Statistical Data Analysis and Robustness} (eds. Morgenthaler et al.), pp. 35-46. Birk\"auser Verlag Basel. Caussinus, H. and Ruiz-Gazen, A. (1995). \emph{Metrics for Finding Typical Structures by Means of Principal Component Analysis. In Data Science and its Applications} (eds Y. Escoufier and C. Hayashi), pp. 177-192. Tokyo: Academic Press. Antoine Lucas and Sylvain Jasson, \emph{Using amap and ctc Packages for Huge Clustering}, R News, 2006, vol 6, issue 5 pages 58-60. } \keyword{multivariate} \author{Antoine Lucas} \seealso{\link{acp} \link{acprob} \link[stats]{princomp} } amap/man/pop.Rd0000644000176200001440000000367413275363631013053 0ustar liggesusers\name{pop} \alias{pop} \title{Optimal Partition (classification).} \usage{ pop(x,fmbvr=TRUE,triabs=TRUE,allsol=TRUE) } \arguments{ \item{x}{A dissimilarity matrix} \item{fmbvr}{Logical, TRUE: look for the exact solution} \item{triabs}{Logical, TRUE: try to init with absolute values} \item{allsol}{Logical, TRUE all solutions, FALSE only one solution} } \description{ Classification: Computing an Optimal Partition from Weighted Categorical Variables or from an Array of Signed Similarities. } \references{ Theory is explained at \url{http://petitjeanmichel.free.fr/itoweb.petitjean.class.html} Marcotorchino F. \emph{Agr\'egation des similarit\'es en classification automatique.} Th\'ese de Doctorat d'Etat en Math\'ematiques, Universit\'e Paris VI, 25 June 1981. Petitjean M. \emph{Agr\'egation des similarit\'es: une solution oubli\'ee.} RAIRO Oper. Res. 2002,36[1],101-108. } \examples{ ## pop from a data matrix data <- matrix(c(1,1,1,1,1 ,1,2,1,2,1 ,2,3,2,3,2 ,2,4,3,3,2 ,1,2,4,2,1 ,2,3,2,3,1),ncol=5,byrow=TRUE) pop(diss(data)) ## pop from a dissimilarity matrix d <-2 * matrix(c(9, 8, 5, 7, 7, 2 , 8, 9, 2, 5, 1, 7 , 5, 2, 9, 8, 7, 1 , 7, 5, 8, 9, 3, 2 , 7, 1, 7, 3, 9, 6 , 2, 7, 1, 2, 6, 9),ncol=6,byrow=TRUE) - 9 pop(d) \dontrun{ d <- 2 * matrix(c(57, 15, 11, 32, 1, 34, 4, 6, 17, 7 , 15, 57, 27, 35, 27, 27, 20, 24, 30, 15 , 11, 27, 57, 25, 25, 20, 34, 25, 17, 15 , 32, 35, 25, 57, 22, 44, 13, 22, 30, 11 , 1, 27, 25, 22, 57, 21, 28, 43, 20, 13 , 34, 27, 20, 44, 21, 57, 18, 27, 21, 8 , 4, 20, 34, 13, 28, 18, 57, 31, 28, 13 , 6, 24, 25, 22, 43, 27, 31, 57, 30, 15 , 17, 30, 17, 30, 20, 21, 28, 30, 57, 12 , 7, 15, 15, 11, 13, 8, 13, 15, 12, 57),ncol=10,byrow=TRUE) - 57 pop(d) } } \keyword{multivariate} \author{Michel Petitjean, \url{http://petitjeanmichel.free.fr/itoweb.petitjean.class.html} R port by Antoine Lucas, } amap/man/varrob.Rd0000644000176200001440000000211714326040242013523 0ustar liggesusers\name{VarRob} \alias{varrob} \title{Robust variance} \description{Compute a robust variance} \usage{ varrob(x,h,D=NULL,kernel="gaussien") } \arguments{ \item{x}{Matrix / data frame} \item{h}{Scalar: bandwidth of the Kernel} \item{kernel}{The kernel used. This must be one of '"gaussien"', '"quartic"', '"triweight"', '"epanechikov"' , '"cosinus"' or '"uniform"' } \item{D}{A product scalar matrix / une matrice de produit scalaire} } \details{ \code{U} compute robust variance. \eqn{U_n^{-1} = S_n^{-1} - 1/h V_n^{-1}}{1/Un = 1/Sn - 1 / (h Vn)} \deqn{S_n=\frac{\sum_{i=1}^{n}K(||X_i||_{V_n^{-1}}/h)(X_i-\mu_n)(X_i-\mu_n)'}{\sum_{i=1}^nK(||X_i||_{V_n^{-1}}/h)}}{S: see latex doc} with \eqn{\mu_n} estimator of the mean. %\eqn{\delta=K(|| X_i-X_j||)} with K: a kernel. \code{K} compute a kernel. } \value{ A matrix } \references{ H. Caussinus, S. Hakam, A. Ruiz-Gazen Projections revelatrices controlees: groupements et structures diverses. 2002, to appear in Rev. Statist. Appli. } \keyword{multivariate} \author{Antoine Lucas} \seealso{\link{acp} \link[stats]{princomp} } amap/man/afc.Rd0000644000176200001440000000113113275363532012770 0ustar liggesusers\name{afc} \alias{afc} \title{Correspondance factorial analysis.} \usage{ afc(x) } \arguments{ \item{x}{A contingency table, or a result of function \code{burt} or \code{matlogic}} } \description{ Compute an acp on a contingency table tacking into account weight of rows and columns } \examples{ \dontrun{ color <- as.factor(c('blue','red','red','blue','red')) size <- as.factor(c('large','large','small','medium','large')) x <- data.frame(color,size) afc.1 <- afc(burt(x)) afc.2 <- afc(matlogic(x)) plotAll(afc.1) plotAll(afc.2) } } \keyword{multivariate} \author{Antoine Lucas} amap/man/acp.Rd0000644000176200001440000000304213275363515013006 0ustar liggesusers\name{acp} \alias{acp} \alias{pca} \alias{print.acp} \title{Principal component analysis} \description{Principal component analysis} \usage{ acp(x,center=TRUE,reduce=TRUE,wI=rep(1,nrow(x)),wV=rep(1,ncol(x))) pca(x,center=TRUE,reduce=TRUE,wI=rep(1,nrow(x)),wV=rep(1,ncol(x))) \S3method{print}{acp}(x, ...) } \arguments{ \item{x}{Matrix / data frame} \item{center}{a logical value indicating whether we center data} \item{reduce}{a logical value indicating whether we "reduce" data i.e. divide each column by standard deviation} \item{wI,wV}{weigth vector for individuals / variables} \item{\dots}{arguments to be passed to or from other methods.} } \value{ An object of class \bold{acp} The object is a list with components: \item{sdev}{the standard deviations of the principal components.} \item{loadings}{the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors). This is of class \code{"loadings"}: see \code{\link[stats]{loadings}} for its \code{print} method.} \item{scores}{if \code{scores = TRUE}, the scores of the supplied data on the principal components.} \item{eig}{Eigen values} } \details{ This function offer a variant of \code{\link[stats]{princomp}} and \code{\link[stats]{prcomp}} functions, with a slightly different graphic representation (see \code{\link{plot.acp}}). } \examples{ data(lubisch) lubisch <- lubisch[,-c(1,8)] p <- acp(lubisch) plot(p) } \keyword{multivariate} \author{Antoine Lucas} \seealso{\link{plot.acp},\link{acpgen}, \link[stats]{princomp} } amap/man/burt.Rd0000644000176200001440000000256013275363670013225 0ustar liggesusers\name{burt} \alias{burt} \alias{matlogic} \title{Compute burt table from a factor dataframe.} \usage{ burt(x) matlogic(x) } \arguments{ \item{x}{A dataframe that contents only factors} } \description{ %matlogic: tableau disjonctif complet %burt matlogic returns for all variables a matrix of logical values for each levels. burt is defined as t(matlogic).matlogic } \examples{ color <- as.factor(c('blue','red','red','blue','red')) size <- as.factor(c('large','large','small','medium','large')) x <- data.frame(color,size) matlogic(x) ## color.blue color.red size.large size.medium size.small ##1 1 0 1 0 0 ##2 0 1 1 0 0 ##3 0 1 0 0 1 ##4 1 0 0 1 0 ##5 0 1 1 0 0 burt(x) ## color.blue color.red size.large size.medium size.small ## color.blue 2 0 1 1 0 ## color.red 0 3 2 0 1 ## size.large 1 2 3 0 0 ## size.medium 1 0 0 1 0 ## size.small 0 1 0 0 1 } \keyword{multivariate} \author{Antoine Lucas} amap/man/lubisch.Rd0000644000176200001440000000027710227236165013675 0ustar liggesusers\name{lubisch} \alias{lubisch} \title{Dataset Lubischew} \usage{ data(lubisch) } \description{Lubischew data (1962): 74 insects, 6 morphologic size. 3 supposed classes} \keyword{datasets} amap/man/plot.acp.Rd0000644000176200001440000000316213275363616013770 0ustar liggesusers\name{plot} \alias{plot.acp} \alias{biplot.acp} \alias{plot2} \alias{plotAll} \title{Graphics for Principal component Analysis} \description{Graphics for Principal component Analysis} \usage{ \S3method{plot}{acp}(x,i=1,j=2,text=TRUE,label='Composants',col='darkblue', main='Individuals PCA',variables=TRUE,individual.label=NULL,...) \S3method{biplot}{acp}(x,i=1,j=2,label='Composants',col='darkblue',length=0.1, main='Variables PCA',circle=TRUE,...) plot2(x,pourcent=FALSE,eigen=TRUE,label='Comp.',col='lightgrey', main='Scree Graph',ylab='Eigen Values') plotAll(x) } \arguments{ \item{x}{Result of acp or princomp} \item{i}{X axis} \item{j}{Y axis} \item{text}{a logical value indicating whether we use text or points for plot} \item{pourcent}{a logical value indicating whether we use pourcentage of values} \item{eigen}{a logical value indicating whether we use eigen values or standard deviation} \item{label}{label for X and Y axis} \item{individual.label}{labels naming individuals} \item{col}{Color of plot} \item{main}{Title of graphic} \item{ylab}{Y label} \item{length}{length of arrows} \item{variables,circle}{a logical value indicating whether we display circle or variables} \item{\dots}{cex, pch, and other options; see points.} } \value{ Graphics: \code{plot.acp} PCA for lines (individuals) \code{plot.acp} PCA for columns (variables) \code{plot2} Eigen values diagram (Scree Graph) \code{plotAll} Plot both 3 graphs } \examples{ data(lubisch) lubisch <- lubisch[,-c(1,8)] p <- acp(lubisch) plotAll(p) } \keyword{multivariate} \author{Antoine Lucas} \seealso{\link{acpgen},\link{acprob}, \link[stats]{princomp}} amap/DESCRIPTION0000644000176200001440000000073014326676332012712 0ustar liggesusersPackage: amap Version: 0.8-19 Date: 2022-10-25 Title: Another Multidimensional Analysis Package Author: Antoine Lucas Maintainer: Antoine Lucas Depends: R (>= 3.6.0) Suggests: Biobase Description: Tools for Clustering and Principal Component Analysis (With robust methods, and parallelized functions). License: GPL Packaged: 2022-10-27 20:39:27 UTC; antoine Repository: CRAN Date/Publication: 2022-10-28 06:55:22 UTC NeedsCompilation: yes amap/build/0000755000176200001440000000000014326566177012310 5ustar liggesusersamap/build/vignette.rds0000644000176200001440000000031214326566177014643 0ustar liggesusersb```b`a@, $؀XX84Gbnb^P^9g^IQ~JirIf~BIHV)ihl3 E!@„5/17M+KjAj^ Hv]ZY_Ӄ -3'foHf e2|s  =XQĒD"~ amap/tests/0000755000176200001440000000000014326564445012347 5ustar liggesusersamap/tests/amap-test.R0000644000176200001440000000217414326562473014370 0ustar liggesusers library(amap) set.seed(1234) data(USArrests) METHODS <- c("euclidean", "maximum", "manhattan", "canberra", "binary","pearson","correlation","spearman","kendall", "abspearson","abscorrelation") METHODSLINKS <- c("ward", "single", "complete", "average", "mcquitty", "median", "centroid","centroid2") for (mymethod in METHODS) { d = Dist(USArrests, method = mymethod) print(d) k = Kmeans(USArrests, centers = 4, method = mymethod) print(k) for (mylink in METHODSLINKS) { cat(mylink) cat(mymethod) hc <- hcluster(USArrests,link = mylink, method = mymethod, nbproc=4) print(hc) } } hc <- hcluster(USArrests, nbproc=1) print(hc) KERNELS = c("gaussien", "quartic", "triweight", "epanechikov" , "cosinus", "uniform") for(myKernel in KERNELS) { myacp = acprob(USArrests, kernel = myKernel); print(myacp) } d <-2 * matrix(c(9, 8, 5, 7, 7, 2 , 8, 9, 2, 5, 1, 7 , 5, 2, 9, 8, 7, 1 , 7, 5, 8, 9, 3, 2 , 7, 1, 7, 3, 9, 6 , 2, 7, 1, 2, 6, 9),ncol=6,byrow=TRUE) - 9 pop(d) amap/tests/amap-test.Rout.save0000644000176200001440000147034714326563373016071 0ustar liggesusers R Under development (unstable) (2022-10-23 r83164) -- "Unsuffered Consequences" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > library(amap) > > set.seed(1234) > > data(USArrests) > > METHODS <- c("euclidean", "maximum", "manhattan", "canberra", + "binary","pearson","correlation","spearman","kendall", + "abspearson","abscorrelation") > METHODSLINKS <- c("ward", "single", "complete", "average", "mcquitty", + "median", "centroid","centroid2") > > > > for (mymethod in METHODS) { + d = Dist(USArrests, method = mymethod) + print(d) + k = Kmeans(USArrests, centers = 4, method = mymethod) + print(k) + for (mylink in METHODSLINKS) + { + cat(mylink) + cat(mymethod) + hc <- hcluster(USArrests,link = mylink, method = mymethod, nbproc=4) + print(hc) + } + } Alabama Alaska Arizona Arkansas California Alaska 37.177009 Arizona 63.008333 46.592489 Arkansas 46.928137 77.197409 108.851918 California 55.524769 45.102217 23.194180 97.582017 Colorado 41.932565 66.475935 90.351148 36.734861 73.197131 Connecticut 128.206942 159.406556 185.159526 85.028289 169.277110 Delaware 16.806249 45.182961 58.616380 53.010376 49.291480 Florida 102.001618 79.974496 41.654532 148.735739 60.980735 Georgia 25.841827 57.030255 86.037957 25.586129 73.997297 Hawaii 191.803050 221.193535 248.268967 147.775979 231.071093 Idaho 116.761980 146.484982 176.817674 70.587038 162.612792 Illinois 28.454877 42.911653 45.697812 67.770274 32.718802 Indiana 123.345207 152.804090 181.897801 78.478086 166.229961 Iowa 180.610105 209.983523 239.991458 134.594948 224.634659 Kansas 121.519875 151.480197 180.028914 76.753436 164.516747 Kentucky 127.284170 156.612037 187.690303 81.092848 173.207910 Louisiana 15.454449 32.348879 48.494639 61.545512 41.635562 Maine 154.145289 183.897526 214.327413 107.850730 199.931113 Maryland 64.993615 44.839492 15.015991 111.642913 36.347352 Massachusetts 91.648513 123.254209 145.875906 54.181178 129.524708 Michigan 28.485435 28.857755 39.872422 71.100281 27.746351 Minnesota 164.650964 194.253571 223.088256 119.324641 207.222537 Mississippi 27.390144 28.635118 52.708728 69.685364 55.683570 Missouri 59.788293 89.306719 116.467377 24.894377 100.988910 Montana 127.392621 156.673578 187.540849 81.163107 172.996069 Nebraska 134.436974 164.114259 193.423602 88.978930 178.100814 Nevada 37.430469 34.886817 44.797433 74.288694 26.746962 New Hampshire 179.736196 209.254415 239.255616 133.678308 224.055395 New Jersey 83.243018 114.735566 135.850396 49.844257 119.041169 New Mexico 51.643489 33.521933 13.896043 97.931200 24.495102 New York 33.710829 43.182983 40.853519 73.762118 26.900929 North Carolina 101.961022 79.376067 57.619615 147.184238 80.332123 North Dakota 192.416138 221.378590 252.808188 145.855545 238.214462 Ohio 117.387606 147.373335 174.338177 74.369752 157.998513 Oklahoma 85.848704 116.429421 143.931407 43.012673 128.779346 Oregon 78.386861 106.930117 135.672879 36.895122 120.039577 Pennsylvania 131.085087 161.600897 188.866222 86.990862 172.999364 Rhode Island 70.338112 103.903802 122.418871 42.185305 107.213106 South Carolina 44.182915 27.556487 36.890920 89.248866 47.061343 South Dakota 151.089113 179.948131 211.751576 104.455206 197.524378 Tennessee 48.347596 77.884530 108.258117 12.614278 94.727662 Texas 41.566092 72.362214 93.275988 32.744618 77.380230 Utah 118.502700 148.276094 174.257338 76.438995 157.492635 Vermont 190.370691 218.290472 251.489264 143.528569 237.435465 Virginia 80.295330 110.646690 139.424711 36.421560 124.820912 Washington 92.820472 122.147002 149.297857 51.204785 133.106574 West Virginia 156.792411 185.640863 218.006078 110.071113 204.253715 Wisconsin 183.775733 213.575397 242.312381 138.344245 226.457502 Wyoming 75.507086 106.740105 135.380390 30.987255 121.720335 Colorado Connecticut Delaware Florida Georgia Alaska Arizona Arkansas California Colorado Connecticut 98.081191 Delaware 41.477825 128.210179 Florida 131.405822 226.303005 99.108325 Georgia 25.093027 104.426529 33.245300 125.766490 Hawaii 159.179176 64.952367 192.366109 289.428575 167.128005 Idaho 90.886413 25.280427 119.421313 217.665179 93.116057 Illinois 47.669068 139.906469 18.151859 86.558708 45.002667 Indiana 93.615063 16.316250 125.310534 222.923866 98.772871 Iowa 152.079749 57.595573 182.709989 281.013523 156.445805 Kansas 92.179716 14.173920 123.165945 221.082722 97.174071 Kentucky 101.024749 26.343880 130.597435 228.332762 103.041448 Louisiana 49.974994 140.398077 16.976749 87.670348 38.690567 Maine 127.900156 37.647443 156.666652 255.152307 130.472564 Maryland 97.300411 191.161947 63.577984 37.783859 89.505363 Massachusetts 59.900000 40.165284 89.958324 187.043738 68.762272 Michigan 51.454835 147.266561 26.531679 80.356269 47.398101 Minnesota 134.764535 39.746698 166.141656 264.225831 140.327830 Mississippi 68.664401 153.263955 36.479172 85.390456 51.355428 Missouri 29.179788 70.695827 61.378905 157.491746 35.571337 Montana 100.751675 24.746313 130.393136 228.327856 103.302081 Nebraska 105.668349 17.865050 136.378334 234.464006 110.195735 Nevada 48.834209 146.551083 35.053245 84.255860 50.567579 New Hampshire 151.589182 57.043843 181.854695 280.247480 155.665603 New Jersey 50.420829 51.196680 80.877995 176.897174 60.778286 New Mexico 81.736222 176.580322 50.089320 51.147238 75.177723 New York 52.278102 145.268166 24.189461 81.542198 50.643657 North Carolina 138.977588 229.504009 102.861557 38.527912 127.335973 North Dakota 165.750928 73.038962 195.272271 293.622751 168.611417 Ohio 85.817539 15.036289 118.179186 215.466610 92.883637 Oklahoma 57.099737 43.036031 87.195929 184.983918 61.759858 Oregon 47.364121 53.242840 80.307223 176.810661 54.050902 Pennsylvania 101.039596 8.027453 132.003674 229.949581 106.822376 Rhode Island 43.879494 64.837104 66.208006 163.312461 50.992647 South Carolina 82.641939 172.206765 48.725148 65.187115 69.194581 South Dakota 125.302115 40.039231 154.422829 252.438844 127.294776 Tennessee 28.005892 82.192761 53.343228 148.592867 23.427548 Texas 14.501034 92.659160 39.665224 134.179917 22.851258 Utah 85.625522 15.755951 118.514556 215.533849 94.292364 Vermont 165.047690 76.617361 194.254601 292.020085 166.724923 Virginia 53.416851 49.307200 82.678716 180.286023 56.028743 Washington 60.642065 38.334058 93.604327 190.555635 68.590962 West Virginia 132.360115 47.895720 160.562418 258.460539 133.229651 Wisconsin 154.115217 58.056696 185.194195 283.423799 159.511880 Wyoming 52.036718 54.060152 77.934909 176.112606 52.119094 Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho 79.751426 Illinois 203.099606 132.811445 Indiana 69.406412 15.407790 137.256111 Iowa 29.407822 64.137119 195.329286 58.584042 Kansas 71.100844 13.964240 135.278823 3.929377 60.177487 Kentucky 70.459705 13.409698 143.599373 14.606163 53.993055 Louisiana 203.970611 130.433278 17.811232 136.255936 193.966621 Maine 50.566788 37.672404 170.033320 36.003472 27.879383 Maryland 254.687573 181.189542 53.593376 187.179192 244.930725 Massachusetts 103.097139 42.539981 100.495224 41.544314 97.277130 Michigan 209.833863 138.390968 15.591664 143.065789 201.381355 Minnesota 31.620405 49.482320 178.213636 41.706834 18.713899 Mississippi 216.832308 140.041637 41.244394 147.822258 203.972670 Missouri 132.931148 62.104428 72.315973 65.613108 124.035680 Montana 69.885120 11.764353 143.447273 13.512957 53.529898 Nebraska 59.930710 19.904271 148.806787 12.596031 46.609548 Nevada 207.733603 138.767431 22.366046 142.221658 200.738860 New Hampshire 31.220666 63.208702 194.607657 58.096988 2.291288 New Jersey 113.187323 52.822344 90.399336 51.931493 108.241813 New Mexico 239.726553 166.969608 39.135789 172.481448 230.493557 New York 208.186095 138.541907 6.236986 142.699755 200.856292 North Carolina 293.600238 217.443717 96.214188 225.019221 281.504316 North Dakota 41.335941 75.999013 208.585834 72.757474 17.548789 Ohio 74.467711 22.692069 129.311136 12.213517 67.439009 Oklahoma 106.074172 34.736724 99.294713 38.136072 96.130380 Oregon 114.490043 43.855444 91.729712 46.842075 105.072784 Pennsylvania 61.237978 23.112334 143.769329 11.662761 52.485903 Rhode Island 128.628224 63.564534 77.048621 66.187083 121.796716 South Carolina 235.800975 159.765860 46.295248 167.030207 223.795174 South Dakota 55.686713 35.219313 167.874953 34.753417 32.385336 Tennessee 144.385941 70.161599 65.675338 75.708718 133.388005 Texas 155.296008 86.410069 48.171984 89.551661 147.871194 Utah 74.139733 27.423530 129.240280 17.135052 68.996812 Vermont 51.919264 75.346931 207.925660 73.722724 26.249000 Virginia 111.850302 38.132139 95.202416 43.067157 100.816913 Washington 99.692979 33.644613 104.698615 33.545193 91.663788 West Virginia 57.271022 42.185543 174.350738 42.885196 31.068473 Wisconsin 20.824265 68.151009 197.332410 61.042608 9.508417 Wyoming 117.377212 41.672533 91.414003 48.562537 105.231412 Kansas Kentucky Louisiana Maine Maryland Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 15.766420 Louisiana 134.394940 140.937220 Maine 36.989863 28.407921 167.825058 Maryland 185.337881 191.939600 51.479802 218.699886 Massachusetts 39.018585 52.125713 102.551499 74.763226 152.659294 Michigan 141.398798 148.859665 16.652327 175.949680 46.129492 Minnesota 43.237715 40.199005 177.605124 19.919086 228.528707 Mississippi 146.023354 150.351588 24.708298 176.939227 48.451316 Missouri 64.015936 72.298686 71.651657 99.246007 122.059207 Montana 14.406943 3.834058 141.035457 27.733914 191.924595 Nebraska 13.789126 13.349157 147.582858 23.717715 198.508665 Nevada 140.770878 148.923940 28.472443 176.131343 53.217009 New Hampshire 59.594127 53.141321 193.137723 26.530925 244.109668 New Jersey 49.674943 62.293980 93.298231 85.843404 143.042686 New Mexico 170.716051 177.630318 37.762548 204.553123 15.890249 New York 140.757309 149.261515 21.417283 175.732439 49.798896 North Carolina 223.108964 228.131388 90.708158 254.439973 44.640565 North Dakota 74.333909 65.728304 206.240563 38.664454 257.069057 Ohio 10.920165 26.110726 129.569479 46.443514 180.335687 Oklahoma 36.115924 45.202876 98.439220 71.288779 149.281379 Oregon 45.452173 54.009629 90.893674 80.635538 141.153144 Pennsylvania 11.256109 20.555291 143.600487 32.218783 194.556958 Rhode Island 63.425941 74.523084 80.020060 97.872059 129.300657 South Carolina 165.259826 170.224939 35.001286 196.957813 28.977578 South Dakota 36.247483 25.001200 165.023998 8.537564 215.780560 Tennessee 74.222975 80.091260 61.619234 107.596561 112.305031 Texas 87.710547 96.652160 50.181471 123.250355 99.886185 Utah 15.901258 31.477135 130.331616 49.388460 180.716961 Vermont 75.535952 64.832554 204.578200 39.969613 255.122265 Virginia 41.273963 48.485049 93.315915 75.368229 144.257582 Washington 31.941196 43.214581 104.933122 68.338642 155.296008 West Virginia 44.280696 31.906112 170.919572 12.775367 221.627187 Wisconsin 62.509199 58.417977 196.748062 33.678628 247.739157 Wyoming 46.458584 52.696300 88.867992 79.043849 139.782295 Massachusetts Michigan Minnesota Mississippi Missouri Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan 108.488386 Minnesota 79.340091 184.524795 Mississippi 117.976820 35.440090 188.778706 Missouri 35.053816 77.473996 107.091456 86.084958 Montana 51.250073 148.808266 39.384515 150.610425 72.098821 Nebraska 52.326380 154.789535 30.349959 158.469555 77.453083 Nevada 107.554312 13.297368 183.527818 47.627933 76.968045 New Hampshire 96.729158 200.707150 18.828701 202.982167 123.427307 New Jersey 11.456439 98.634578 90.195898 110.016272 28.511752 New Mexico 137.911711 30.421867 213.907760 39.988623 107.097946 New York 105.673696 15.066519 183.630063 43.531598 77.722712 North Carolina 192.400624 89.032634 266.032949 78.074388 161.457146 North Dakota 112.209447 214.244090 35.698319 214.769947 137.364661 Ohio 31.231715 135.781921 49.481411 142.751287 58.635569 Oklahoma 17.650212 105.405218 79.285686 111.079521 28.390139 Oregon 24.356724 96.697880 88.216778 103.938828 19.698223 Pennsylvania 44.984108 150.488139 34.712534 155.864942 73.295157 Rhode Island 26.343880 86.740590 104.350611 96.502487 27.062335 South Carolina 135.674021 37.630440 208.249010 21.167192 103.666050 South Dakota 74.710173 173.113200 25.349951 173.492882 96.711943 Tennessee 48.854887 69.155260 117.299829 73.283354 15.502580 Texas 53.689198 55.177169 130.573198 68.863053 25.494705 Utah 30.182777 135.974446 50.638424 144.281149 59.377858 Vermont 114.196541 212.796194 41.784447 211.879730 136.672016 Virginia 23.857284 100.709086 84.452827 105.074830 24.279621 Washington 16.067669 110.660833 74.211724 118.601096 33.570821 West Virginia 82.405643 179.464760 29.160933 178.544112 103.624804 Wisconsin 98.033107 203.835080 19.437592 207.706379 126.430692 Wyoming 27.843312 97.161412 89.298936 99.743371 23.507446 Montana Nebraska Nevada New Hampshire New Jersey Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska 11.528226 Nevada 148.820697 154.251937 New Hampshire 52.686051 45.987390 200.210539 New Jersey 61.674306 63.189398 97.344132 107.738480 New Mexico 177.596875 183.974917 37.467986 229.732997 128.179132 New York 149.111032 154.332109 20.645096 200.163833 95.399057 North Carolina 228.247870 235.774999 97.034272 280.505561 183.462939 North Dakota 65.474041 60.579617 214.115973 17.161876 123.275342 Ohio 25.133444 22.934908 134.495985 67.071976 41.518309 Oklahoma 44.747290 49.543314 105.249038 95.448939 22.518437 Oregon 53.512802 58.636166 95.797599 104.522151 24.505102 Pennsylvania 19.296114 11.070682 149.663021 51.998077 55.806989 Rhode Island 73.846936 76.661920 87.285337 121.050114 18.848077 South Carolina 170.390053 177.941030 48.734895 222.863837 127.057821 South Dakota 24.714368 23.641912 173.276657 31.237477 85.521693 Tennessee 80.243941 87.134207 70.326453 132.649802 42.898135 Texas 96.543772 101.373369 54.977268 147.242521 43.794749 Utah 30.001500 26.271087 134.311615 68.744236 40.453059 Vermont 64.834250 62.036280 212.903828 25.688519 125.119143 Virginia 48.308798 54.334888 100.964251 100.081966 26.264425 Washington 42.379712 45.433248 109.417914 91.189363 22.766642 West Virginia 32.101402 31.996875 179.983721 29.631065 93.151167 Wisconsin 57.861213 49.521510 202.872374 10.860018 108.867075 Wyoming 52.481235 59.093654 98.363205 104.361391 29.250641 New Mexico New York North Carolina North Dakota Ohio Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York 35.399011 North Carolina 59.896244 93.132218 North Dakota 242.906155 214.253425 292.388919 Ohio 165.472959 134.586515 219.202144 82.626025 Oklahoma 134.645646 104.835395 187.566442 109.576138 31.819019 Oregon 126.234266 97.132281 180.021804 118.430613 40.659193 Pennsylvania 179.907893 149.159244 232.672151 67.771749 15.755951 Rhode Island 115.067111 82.323326 168.777961 136.006470 56.980874 South Carolina 24.923082 45.747678 58.445872 234.921263 161.436117 South Dakota 201.633951 173.594873 251.190227 41.487950 46.284015 Tennessee 97.776684 71.344586 150.045593 145.643125 70.321121 Texas 84.860179 53.365907 140.746048 161.569954 81.436908 Utah 165.761515 134.404799 220.127872 84.676561 6.637771 Vermont 241.110867 213.666141 289.535231 13.044922 84.634804 Virginia 129.724207 100.841063 182.006621 113.669917 37.972753 Washington 140.351594 110.001909 194.501954 105.869967 25.747427 West Virginia 207.676022 180.137170 256.264570 36.728871 54.460720 Wisconsin 233.176178 202.749451 285.014473 23.737944 68.588993 Wyoming 125.576311 97.230345 176.747532 117.545268 44.044182 Oklahoma Oregon Pennsylvania Rhode Island South Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon 12.424975 Pennsylvania 45.465371 55.166294 Rhode Island 32.204503 32.684094 70.006928 South Carolina 129.811748 122.055274 175.009628 113.440028 South Dakota 69.380689 78.015768 33.758851 97.613575 193.557356 Tennessee 39.257738 31.299361 84.170125 37.709415 91.775814 Texas 52.071681 44.813837 96.136986 34.063617 84.379441 Utah 33.540572 41.639524 18.264994 56.375527 162.574906 Vermont 109.552727 117.817231 70.671777 137.516726 232.149801 Virginia 7.355270 10.579225 51.180856 32.859854 124.064701 Washington 10.305338 15.569843 40.681445 36.847931 136.758364 West Virginia 76.526466 85.256319 41.781814 104.686628 198.833926 Wisconsin 98.532431 107.631501 53.623689 122.836843 227.323844 Wyoming 13.542526 15.630099 56.300444 31.029824 119.051963 South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee 104.341602 Texas 121.204373 24.742878 Utah 49.833423 71.979164 81.596630 Vermont 40.225862 143.862747 161.331150 87.326342 Virginia 72.859454 33.174237 48.525045 40.223501 112.937770 Washington 66.667833 46.153331 57.106742 26.182628 106.387217 West Virginia 8.766984 110.521536 128.032965 58.251266 33.968515 Wisconsin 39.184691 136.548782 149.726751 69.510934 34.370336 Wyoming 76.595300 29.977492 46.182464 46.338429 116.591252 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 16.477257 West Virginia 79.616581 74.434535 Wisconsin 103.686161 93.552766 39.049456 Wyoming 7.930952 23.349518 82.957218 108.354418 K-means clustering with 4 clusters of sizes 10, 20, 6, 14 Cluster means: Murder Assault UrbanPop Rape 1 11.540000 253.1000 70.30000 29.26000 2 4.270000 87.5500 59.75000 14.39000 3 12.266667 305.0000 65.00000 26.90000 4 8.214286 173.2857 70.64286 22.84286 Clustering vector: Alabama Alaska Arizona Arkansas California 1 1 3 4 1 Colorado Connecticut Delaware Florida Georgia 4 2 1 3 4 Hawaii Idaho Illinois Indiana Iowa 2 2 1 2 2 Kansas Kentucky Louisiana Maine Maryland 2 2 1 2 3 Massachusetts Michigan Minnesota Mississippi Missouri 4 1 2 1 4 Montana Nebraska Nevada New Hampshire New Jersey 2 2 1 2 4 New Mexico New York North Carolina North Dakota Ohio 3 1 3 2 2 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 4 4 2 4 3 South Dakota Tennessee Texas Utah Vermont 2 4 4 2 2 Virginia Washington West Virginia Wisconsin Wyoming 4 4 2 2 4 Within cluster sum of squares by cluster: [1] 257.4792 1248.4420 988.9111 318.6684 Available components: [1] "cluster" "centers" "withinss" "size" wardeuclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : euclidean Number of objects: 50 singleeuclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : euclidean Number of objects: 50 completeeuclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : euclidean Number of objects: 50 averageeuclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : euclidean Number of objects: 50 mcquittyeuclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : euclidean Number of objects: 50 medianeuclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : euclidean Number of objects: 50 centroideuclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : euclidean Number of objects: 50 centroid2euclidean Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : euclidean Number of objects: 50 Alabama Alaska Arizona Arkansas California Colorado Connecticut Alaska 27.0 Arizona 58.0 32.0 Arkansas 46.0 73.0 104.0 California 40.0 43.0 18.0 86.0 Colorado 32.0 59.0 90.0 28.0 72.0 Connecticut 126.0 153.0 184.0 80.0 166.0 94.0 Delaware 14.0 28.7 56.0 48.0 38.0 34.0 128.0 Florida 99.0 72.0 41.0 145.0 59.0 131.0 225.0 Georgia 25.0 52.0 83.0 21.0 65.0 18.0 101.0 Hawaii 190.0 217.0 248.0 144.0 230.0 158.0 64.0 Idaho 116.0 143.0 174.0 70.0 156.0 84.0 23.0 Illinois 25.0 35.0 45.0 59.0 27.0 45.0 139.0 Indiana 123.0 150.0 181.0 77.0 163.0 91.0 12.0 Iowa 180.0 207.0 238.0 134.0 220.0 148.0 54.0 Kansas 121.0 148.0 179.0 75.0 161.0 89.0 11.0 Kentucky 127.0 154.0 185.0 81.0 167.0 95.0 25.0 Louisiana 13.0 22.3 45.0 59.0 27.0 45.0 139.0 Maine 153.0 180.0 211.0 107.0 193.0 121.0 27.0 Maryland 64.0 37.0 13.0 110.0 24.0 96.0 190.0 Massachusetts 87.0 114.0 145.0 41.0 127.0 55.0 39.0 Michigan 19.0 26.0 39.0 65.0 21.0 51.0 145.0 Minnesota 164.0 191.0 222.0 118.0 204.0 132.0 38.0 Mississippi 23.0 27.4 36.0 69.0 47.0 55.0 149.0 Missouri 58.0 85.0 116.0 20.0 98.0 26.0 68.0 Montana 127.0 154.0 185.0 81.0 167.0 95.0 24.0 Nebraska 134.0 161.0 192.0 88.0 174.0 102.0 15.0 Nevada 24.8 33.0 42.0 62.0 24.0 48.0 142.0 New Hampshire 179.0 206.0 237.0 133.0 219.0 147.0 53.0 New Jersey 77.0 104.0 135.0 39.0 117.0 45.0 49.0 New Mexico 49.0 22.0 10.0 95.0 21.0 81.0 175.0 New York 28.0 38.0 40.0 64.0 22.0 50.0 144.0 North Carolina 101.0 74.0 43.0 147.0 61.0 133.0 227.0 North Dakota 191.0 218.0 249.0 145.0 231.0 159.0 65.0 Ohio 116.0 143.0 174.0 70.0 156.0 84.0 10.3 Oklahoma 85.0 112.0 143.0 39.0 125.0 53.0 41.0 Oregon 77.0 104.0 135.0 31.0 117.0 45.0 49.0 Pennsylvania 130.0 157.0 188.0 84.0 170.0 98.0 5.0 Rhode Island 62.0 89.0 120.0 37.0 102.0 30.4 64.0 South Carolina 43.0 22.0 32.0 89.0 43.0 75.0 169.0 South Dakota 150.0 177.0 208.0 104.0 190.0 118.0 32.0 Tennessee 48.0 75.0 106.0 9.0 88.0 19.0 78.0 Texas 35.0 62.0 93.0 30.0 75.0 13.2 91.0 Utah 116.0 143.0 174.0 70.0 156.0 84.0 11.8 Vermont 188.0 215.0 246.0 142.0 228.0 156.0 62.0 Virginia 80.0 107.0 138.0 34.0 120.0 48.0 46.0 Washington 91.0 118.0 149.0 45.0 131.0 59.0 35.0 West Virginia 155.0 182.0 213.0 109.0 195.0 123.0 38.0 Wisconsin 183.0 210.0 241.0 137.0 223.0 151.0 57.0 Wyoming 75.0 102.0 133.0 29.0 115.0 43.0 51.0 Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida 97.0 Georgia 27.0 124.0 Hawaii 192.0 289.0 165.0 Idaho 118.0 215.0 91.0 74.0 Illinois 11.0 86.0 38.0 203.0 129.0 Indiana 125.0 222.0 98.0 67.0 11.0 136.0 Iowa 182.0 279.0 155.0 26.0 64.0 193.0 57.0 Kansas 123.0 220.0 96.0 69.0 12.0 134.0 3.0 59.0 Kentucky 129.0 226.0 102.0 63.0 11.0 140.0 13.0 53.0 Louisiana 11.0 86.0 38.0 203.0 129.0 17.0 136.0 193.0 Maine 155.0 252.0 128.0 37.0 37.0 166.0 30.0 27.0 Maryland 62.0 35.0 89.0 254.0 180.0 51.0 187.0 244.0 Massachusetts 89.0 186.0 62.0 103.0 31.0 100.0 36.0 93.0 Michigan 19.3 80.0 44.0 209.0 135.0 11.1 142.0 199.0 Minnesota 166.0 263.0 139.0 26.0 48.0 177.0 41.0 16.0 Mississippi 28.0 76.0 48.0 213.0 139.0 39.0 146.0 203.0 Missouri 60.0 157.0 33.0 132.0 58.0 71.0 65.0 122.0 Montana 129.0 226.0 102.0 63.0 11.0 140.0 12.0 53.0 Nebraska 136.0 233.0 109.0 56.0 18.0 147.0 11.0 46.0 Nevada 30.2 83.0 41.0 206.0 132.0 22.0 139.0 196.0 New Hampshire 181.0 278.0 154.0 27.0 63.0 192.0 56.0 1.8 New Jersey 79.0 176.0 52.0 113.0 39.0 90.0 46.0 103.0 New Mexico 47.0 50.0 74.0 239.0 165.0 36.0 172.0 229.0 New York 16.0 81.0 43.0 208.0 134.0 5.0 141.0 198.0 North Carolina 99.0 35.0 126.0 291.0 217.0 88.0 224.0 281.0 North Dakota 193.0 290.0 166.0 39.0 75.0 204.0 68.0 13.0 Ohio 118.0 215.0 91.0 74.0 21.0 129.0 10.0 64.0 Oklahoma 87.0 184.0 60.0 105.0 31.0 98.0 38.0 95.0 Oregon 79.0 176.0 52.0 113.0 39.0 90.0 46.0 103.0 Pennsylvania 132.0 229.0 105.0 60.0 18.0 143.0 7.0 50.0 Rhode Island 64.0 161.0 37.0 128.0 54.0 75.0 61.0 118.0 South Carolina 41.0 56.0 68.0 233.0 159.0 35.0 166.0 223.0 South Dakota 152.0 249.0 125.0 40.0 34.0 163.0 27.0 30.0 Tennessee 50.0 147.0 23.0 142.0 68.0 61.0 75.0 132.0 Texas 37.0 134.0 20.0 155.0 81.0 48.0 88.0 145.0 Utah 118.0 215.0 91.0 74.0 26.0 129.0 15.0 64.0 Vermont 190.0 287.0 163.0 51.0 72.0 201.0 65.0 25.0 Virginia 82.0 179.0 55.0 110.0 36.0 93.0 43.0 100.0 Washington 93.0 190.0 66.0 99.0 25.0 104.0 32.0 89.0 West Virginia 157.0 254.0 130.0 44.0 39.0 168.0 32.0 25.0 Wisconsin 185.0 282.0 158.0 17.0 67.0 196.0 60.0 9.0 Wyoming 77.0 174.0 50.0 115.0 41.0 88.0 48.0 105.0 Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 14.0 Louisiana 134.0 140.0 Maine 32.0 26.0 166.0 Maryland 185.0 191.0 51.0 217.0 Massachusetts 34.0 40.0 100.0 66.0 151.0 Michigan 140.0 146.0 12.9 172.0 45.0 106.0 Minnesota 43.0 37.0 177.0 15.0 228.0 77.0 183.0 Mississippi 144.0 150.0 22.0 176.0 41.0 110.0 30.0 Missouri 63.0 69.0 71.0 95.0 122.0 29.0 77.0 Montana 13.0 3.7 140.0 26.0 191.0 40.0 146.0 Nebraska 13.0 10.0 147.0 19.0 198.0 47.0 153.0 Nevada 137.0 143.0 23.8 169.0 48.0 103.0 10.9 New Hampshire 58.0 52.0 192.0 26.0 243.0 92.0 198.0 New Jersey 44.0 50.0 90.0 76.0 141.0 10.0 96.0 New Mexico 170.0 176.0 36.0 202.0 15.0 136.0 30.0 New York 139.0 145.0 20.0 171.0 46.0 105.0 12.0 North Carolina 222.0 228.0 88.0 254.0 37.0 188.0 82.0 North Dakota 70.0 64.0 204.0 38.0 255.0 104.0 210.0 Ohio 9.0 23.0 129.0 37.0 180.0 29.0 135.0 Oklahoma 36.0 42.0 98.0 68.0 149.0 17.0 104.0 Oregon 44.0 50.0 90.0 76.0 141.0 18.0 96.0 Pennsylvania 9.0 20.0 143.0 23.0 194.0 43.0 149.0 Rhode Island 59.0 65.0 75.0 91.0 126.0 25.0 81.0 South Carolina 164.0 170.0 30.0 196.0 21.0 130.0 26.0 South Dakota 29.0 23.0 163.0 6.0 214.0 63.0 169.0 Tennessee 73.0 79.0 61.0 105.0 112.0 39.0 67.0 Texas 86.0 92.0 48.0 118.0 99.0 52.0 54.0 Utah 14.0 28.0 129.0 37.0 180.0 29.0 135.0 Vermont 67.0 61.0 201.0 35.0 252.0 101.0 207.0 Virginia 41.0 47.0 93.0 73.0 144.0 22.0 99.0 Washington 30.0 36.0 104.0 62.0 155.0 12.0 110.0 West Virginia 34.0 28.0 168.0 12.0 219.0 68.0 174.0 Wisconsin 62.0 56.0 196.0 30.0 247.0 96.0 202.0 Wyoming 46.0 52.0 88.0 78.0 139.0 25.0 94.0 Minnesota Mississippi Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi 187.0 Missouri 106.0 81.0 Montana 37.0 150.0 69.0 Nebraska 30.0 157.0 76.0 9.0 Nevada 180.0 37.0 74.0 143.0 150.0 New Hampshire 15.0 202.0 121.0 52.0 45.0 195.0 New Jersey 87.0 100.0 19.0 50.0 57.0 93.0 New Mexico 213.0 26.0 107.0 176.0 183.0 33.0 New York 182.0 42.0 76.0 145.0 152.0 19.9 North Carolina 265.0 78.0 159.0 228.0 235.0 85.0 North Dakota 27.0 214.0 133.0 64.0 57.0 207.0 Ohio 48.0 139.0 58.0 22.0 18.0 132.0 Oklahoma 79.0 108.0 27.0 42.0 49.0 101.0 Oregon 87.0 100.0 19.0 50.0 57.0 93.0 Pennsylvania 34.0 153.0 72.0 19.0 10.0 146.0 Rhode Island 102.0 85.0 19.9 65.0 72.0 78.0 South Carolina 207.0 20.0 101.0 170.0 177.0 33.0 South Dakota 21.0 173.0 92.0 23.0 17.0 166.0 Tennessee 116.0 71.0 11.0 79.0 86.0 64.0 Texas 129.0 58.0 23.0 92.0 99.0 51.0 Utah 48.0 139.0 58.0 27.0 18.0 132.0 Vermont 34.0 211.0 130.0 61.0 54.0 204.0 Virginia 84.0 103.0 22.0 47.0 54.0 96.0 Washington 73.0 114.0 33.0 36.0 43.0 107.0 West Virginia 27.0 178.0 97.0 28.0 23.0 171.0 Wisconsin 19.0 206.0 125.0 56.0 49.0 199.0 Wyoming 89.0 98.0 17.0 52.0 59.0 91.0 New Hampshire New Jersey New Mexico New York North Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 102.0 New Mexico 228.0 126.0 New York 197.0 95.0 31.0 North Carolina 280.0 178.0 52.0 83.0 North Dakota 12.0 114.0 240.0 209.0 292.0 Ohio 63.0 39.0 165.0 134.0 217.0 Oklahoma 94.0 21.0 134.0 103.0 186.0 Oregon 102.0 22.0 126.0 95.0 178.0 Pennsylvania 49.0 53.0 179.0 148.0 231.0 Rhode Island 117.0 15.0 111.0 80.0 163.0 South Carolina 222.0 120.0 22.0 38.0 58.0 South Dakota 29.0 73.0 199.0 168.0 251.0 Tennessee 131.0 30.0 97.0 66.0 149.0 Texas 144.0 42.0 84.0 53.0 136.0 Utah 63.0 39.0 165.0 134.0 217.0 Vermont 24.0 111.0 237.0 206.0 289.0 Virginia 99.0 26.0 129.0 98.0 181.0 Washington 88.0 16.0 140.0 109.0 192.0 West Virginia 24.0 78.0 204.0 173.0 256.0 Wisconsin 10.0 106.0 232.0 201.0 284.0 Wyoming 104.0 29.0 124.0 93.0 176.0 North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio 75.0 Oklahoma 106.0 31.0 Oregon 114.0 39.0 9.3 Pennsylvania 61.0 14.0 45.0 53.0 Rhode Island 129.0 54.0 23.0 21.0 68.0 South Carolina 234.0 159.0 128.0 120.0 173.0 105.0 South Dakota 41.0 34.0 65.0 73.0 27.0 88.0 Tennessee 143.0 68.0 37.0 29.0 82.0 28.0 Texas 156.0 81.0 50.0 42.0 95.0 27.0 Utah 75.0 5.0 31.0 39.0 14.0 54.0 Vermont 12.0 72.0 103.0 111.0 58.0 126.0 Virginia 111.0 36.0 5.0 8.6 50.0 24.0 Washington 100.0 25.0 6.2 14.0 39.0 29.0 West Virginia 36.0 39.0 70.0 78.0 33.0 93.0 Wisconsin 22.0 67.0 98.0 106.0 53.0 121.0 Wyoming 116.0 41.0 10.0 13.7 55.0 27.0 South Carolina South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota 193.0 Tennessee 91.0 102.0 Texas 78.0 115.0 21.0 Utah 159.0 35.0 68.0 81.0 Vermont 231.0 38.0 140.0 153.0 72.0 Virginia 123.0 70.0 32.0 45.0 36.0 108.0 Washington 134.0 59.0 43.0 56.0 25.0 97.0 West Virginia 198.0 6.0 107.0 120.0 41.0 33.0 Wisconsin 226.0 33.0 135.0 148.0 67.0 34.0 Wyoming 118.0 75.0 27.0 40.0 41.0 113.0 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 11.0 West Virginia 75.0 64.0 Wisconsin 103.0 92.0 28.0 Wyoming 5.1 16.0 80.0 108.0 K-means clustering with 4 clusters of sizes 20, 14, 4, 12 Cluster means: Murder Assault UrbanPop Rape 1 4.270000 87.5500 59.75000 14.39000 2 8.214286 173.2857 70.64286 22.84286 3 11.950000 316.5000 68.00000 26.70000 4 11.766667 257.9167 68.41667 28.93333 Clustering vector: Alabama Alaska Arizona Arkansas California 4 4 3 2 4 Colorado Connecticut Delaware Florida Georgia 2 1 4 3 2 Hawaii Idaho Illinois Indiana Iowa 1 1 4 1 1 Kansas Kentucky Louisiana Maine Maryland 1 1 4 1 3 Massachusetts Michigan Minnesota Mississippi Missouri 2 4 1 4 2 Montana Nebraska Nevada New Hampshire New Jersey 1 1 4 1 2 New Mexico New York North Carolina North Dakota Ohio 4 4 3 1 1 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 2 2 1 2 4 South Dakota Tennessee Texas Utah Vermont 1 2 2 1 1 Virginia Washington West Virginia Wisconsin Wyoming 2 2 1 1 2 Within cluster sum of squares by cluster: [1] 1193.7025 150.9388 529.0000 444.5069 Available components: [1] "cluster" "centers" "withinss" "size" wardmaximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : maximum Number of objects: 50 singlemaximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : maximum Number of objects: 50 completemaximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : maximum Number of objects: 50 averagemaximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : maximum Number of objects: 50 mcquittymaximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : maximum Number of objects: 50 medianmaximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : maximum Number of objects: 50 centroidmaximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : maximum Number of objects: 50 centroid2maximum Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : maximum Number of objects: 50 Alabama Alaska Arizona Arkansas California Colorado Connecticut Alaska 63.5 Arizona 94.9 78.4 Arkansas 60.1 101.2 146.2 California 96.6 60.9 39.5 148.3 Colorado 74.8 96.9 99.9 62.1 88.0 Connecticut 165.0 222.1 211.7 120.9 215.2 127.2 Delaware 28.7 81.8 81.4 76.6 84.9 64.9 140.3 Florida 133.9 122.0 49.2 194.0 85.1 147.3 260.9 Georgia 35.8 90.1 117.5 45.9 119.2 47.4 146.8 Hawaii 223.9 281.0 264.6 181.2 262.1 184.1 81.1 Idaho 137.6 186.7 222.3 85.5 225.8 137.8 36.8 Illinois 43.6 69.9 57.3 98.1 53.0 67.2 165.0 Indiana 136.2 193.3 206.9 95.1 210.4 122.4 28.8 Iowa 201.9 257.0 286.6 155.8 290.1 202.1 75.3 Kansas 139.4 196.5 208.1 95.3 211.6 123.6 25.6 Kentucky 141.4 186.5 229.3 87.1 231.0 145.2 37.6 Louisiana 24.2 59.7 75.1 84.3 76.8 81.0 173.2 Maine 184.5 227.6 269.2 126.4 272.7 184.7 57.5 Maryland 81.5 74.0 25.4 137.8 63.1 121.3 224.7 Massachusetts 127.7 184.8 168.4 83.6 161.9 87.9 53.3 Michigan 50.0 45.5 53.1 107.9 46.6 62.8 180.8 Minnesota 188.8 245.9 257.5 144.7 261.0 173.0 53.4 Mississippi 44.0 41.5 92.9 84.7 94.6 118.8 200.8 Missouri 81.2 124.3 129.7 40.9 131.4 45.6 97.8 Montana 144.0 191.1 228.7 89.9 232.2 144.2 33.0 Nebraska 151.6 208.7 228.3 107.5 231.8 143.8 29.4 Nevada 64.8 47.7 62.1 122.9 42.6 62.6 189.8 New Hampshire 203.8 256.9 288.5 155.7 292.0 204.0 76.8 New Jersey 116.2 173.3 156.9 72.1 142.4 76.4 72.8 New Mexico 73.7 57.8 23.4 130.2 40.9 99.1 211.1 New York 53.0 66.5 53.9 108.9 43.6 73.8 175.8 North Carolina 119.3 108.4 97.8 159.6 135.5 193.7 273.7 North Dakota 231.3 268.4 316.0 171.2 319.5 231.5 104.3 Ohio 139.1 195.8 189.4 98.4 192.9 104.9 26.3 Oklahoma 102.8 159.9 167.5 59.7 171.0 83.0 62.2 Oregon 102.4 143.3 152.9 61.7 156.4 68.4 78.8 Pennsylvania 157.2 214.3 213.9 113.1 217.4 129.4 15.8 Rhode Island 113.7 170.8 154.4 69.6 143.9 73.9 76.9 South Carolina 55.5 42.4 61.8 99.6 69.5 127.7 220.5 South Dakota 180.8 217.9 265.5 120.7 269.0 181.0 58.2 Tennessee 54.7 106.8 136.2 22.8 137.9 52.1 121.7 Texas 61.8 115.7 103.1 50.9 104.8 23.0 117.8 Utah 149.7 203.4 187.0 109.0 190.5 106.5 24.9 Vermont 235.0 272.1 319.7 174.9 323.2 235.2 108.2 Virginia 90.2 147.3 165.7 48.5 168.4 81.6 74.8 Washington 120.2 167.3 164.9 79.5 168.4 80.4 54.8 West Virginia 193.4 230.5 278.1 133.3 281.6 193.6 71.2 Wisconsin 212.0 269.1 280.7 167.9 284.2 196.2 69.0 Wyoming 89.0 146.1 169.7 44.9 173.2 85.2 76.0 Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida 130.6 Georgia 60.5 152.1 Hawaii 208.0 313.8 205.7 Idaho 140.9 271.5 123.4 111.7 Illinois 34.7 101.9 69.8 211.9 175.6 Indiana 138.5 256.1 118.0 87.7 29.4 160.2 Iowa 205.2 335.8 187.7 48.0 70.3 239.9 79.7 Kansas 131.3 257.3 121.2 88.9 24.2 161.4 7.2 78.5 Kentucky 153.3 275.3 127.2 102.3 22.2 179.4 24.2 70.5 Louisiana 32.9 109.7 49.6 232.1 161.8 23.8 146.4 226.1 Maine 187.8 318.4 170.3 84.6 46.9 222.5 62.3 36.6 Maryland 84.4 56.2 104.1 283.6 215.3 71.7 199.9 279.6 Massachusetts 104.0 217.6 109.5 109.8 63.9 115.7 63.5 128.2 Michigan 44.5 92.5 72.6 239.7 185.4 27.8 170.0 249.7 Minnesota 176.1 306.7 170.6 50.9 60.8 210.8 52.6 29.1 Mississippi 60.5 127.5 74.0 265.9 165.4 61.6 179.8 235.7 Missouri 77.5 177.1 53.8 156.7 94.4 89.6 79.0 158.7 Montana 148.7 277.9 129.8 97.5 17.6 182.0 21.8 65.9 Nebraska 148.3 277.5 133.4 81.7 30.0 181.6 21.4 58.3 Nevada 59.5 101.3 87.4 240.7 200.4 28.8 185.0 264.7 New Hampshire 207.1 337.7 189.6 51.9 70.2 241.8 81.6 3.9 New Jersey 100.5 206.1 98.0 122.5 83.4 104.2 72.4 147.7 New Mexico 70.8 64.2 96.3 270.0 207.7 58.1 192.3 272.0 New York 45.5 97.1 75.6 222.7 186.4 10.8 171.0 250.7 North Carolina 133.4 55.2 155.1 340.8 238.3 136.5 254.7 308.6 North Dakota 234.6 365.2 217.1 57.4 93.7 269.3 109.1 29.4 Ohio 128.0 238.6 120.5 85.2 32.9 142.7 17.5 97.2 Oklahoma 95.9 216.7 84.6 121.5 54.8 120.8 42.6 119.1 Oregon 98.5 202.1 75.0 138.5 69.4 116.8 58.6 133.7 Pennsylvania 133.3 263.1 139.0 77.3 36.4 167.2 21.0 72.7 Rhode Island 89.0 203.6 95.5 145.8 93.7 101.7 99.5 152.2 South Carolina 80.2 98.4 86.3 279.4 185.1 70.5 191.7 255.4 South Dakota 184.1 314.7 166.6 86.9 45.6 218.8 58.6 45.1 Tennessee 81.4 175.2 29.3 180.6 96.3 90.7 92.9 160.6 Texas 61.5 143.1 35.0 170.7 128.4 54.8 113.0 192.7 Utah 135.8 236.2 128.1 81.8 35.3 140.3 27.9 99.6 Vermont 238.3 368.9 220.8 65.1 97.4 273.0 112.8 33.1 Virginia 98.5 214.1 72.0 133.7 57.4 118.2 46.6 121.7 Washington 106.3 214.1 92.8 116.3 57.4 122.6 48.4 121.7 West Virginia 196.7 327.3 179.2 90.3 62.0 231.4 71.2 48.5 Wisconsin 199.3 329.9 193.8 36.1 82.4 234.0 75.8 12.9 Wyoming 90.1 218.9 70.8 144.1 52.6 123.0 58.8 116.9 Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 25.4 Louisiana 147.6 165.6 Maine 61.1 43.1 208.7 Maryland 201.1 219.1 61.7 262.2 Massachusetts 56.3 78.3 135.9 110.8 187.4 Michigan 171.2 189.2 30.2 232.3 60.1 143.5 Minnesota 49.4 59.4 197.0 33.7 250.5 99.1 220.6 Mississippi 177.0 165.2 37.8 206.3 79.5 163.5 56.0 Missouri 80.2 99.6 87.4 141.3 127.7 60.5 91.0 Montana 20.6 4.8 168.2 40.5 221.7 73.7 191.8 Nebraska 20.2 22.6 167.8 40.9 221.3 70.3 191.4 Nevada 186.2 204.2 45.0 247.3 81.1 144.5 21.0 New Hampshire 80.4 70.4 228.0 32.7 281.5 130.1 251.6 New Jersey 69.2 91.8 124.4 130.3 175.9 19.5 132.0 New Mexico 193.5 211.5 53.9 254.6 22.4 173.8 37.7 New York 172.2 190.2 33.2 233.3 66.9 122.5 23.0 North Carolina 251.9 238.5 117.5 279.2 72.4 236.8 130.9 North Dakota 107.9 89.9 255.5 46.8 309.0 157.6 279.1 Ohio 18.7 41.5 146.9 79.8 198.4 47.0 154.5 Oklahoma 40.6 64.8 111.0 101.7 162.5 24.9 130.6 Oregon 57.4 82.8 108.6 116.3 148.9 41.5 116.0 Pennsylvania 18.4 27.8 165.4 55.3 216.9 59.3 177.0 Rhode Island 92.3 114.3 121.9 128.8 173.4 36.0 129.5 South Carolina 194.9 184.9 49.3 226.0 48.4 183.2 64.9 South Dakota 57.4 39.4 205.0 15.7 258.5 107.1 228.6 Tennessee 96.1 100.1 74.9 143.2 122.8 84.4 91.3 Texas 114.2 132.2 68.0 175.3 115.7 74.5 70.2 Utah 26.7 52.1 155.9 82.2 206.0 41.8 162.1 Vermont 111.6 93.6 259.2 57.5 312.7 161.3 282.8 Virginia 49.2 63.6 104.4 104.3 157.9 37.5 128.0 Washington 47.2 72.6 126.4 104.3 169.9 26.3 128.0 West Virginia 70.0 52.0 217.6 19.1 271.1 122.3 241.2 Wisconsin 72.6 82.6 220.2 48.5 273.7 122.3 243.8 Wyoming 55.2 63.6 109.2 99.5 162.7 40.1 132.8 Minnesota Mississippi Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi 224.6 Missouri 129.6 125.2 Montana 54.8 169.8 100.8 Nebraska 37.2 187.4 100.4 17.8 Nevada 235.6 76.8 106.0 206.8 206.4 New Hampshire 31.0 235.6 160.6 65.8 60.2 266.6 New Jersey 118.6 155.4 49.0 89.8 89.4 133.0 New Mexico 242.9 71.7 113.3 214.1 213.7 58.7 New York 221.6 61.0 96.2 192.8 192.4 28.0 North Carolina 297.5 83.1 200.1 243.3 261.1 151.7 North Dakota 58.5 239.1 188.1 87.3 87.7 294.1 Ohio 68.1 183.1 71.5 39.3 38.9 167.5 Oklahoma 90.0 144.4 39.6 61.2 60.8 145.6 Oregon 104.6 146.4 27.2 78.0 75.4 131.0 Pennsylvania 43.6 193.0 90.0 23.8 17.6 192.0 Rhode Island 130.3 149.5 46.5 109.7 106.1 130.5 South Carolina 244.3 31.1 134.1 189.5 207.1 85.7 South Dakota 38.2 190.6 137.6 36.8 37.2 243.6 Tennessee 145.5 98.7 26.5 102.7 108.3 106.1 Texas 163.6 105.8 39.4 134.8 134.4 73.0 Utah 70.5 193.7 79.1 47.3 43.5 165.1 Vermont 62.2 242.8 191.8 91.0 91.4 297.8 Virginia 98.6 133.2 37.0 63.8 63.4 143.0 Washington 92.6 164.2 43.0 67.8 64.0 143.0 West Virginia 44.6 201.2 150.2 49.4 52.6 256.2 Wisconsin 23.2 247.8 152.8 78.0 60.4 258.8 Wyoming 99.8 124.8 41.8 60.6 64.4 147.8 New Hampshire New Jersey New Mexico New York North Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 149.6 New Mexico 273.9 162.3 New York 252.6 109.0 53.3 North Carolina 308.5 230.3 94.6 135.9 North Dakota 27.5 177.1 301.4 280.1 314.0 Ohio 99.1 55.7 184.8 153.5 258.0 Oklahoma 121.0 31.0 152.9 131.6 219.3 Oregon 135.6 35.0 138.3 123.4 221.3 Pennsylvania 74.6 75.0 203.3 178.0 265.9 Rhode Island 150.5 31.5 159.8 106.5 222.4 South Carolina 255.3 171.7 40.6 69.9 68.8 South Dakota 45.0 126.6 250.9 229.6 263.5 Tennessee 162.5 72.9 115.0 95.9 174.0 Texas 194.6 63.0 101.9 61.2 180.7 Utah 101.5 56.3 192.4 151.1 268.6 Vermont 34.8 180.8 305.1 283.8 317.7 Virginia 123.6 32.0 150.3 129.0 208.1 Washington 123.6 40.8 156.3 129.2 239.1 West Virginia 44.8 139.2 263.5 242.2 276.1 Wisconsin 15.8 141.8 266.1 244.8 320.7 Wyoming 118.8 34.8 155.1 133.8 197.7 North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio 126.6 Oklahoma 148.5 40.1 Oregon 163.1 57.3 20.0 Pennsylvania 102.1 24.5 54.4 73.8 Rhode Island 175.6 83.0 56.9 57.5 92.5 South Carolina 266.8 194.2 158.3 155.3 212.7 169.2 South Dakota 50.5 76.1 98.0 112.6 51.6 134.9 Tennessee 190.0 95.4 59.5 47.7 113.9 70.4 Texas 222.1 95.5 73.6 66.6 120.0 60.5 Utah 129.0 10.6 49.3 60.1 33.1 75.8 Vermont 20.3 130.3 152.2 166.8 105.8 185.1 Virginia 151.1 49.9 12.6 19.2 67.0 59.5 Washington 151.1 35.1 19.8 24.0 53.6 61.5 West Virginia 47.9 88.7 110.6 126.8 64.2 144.3 Wisconsin 35.3 91.3 113.2 127.8 66.8 145.3 Wyoming 146.3 62.3 22.6 24.6 68.2 50.7 South Carolina South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota 216.3 Tennessee 107.6 139.5 Texas 114.7 171.6 35.9 Utah 202.6 79.7 103.0 93.1 Vermont 270.5 54.2 193.7 225.8 132.7 Virginia 145.7 100.6 46.9 71.0 60.5 154.8 Washington 173.1 100.6 66.9 72.4 36.1 154.8 West Virginia 228.9 16.4 152.1 184.2 96.1 45.4 Wisconsin 267.5 57.2 168.7 186.8 93.7 39.8 Wyoming 144.5 95.8 45.7 75.8 71.9 150.0 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 31.0 West Virginia 113.2 116.6 Wisconsin 121.8 115.8 59.6 Wyoming 14.8 42.4 108.4 123.0 K-means clustering with 4 clusters of sizes 10, 14, 16, 10 Cluster means: Murder Assault UrbanPop Rape 1 5.590000 112.4000 65.60000 17.27000 2 8.214286 173.2857 70.64286 22.84286 3 11.812500 272.5625 68.31250 28.37500 4 2.950000 62.7000 53.90000 11.51000 Clustering vector: Alabama Alaska Arizona Arkansas California 3 3 3 2 3 Colorado Connecticut Delaware Florida Georgia 2 1 3 3 2 Hawaii Idaho Illinois Indiana Iowa 4 1 3 1 4 Kansas Kentucky Louisiana Maine Maryland 1 1 3 4 3 Massachusetts Michigan Minnesota Mississippi Missouri 2 3 4 3 2 Montana Nebraska Nevada New Hampshire New Jersey 1 1 3 4 2 New Mexico New York North Carolina North Dakota Ohio 3 3 3 4 1 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 2 2 1 2 3 South Dakota Tennessee Texas Utah Vermont 4 2 2 1 4 Virginia Washington West Virginia Wisconsin Wyoming 2 2 4 4 2 Within cluster sum of squares by cluster: [1] 901.2004 997.6573 1239.9202 522.5796 Available components: [1] "cluster" "centers" "withinss" "size" wardmanhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : manhattan Number of objects: 50 singlemanhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : manhattan Number of objects: 50 completemanhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : manhattan Number of objects: 50 averagemanhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : manhattan Number of objects: 50 mcquittymanhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : manhattan Number of objects: 50 medianmanhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : manhattan Number of objects: 50 centroidmanhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : manhattan Number of objects: 50 centroid2manhattan Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : manhattan Number of objects: 50 Alabama Alaska Arizona Arkansas California Colorado Alaska 0.6410212 Arizona 0.6960303 0.5894356 Arkansas 0.4238243 0.6360109 0.7147882 California 0.8027066 0.4319313 0.2826162 0.8376470 Colorado 0.7631245 0.5514635 0.3163546 0.6380721 0.3159715 Connecticut 1.4175961 1.7466665 1.3682905 1.2083204 1.5473994 1.2707458 Delaware 0.6400566 0.9837154 0.6398239 0.5945722 0.8382644 0.6820341 Florida 0.6112300 0.7479212 0.3901296 1.0209321 0.5431856 0.6739066 Georgia 0.3080048 0.7568916 0.7634688 0.6105953 0.8798416 0.7227963 Hawaii 1.3022454 1.6522101 1.1677094 1.1241490 1.3545303 1.1741173 Idaho 1.2301832 1.5356772 1.5000198 0.9653977 1.6825878 1.4089773 Illinois 0.3847001 0.6133972 0.3528749 0.5692983 0.4265365 0.5014554 Indiana 0.7082031 1.0709480 0.7992969 0.5215972 1.0149827 0.7208154 Iowa 1.6440351 1.9689434 1.8864198 1.4763698 2.0640704 1.8371428 Kansas 0.8658781 1.2234291 0.9477855 0.6130219 1.1566659 0.8641002 Kentucky 0.7061665 0.9330227 1.0718482 0.4285450 1.1709917 1.0130598 Louisiana 0.1912848 0.7321697 0.6548152 0.6098029 0.7659530 0.7754955 Maine 1.7314032 1.9051476 1.9672292 1.4450927 2.1186022 1.8754212 Maryland 0.4036479 0.5229516 0.3179066 0.6696427 0.4940004 0.6073314 Massachusetts 1.0454519 1.4075992 0.9643990 0.8029220 1.1032630 0.8905777 Michigan 0.4502786 0.4416718 0.3700463 0.7832248 0.3621530 0.3962074 Minnesota 1.4318763 1.8011636 1.5532103 1.2524684 1.7469672 1.4961901 Mississippi 0.3897453 0.7296628 0.9731735 0.5762511 1.0700714 1.1262425 Missouri 0.5647362 0.6560251 0.4123583 0.3929013 0.5265264 0.3441563 Montana 0.9158206 1.1748956 1.1190176 0.5755694 1.3222165 1.0357634 Nebraska 1.0630229 1.4259864 1.2233238 0.8353575 1.4253100 1.1448749 Nevada 0.6066722 0.3928469 0.4799099 0.9433976 0.3168931 0.4242480 New Hampshire 1.7350630 2.0217138 1.9707838 1.5545718 2.1381330 1.9132066 New Jersey 0.7473745 1.1011440 0.6414089 0.4740973 0.7446410 0.5686019 New Mexico 0.4654734 0.4538871 0.2688741 0.7395656 0.3810435 0.4942657 New York 0.4211930 0.6137461 0.3512016 0.6691648 0.3916269 0.5208163 North Carolina 0.4468417 0.7546730 0.8967215 0.6197351 1.0516628 1.1705616 North Dakota 2.1904038 2.3212690 2.4638595 1.9694083 2.5997073 2.4159434 Ohio 0.7461620 1.0994808 0.6877021 0.5654289 0.9042968 0.6061944 Oklahoma 0.6614629 1.0276094 0.7201565 0.4224272 0.9311743 0.6260131 Oregon 0.8858963 0.9599068 0.6607948 0.7196156 0.8774878 0.5724393 Pennsylvania 1.0161707 1.3507846 0.9983941 0.7633955 1.2011242 0.9128349 Rhode Island 1.3788691 1.6706936 1.2846302 1.1595297 1.3612832 1.1789491 South Carolina 0.2510613 0.5382064 0.7150565 0.5229815 0.8323734 0.9495604 South Dakota 1.3920521 1.5419254 1.6042381 1.0336989 1.7899464 1.5285292 Tennessee 0.2402577 0.6535305 0.6812445 0.4473426 0.7951407 0.6105653 Texas 0.3508939 0.7739920 0.5063778 0.5736309 0.6205089 0.4586828 Utah 1.1335678 1.4589944 1.0041965 1.0034310 1.2124169 0.9518344 Vermont 1.9737884 2.1285082 2.1898795 1.6865092 2.3580889 2.1526881 Virginia 0.4739270 0.8366168 0.6488705 0.2605019 0.8128003 0.5793320 Washington 0.9937179 1.1832389 0.8079184 0.8429285 1.0211042 0.7225021 West Virginia 1.4718246 1.5606785 1.6249124 1.0937693 1.7979628 1.5391770 Wisconsin 1.6936202 2.0191565 1.7876872 1.5327054 1.9685379 1.7392802 Wyoming 0.6780399 1.0230186 0.8528853 0.4128464 1.0525363 0.7484873 Connecticut Delaware Florida Georgia Hawaii Idaho Alaska Arizona Arkansas California Colorado Connecticut Delaware 0.8587030 Florida 1.6555060 1.0054516 Georgia 1.5182627 0.8849896 0.5366582 Hawaii 0.9710494 0.9228177 1.4894259 1.4576413 Idaho 0.4602245 0.9140347 1.7616164 1.3575561 1.1736527 Illinois 1.3104562 0.5756588 0.5007874 0.5313910 1.0989492 1.4178168 Indiana 0.7777997 0.6477612 1.1678650 0.8596674 0.7144227 0.7850495 Iowa 0.6834835 1.3581685 2.1082901 1.7725112 0.9796265 0.5877222 Kansas 0.6265813 0.4654123 1.3025888 1.0073593 0.6622039 0.6346379 Kentucky 0.8804534 0.7922143 1.2718733 0.8999646 1.0362639 0.7129911 Louisiana 1.4445019 0.6804960 0.4224483 0.2662034 1.3373221 1.3804848 Maine 0.7398468 1.4675808 2.1912978 1.8367849 1.4009173 0.6081295 Maryland 1.5101102 0.7403957 0.3657883 0.4791434 1.3605498 1.4857182 Massachusetts 0.5326000 0.4739841 1.2938076 1.1666195 0.7397427 0.6568236 Michigan 1.5080369 0.7718007 0.3423155 0.5312686 1.4119210 1.5864436 Minnesota 0.5318681 0.9803711 1.8069874 1.5379417 0.8104301 0.3929229 Mississippi 1.5490811 0.7867829 0.7425317 0.4975770 1.5932301 1.2833723 Missouri 1.1822593 0.6481871 0.6965687 0.5243822 1.0982835 1.2055759 Montana 0.6722314 0.5507948 1.4721798 1.0906252 0.7928119 0.5246250 Nebraska 0.4728806 0.6531614 1.5415749 1.1881810 0.7281901 0.4713420 Nevada 1.6029836 0.9241344 0.4445514 0.6945018 1.4874841 1.7317266 New Hampshire 0.7751521 1.4625712 2.1867171 1.8554814 1.0937425 0.6788092 New Jersey 0.8951479 0.5040697 1.0187896 0.8953479 0.7873550 1.0039341 New Mexico 1.5277885 0.7621620 0.2996906 0.5432582 1.3998246 1.5516202 New York 1.3957116 0.6728337 0.4359300 0.4973883 1.1921732 1.5025835 North Carolina 1.5490406 0.7880089 0.6966499 0.7490246 1.5903788 1.2951179 North Dakota 1.5083599 2.0525175 2.5822661 2.2732840 1.5248715 1.4069283 Ohio 0.7509177 0.6066153 1.0586119 0.8881628 0.6839924 0.8397854 Oklahoma 0.8386641 0.4255402 1.0889690 0.8048834 0.7465515 0.8335185 Oregon 0.8972176 0.6268911 1.0044357 0.8197176 0.8809402 0.9010161 Pennsylvania 0.5107294 0.4458238 1.3545087 1.1583071 0.7029086 0.6445894 Rhode Island 0.4455830 0.8297000 1.5835852 1.4660508 1.2412823 0.8132716 South Carolina 1.6328517 0.8729576 0.5475564 0.4125492 1.4998918 1.3775955 South Dakota 0.5262963 1.0212950 1.9029087 1.5420296 0.9889829 0.4953095 Tennessee 1.4098874 0.8587596 0.5941070 0.2241752 1.3451292 1.2449155 Texas 1.2926554 0.7373723 0.4575837 0.3291231 1.1730201 1.3911318 Utah 0.4250300 0.8624063 1.2926750 1.1666503 0.7738919 0.5319795 Vermont 1.0097334 1.6761115 2.4081971 2.1037963 1.1647124 0.8858290 Virginia 1.0154971 0.5895906 0.9850739 0.6275608 0.9256498 0.9251358 Washington 0.6646377 0.6892546 1.1273205 0.9169982 0.8515225 0.7530968 West Virginia 0.8343206 1.0656658 1.9633741 1.6339057 1.0421015 0.9373248 Wisconsin 0.5589590 1.2554223 2.0279508 1.7959400 0.8297990 0.6232832 Wyoming 0.8273535 0.3611271 1.2242089 0.8188019 0.9688533 0.6923274 Illinois Indiana Iowa Kansas Kentucky Louisiana Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana 0.7457971 Iowa 1.8290682 1.2350764 Kansas 0.8933757 0.1842377 1.1102835 Kentucky 0.8465840 0.4030635 1.1784952 0.4306613 Louisiana 0.3468534 0.7739338 1.7813308 0.9118618 0.8900439 Maine 1.9122399 1.2804713 0.4563020 1.1666516 1.1418903 1.8682051 Maryland 0.3143966 0.8289019 1.8621074 0.9736341 0.9300045 0.3659730 Massachusetts 0.8596334 0.6381226 1.1653344 0.4580245 0.7718012 1.0858864 Michigan 0.3326024 0.9558407 1.9748811 1.0945717 1.0515526 0.4141785 Minnesota 1.4872153 0.8537171 0.4376161 0.7034818 0.9324519 1.4498248 Mississippi 0.7097492 1.0694701 1.7369455 1.0676813 0.7629561 0.3716783 Missouri 0.4038684 0.5178573 1.6587207 0.6652081 0.6928080 0.5770308 Montana 1.0680612 0.3336167 1.0051059 0.1825410 0.2482507 1.0898166 Nebraska 1.1637822 0.4469588 0.8432833 0.2996846 0.5127065 1.1607920 Nevada 0.4121149 1.1212772 2.1103058 1.2534972 1.2050478 0.5729445 New Hampshire 1.9185314 1.3292282 0.1274934 1.2097489 1.2579237 1.8700491 New Jersey 0.5455066 0.3939368 1.4890840 0.4351878 0.6547065 0.8027794 New Mexico 0.3426396 0.9040438 1.9296497 1.0461937 1.0012565 0.4284017 New York 0.1021661 0.8446640 1.9064017 0.9901918 0.9442656 0.3845288 North Carolina 0.7551642 1.0988001 1.7183686 1.1044792 0.7349230 0.5831358 North Dakota 2.3916533 1.9071392 0.9193442 1.8251308 1.7278927 2.3001969 Ohio 0.6326364 0.1178020 1.3457106 0.2691452 0.5055923 0.7886001 Oklahoma 0.6587763 0.2343643 1.3248925 0.2505143 0.5869842 0.7120581 Oregon 0.7861692 0.5393617 1.3833464 0.5079208 0.9264724 0.8832125 Pennsylvania 0.9532268 0.3196415 1.0446786 0.2028174 0.4326156 1.0624155 Rhode Island 1.1941489 1.1492181 1.0887238 0.9868242 1.2875998 1.4085954 South Carolina 0.5175421 0.9417280 1.8176866 1.0970142 0.8329589 0.2549814 South Dakota 1.5525787 0.8691910 0.6578220 0.7267888 0.7474256 1.5484944 Tennessee 0.4842207 0.7148475 1.6808877 0.8701424 0.7272651 0.3682342 Texas 0.2549417 0.7568592 1.8226531 0.8987449 0.8629197 0.3678249 Utah 0.9208643 0.5613868 1.0558860 0.5413192 0.9323995 1.1169189 Vermont 2.1346760 1.5801956 0.3622664 1.4542731 1.4423369 2.1030478 Virginia 0.5409705 0.2654731 1.4042332 0.4167286 0.4578636 0.5765534 Washington 0.8163311 0.5778858 1.2535189 0.5512647 0.9587319 0.9845926 West Virginia 1.6031136 0.9173661 0.9101071 0.7749346 0.8234033 1.6354732 Wisconsin 1.7424109 1.1592218 0.2066514 1.0143965 1.2445109 1.7055723 Wyoming 0.7968968 0.3912949 1.1804744 0.3482143 0.4617223 0.8242438 Maine Maryland Massachusetts Michigan Minnesota Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland 1.9505378 Massachusetts 1.2410260 1.1549854 Michigan 2.0334647 0.2809717 1.1639840 Minnesota 0.6369482 1.5368155 0.7585525 1.6559110 Mississippi 1.7310288 0.6940423 1.1821211 0.7486909 1.5464706 Missouri 1.7092978 0.3975713 0.7961585 0.4615310 1.3004580 Montana 0.9915008 1.1479363 0.5438271 1.2665766 0.7408973 Nebraska 0.9018225 1.2350940 0.3613054 1.3528816 0.4831906 Nevada 2.1480812 0.4664615 1.2275593 0.1895956 1.8058535 New Hampshire 0.3307092 1.9472869 1.2696877 2.0512933 0.5445578 New Jersey 1.5569067 0.8499044 0.3809184 0.8673461 1.1060840 New Mexico 2.0038493 0.1237304 1.1796225 0.1577634 1.6090291 New York 1.9845340 0.2476840 0.9297840 0.2671269 1.5717275 North Carolina 1.7363965 0.5909870 1.1949493 0.7891613 1.5318716 North Dakota 0.8519477 2.3981518 1.9275756 2.4858667 1.3159687 Ohio 1.3916871 0.8300445 0.5534485 0.8566120 0.9528931 Oklahoma 1.3895457 0.7635341 0.4197062 0.8665760 0.9346721 Oregon 1.4291576 0.7285210 0.4897397 0.7951210 0.9994077 Pennsylvania 1.1052002 1.1000024 0.4738719 1.1456584 0.6344895 Rhode Island 0.8823747 1.4732741 0.5424357 1.4483584 0.9511259 South Carolina 1.8023426 0.4274772 1.2736425 0.5636010 1.6350574 South Dakota 0.6111055 1.6169796 0.7692231 1.7268645 0.5228398 Tennessee 1.7361036 0.3870047 1.0416529 0.4397598 1.4496125 Texas 1.8846148 0.3875255 0.8843503 0.3399915 1.4801448 Utah 1.1030439 1.1722744 0.4643718 1.1910052 0.6422764 Vermont 0.6982944 2.1773884 1.4844697 2.2879011 0.7907420 Virginia 1.4671077 0.6343646 0.6083478 0.7539897 1.0724554 Washington 1.3020011 0.8979256 0.3701150 0.9300959 0.8557343 West Virginia 0.6947862 1.6670181 1.0687703 1.7682233 0.9045142 Wisconsin 0.6164667 1.7735493 1.0611702 1.8886573 0.3304010 Wyoming 1.2621764 0.8863613 0.4473528 0.9954778 0.8841231 Mississippi Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri 0.9413265 Montana 0.9783013 0.8432035 Nebraska 1.2010029 0.9471631 0.2795243 Nevada 0.9055110 0.6357763 1.4200954 1.5073838 New Hampshire 1.8141856 1.7436476 1.0886667 0.9468471 2.1775011 New Jersey 0.9951468 0.4734377 0.6127477 0.7273118 0.9379872 New Mexico 0.7516514 0.4134252 1.2189681 1.3066912 0.3461755 New York 0.7249804 0.4216417 1.1633400 1.2560390 0.3571085 North Carolina 0.2787581 0.9810850 0.9704952 1.2093461 0.9432542 North Dakota 2.0109122 2.2499498 1.6570400 1.6303956 2.5959716 Ohio 1.1150155 0.4705049 0.4499294 0.5638799 1.0095675 Oklahoma 0.9743697 0.4205303 0.4320256 0.5467293 1.0296804 Oregon 1.2427060 0.3923721 0.6864270 0.6018439 0.9695521 Pennsylvania 1.1668074 0.7526609 0.2382671 0.3334923 1.2962369 Rhode Island 1.5222879 1.1164623 1.0770701 0.8761831 1.4772064 South Carolina 0.2727543 0.7506425 1.0562263 1.2857928 0.7324339 South Dakota 1.2745884 1.3477359 0.5473588 0.4319931 1.8664644 Tennessee 0.6261711 0.3253764 0.9370589 1.0695479 0.6039702 Texas 0.7316482 0.3481389 1.0752543 1.1618966 0.4255876 Utah 1.4704710 0.8404256 0.7207847 0.5169449 1.2807340 Vermont 1.8132346 1.9863852 1.2874143 1.1935616 2.4164644 Virginia 0.8299440 0.3004455 0.5518821 0.6583306 0.9183484 Washington 1.3421932 0.5445263 0.7305094 0.5188814 1.1018805 West Virginia 1.3562891 1.3874108 0.6014480 0.7615466 1.8902948 Wisconsin 1.8079880 1.5684153 1.0561539 0.8025471 2.0228668 Wyoming 0.8391646 0.5539823 0.3420395 0.4939907 1.1469922 New Hampshire New Jersey New Mexico New York North Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 1.5863251 New Mexico 2.0099359 0.8773433 New York 1.9928184 0.6097506 0.2765041 North Carolina 1.7992376 1.0391029 0.6985166 0.7692220 North Dakota 0.8168753 2.1426605 2.4536370 2.4504940 2.0357602 Ohio 1.4392751 0.2966301 0.8611415 0.7320809 1.1469574 Oklahoma 1.4218709 0.2476351 0.8207446 0.7577624 1.0192512 Oregon 1.4719624 0.5625729 0.7500572 0.7994690 1.2985624 Pennsylvania 1.1469250 0.5016090 1.1259781 1.0487515 1.1380739 Rhode Island 1.0270561 0.8142329 1.4797598 1.2411726 1.5422022 South Carolina 1.8893419 0.9839320 0.4891822 0.5339722 0.3433119 South Dakota 0.7478257 1.1376194 1.6836235 1.6389299 1.2551865 Tennessee 1.7642930 0.7450725 0.4516516 0.4370423 0.6772213 Texas 1.9079692 0.5848442 0.4080314 0.2314829 0.7704228 Utah 1.1535302 0.6875871 1.2029906 1.0121870 1.5341331 Vermont 0.4638230 1.8023063 2.2434103 2.2083831 1.8094940 Virginia 1.4982468 0.2978601 0.7067863 0.6414245 0.8681090 Washington 1.3466890 0.6075081 0.9282806 0.8270547 1.4038108 West Virginia 0.8250372 1.1834743 1.7258387 1.6884228 1.3419596 Wisconsin 0.2887532 1.3986574 1.8408772 1.8213742 1.7810870 Wyoming 1.2826648 0.3361576 0.9536092 0.8942006 0.8251750 North Dakota Ohio Oklahoma Oregon Pennsylvania Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio 2.0088080 Oklahoma 2.0040873 0.2475183 Oregon 2.0864219 0.5486628 0.3696809 Pennsylvania 1.7623430 0.3349478 0.3730563 0.6867631 Rhode Island 1.6004356 1.0633110 0.9267774 0.9141487 0.9206486 South Carolina 2.1705044 0.9702543 0.9003403 1.0626921 1.2438636 South Dakota 1.2500188 0.9818258 0.9665444 1.0127485 0.6582729 Tennessee 2.2181787 0.7418587 0.6604656 0.6483337 1.0190757 Texas 2.3608285 0.6420146 0.6600678 0.7176269 0.9612962 Utah 1.8614243 0.4565943 0.6100101 0.5607022 0.6525345 Vermont 0.8676303 1.6801661 1.6596392 1.7169625 1.3853542 Virginia 2.0363373 0.3099677 0.1974814 0.4809498 0.5690764 Washington 2.0050248 0.5007289 0.4352134 0.2458892 0.6605152 West Virginia 1.2202833 1.0270331 1.0111106 1.1827574 0.7123921 Wisconsin 1.0044146 1.2550530 1.2288014 1.2755321 0.9520750 Wyoming 1.8688720 0.4492363 0.2330722 0.5288838 0.3580204 Rhode Island South Carolina South Dakota Tennessee Texas Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina 1.5996935 South Dakota 0.9254691 1.4182303 Tennessee 1.3492254 0.4302116 1.4149831 Texas 1.2004317 0.5377306 1.5516835 0.2305207 Utah 0.7238414 1.2936704 0.8136760 1.0619357 0.9035397 Vermont 1.3927561 1.9766734 0.7857466 2.0162828 2.1373730 Virginia 1.0707031 0.7172023 1.0738576 0.4726521 0.5469409 Washington 0.7783308 1.1638421 0.8619302 0.7832561 0.7420991 West Virginia 1.0552237 1.5013784 0.4597397 1.4848644 1.6160218 Wisconsin 0.9345179 1.8840866 0.6988450 1.7141078 1.7436570 Wyoming 0.8612521 0.9188859 0.8281113 0.6716496 0.7967944 Utah Vermont Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont 1.3854365 Virginia 0.7527661 1.7423182 Washington 0.3184121 1.5844590 0.5873451 West Virginia 1.2418268 0.8901264 1.1289329 1.2380713 Wisconsin 0.9456724 0.4979589 1.3618960 1.1433436 0.9142189 Wyoming 0.8383750 1.5203079 0.2917701 0.6628797 0.8837118 1.1809186 K-means clustering with 4 clusters of sizes 12, 9, 18, 11 Cluster means: Murder Assault UrbanPop Rape 1 2.791667 82.08333 56.16667 10.70833 2 14.077778 251.11111 58.55556 22.78889 3 6.255556 136.00000 68.61111 19.43333 4 10.600000 258.63636 76.45455 34.38182 Clustering vector: Alabama Alaska Arizona Arkansas California 2 4 4 3 4 Colorado Connecticut Delaware Florida Georgia 4 1 3 4 2 Hawaii Idaho Illinois Indiana Iowa 3 1 4 3 1 Kansas Kentucky Louisiana Maine Maryland 3 3 2 1 2 Massachusetts Michigan Minnesota Mississippi Missouri 3 4 1 2 4 Montana Nebraska Nevada New Hampshire New Jersey 3 3 4 1 3 New Mexico New York North Carolina North Dakota Ohio 4 4 2 1 3 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 3 3 3 1 2 South Dakota Tennessee Texas Utah Vermont 1 2 2 3 1 Virginia Washington West Virginia Wisconsin Wyoming 3 3 1 1 3 Within cluster sum of squares by cluster: [1] 0.11262798 0.13928224 0.09135594 0.05188101 Available components: [1] "cluster" "centers" "withinss" "size" wardcanberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : canberra Number of objects: 50 singlecanberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : canberra Number of objects: 50 completecanberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : canberra Number of objects: 50 averagecanberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : canberra Number of objects: 50 mcquittycanberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : canberra Number of objects: 50 mediancanberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : canberra Number of objects: 50 centroidcanberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : canberra Number of objects: 50 centroid2canberra Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : canberra Number of objects: 50 Alabama Alaska Arizona Arkansas California Colorado Connecticut Alaska 0 Arizona 0 0 Arkansas 0 0 0 California 0 0 0 0 Colorado 0 0 0 0 0 Connecticut 0 0 0 0 0 0 Delaware 0 0 0 0 0 0 0 Florida 0 0 0 0 0 0 0 Georgia 0 0 0 0 0 0 0 Hawaii 0 0 0 0 0 0 0 Idaho 0 0 0 0 0 0 0 Illinois 0 0 0 0 0 0 0 Indiana 0 0 0 0 0 0 0 Iowa 0 0 0 0 0 0 0 Kansas 0 0 0 0 0 0 0 Kentucky 0 0 0 0 0 0 0 Louisiana 0 0 0 0 0 0 0 Maine 0 0 0 0 0 0 0 Maryland 0 0 0 0 0 0 0 Massachusetts 0 0 0 0 0 0 0 Michigan 0 0 0 0 0 0 0 Minnesota 0 0 0 0 0 0 0 Mississippi 0 0 0 0 0 0 0 Missouri 0 0 0 0 0 0 0 Montana 0 0 0 0 0 0 0 Nebraska 0 0 0 0 0 0 0 Nevada 0 0 0 0 0 0 0 New Hampshire 0 0 0 0 0 0 0 New Jersey 0 0 0 0 0 0 0 New Mexico 0 0 0 0 0 0 0 New York 0 0 0 0 0 0 0 North Carolina 0 0 0 0 0 0 0 North Dakota 0 0 0 0 0 0 0 Ohio 0 0 0 0 0 0 0 Oklahoma 0 0 0 0 0 0 0 Oregon 0 0 0 0 0 0 0 Pennsylvania 0 0 0 0 0 0 0 Rhode Island 0 0 0 0 0 0 0 South Carolina 0 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 0 Texas 0 0 0 0 0 0 0 Utah 0 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 0 Washington 0 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 0 Wisconsin 0 0 0 0 0 0 0 Wyoming 0 0 0 0 0 0 0 Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida 0 Georgia 0 0 Hawaii 0 0 0 Idaho 0 0 0 0 Illinois 0 0 0 0 0 Indiana 0 0 0 0 0 0 Iowa 0 0 0 0 0 0 0 Kansas 0 0 0 0 0 0 0 0 Kentucky 0 0 0 0 0 0 0 0 Louisiana 0 0 0 0 0 0 0 0 Maine 0 0 0 0 0 0 0 0 Maryland 0 0 0 0 0 0 0 0 Massachusetts 0 0 0 0 0 0 0 0 Michigan 0 0 0 0 0 0 0 0 Minnesota 0 0 0 0 0 0 0 0 Mississippi 0 0 0 0 0 0 0 0 Missouri 0 0 0 0 0 0 0 0 Montana 0 0 0 0 0 0 0 0 Nebraska 0 0 0 0 0 0 0 0 Nevada 0 0 0 0 0 0 0 0 New Hampshire 0 0 0 0 0 0 0 0 New Jersey 0 0 0 0 0 0 0 0 New Mexico 0 0 0 0 0 0 0 0 New York 0 0 0 0 0 0 0 0 North Carolina 0 0 0 0 0 0 0 0 North Dakota 0 0 0 0 0 0 0 0 Ohio 0 0 0 0 0 0 0 0 Oklahoma 0 0 0 0 0 0 0 0 Oregon 0 0 0 0 0 0 0 0 Pennsylvania 0 0 0 0 0 0 0 0 Rhode Island 0 0 0 0 0 0 0 0 South Carolina 0 0 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 0 0 Texas 0 0 0 0 0 0 0 0 Utah 0 0 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 0 0 Washington 0 0 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 0 0 Wisconsin 0 0 0 0 0 0 0 0 Wyoming 0 0 0 0 0 0 0 0 Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 0 Louisiana 0 0 Maine 0 0 0 Maryland 0 0 0 0 Massachusetts 0 0 0 0 0 Michigan 0 0 0 0 0 0 Minnesota 0 0 0 0 0 0 0 Mississippi 0 0 0 0 0 0 0 Missouri 0 0 0 0 0 0 0 Montana 0 0 0 0 0 0 0 Nebraska 0 0 0 0 0 0 0 Nevada 0 0 0 0 0 0 0 New Hampshire 0 0 0 0 0 0 0 New Jersey 0 0 0 0 0 0 0 New Mexico 0 0 0 0 0 0 0 New York 0 0 0 0 0 0 0 North Carolina 0 0 0 0 0 0 0 North Dakota 0 0 0 0 0 0 0 Ohio 0 0 0 0 0 0 0 Oklahoma 0 0 0 0 0 0 0 Oregon 0 0 0 0 0 0 0 Pennsylvania 0 0 0 0 0 0 0 Rhode Island 0 0 0 0 0 0 0 South Carolina 0 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 0 Texas 0 0 0 0 0 0 0 Utah 0 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 0 Washington 0 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 0 Wisconsin 0 0 0 0 0 0 0 Wyoming 0 0 0 0 0 0 0 Minnesota Mississippi Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi 0 Missouri 0 0 Montana 0 0 0 Nebraska 0 0 0 0 Nevada 0 0 0 0 0 New Hampshire 0 0 0 0 0 0 New Jersey 0 0 0 0 0 0 New Mexico 0 0 0 0 0 0 New York 0 0 0 0 0 0 North Carolina 0 0 0 0 0 0 North Dakota 0 0 0 0 0 0 Ohio 0 0 0 0 0 0 Oklahoma 0 0 0 0 0 0 Oregon 0 0 0 0 0 0 Pennsylvania 0 0 0 0 0 0 Rhode Island 0 0 0 0 0 0 South Carolina 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 Texas 0 0 0 0 0 0 Utah 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 Washington 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 Wisconsin 0 0 0 0 0 0 Wyoming 0 0 0 0 0 0 New Hampshire New Jersey New Mexico New York North Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 0 New Mexico 0 0 New York 0 0 0 North Carolina 0 0 0 0 North Dakota 0 0 0 0 0 Ohio 0 0 0 0 0 Oklahoma 0 0 0 0 0 Oregon 0 0 0 0 0 Pennsylvania 0 0 0 0 0 Rhode Island 0 0 0 0 0 South Carolina 0 0 0 0 0 South Dakota 0 0 0 0 0 Tennessee 0 0 0 0 0 Texas 0 0 0 0 0 Utah 0 0 0 0 0 Vermont 0 0 0 0 0 Virginia 0 0 0 0 0 Washington 0 0 0 0 0 West Virginia 0 0 0 0 0 Wisconsin 0 0 0 0 0 Wyoming 0 0 0 0 0 North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio 0 Oklahoma 0 0 Oregon 0 0 0 Pennsylvania 0 0 0 0 Rhode Island 0 0 0 0 0 South Carolina 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 Texas 0 0 0 0 0 0 Utah 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 Washington 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 Wisconsin 0 0 0 0 0 0 Wyoming 0 0 0 0 0 0 South Carolina South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota 0 Tennessee 0 0 Texas 0 0 0 Utah 0 0 0 0 Vermont 0 0 0 0 0 Virginia 0 0 0 0 0 0 Washington 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 Wisconsin 0 0 0 0 0 0 Wyoming 0 0 0 0 0 0 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 0 West Virginia 0 0 Wisconsin 0 0 0 Wyoming 0 0 0 0 K-means clustering with 4 clusters of sizes 50, 0, 0, 0 Cluster means: Murder Assault UrbanPop Rape 1 7.788 170.76 65.54 21.232 2 NaN NaN NaN NaN 3 NaN NaN NaN NaN 4 NaN NaN NaN NaN Clustering vector: Alabama Alaska Arizona Arkansas California 1 1 1 1 1 Colorado Connecticut Delaware Florida Georgia 1 1 1 1 1 Hawaii Idaho Illinois Indiana Iowa 1 1 1 1 1 Kansas Kentucky Louisiana Maine Maryland 1 1 1 1 1 Massachusetts Michigan Minnesota Mississippi Missouri 1 1 1 1 1 Montana Nebraska Nevada New Hampshire New Jersey 1 1 1 1 1 New Mexico New York North Carolina North Dakota Ohio 1 1 1 1 1 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 1 1 1 1 1 South Dakota Tennessee Texas Utah Vermont 1 1 1 1 1 Virginia Washington West Virginia Wisconsin Wyoming 1 1 1 1 1 Within cluster sum of squares by cluster: [1] 0 0 0 0 Available components: [1] "cluster" "centers" "withinss" "size" wardbinary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : binary Number of objects: 50 singlebinary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : binary Number of objects: 50 completebinary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : binary Number of objects: 50 averagebinary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : binary Number of objects: 50 mcquittybinary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : binary Number of objects: 50 medianbinary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : binary Number of objects: 50 centroidbinary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : binary Number of objects: 50 centroid2binary Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : binary Number of objects: 50 Alabama Alaska Arizona Arkansas California Alaska 4.967609e-03 Arizona 7.860089e-04 5.622967e-03 Arkansas 2.480350e-04 5.092370e-03 2.013352e-04 California 4.567700e-03 9.632533e-03 2.080549e-03 2.730268e-03 Colorado 1.160541e-02 1.655015e-02 7.617445e-03 8.642576e-03 1.742772e-03 Connecticut 6.742317e-02 9.296038e-02 5.858196e-02 6.154513e-02 4.341992e-02 Delaware 2.120614e-03 1.152689e-02 1.114363e-03 1.504542e-03 3.161308e-03 Florida 8.133686e-05 4.081315e-03 6.870513e-04 2.810234e-04 4.650542e-03 Georgia 1.391515e-03 6.554862e-03 1.546865e-03 9.358075e-04 2.226189e-03 Hawaii 3.188827e-01 3.536003e-01 3.001641e-01 3.058034e-01 2.597179e-01 Idaho 1.710962e-02 3.042756e-02 1.222800e-02 1.385416e-02 5.904912e-03 Illinois 3.342110e-03 1.248383e-02 1.691925e-03 2.095278e-03 1.175956e-03 Indiana 4.110010e-02 5.627745e-02 3.412146e-02 3.601888e-02 2.064139e-02 Iowa 1.486720e-01 1.783990e-01 1.350998e-01 1.394689e-01 1.088196e-01 Kansas 3.954576e-02 5.650297e-02 3.264991e-02 3.466314e-02 2.013683e-02 Kentucky 2.183410e-02 3.527083e-02 1.771576e-02 1.849547e-02 9.031711e-03 Louisiana 1.776390e-04 6.389860e-03 6.862038e-04 1.970560e-04 3.543434e-03 Maine 4.780901e-02 7.037322e-02 4.030847e-02 4.285832e-02 2.831878e-02 Maryland 3.812263e-04 3.542378e-03 1.158916e-03 7.688422e-04 5.998311e-03 Massachusetts 3.829269e-02 5.799896e-02 3.146718e-02 3.372154e-02 2.060844e-02 Michigan 1.869783e-03 5.660296e-03 7.637758e-04 8.377736e-04 7.689734e-04 Minnesota 1.232162e-01 1.496674e-01 1.106210e-01 1.146434e-01 8.648955e-02 Mississippi 2.884033e-03 5.343614e-03 5.955353e-03 4.633688e-03 1.428097e-02 Missouri 1.055828e-02 1.852245e-02 7.044989e-03 7.882921e-03 1.698581e-03 Montana 2.309511e-02 3.642118e-02 1.794453e-02 1.933791e-02 8.973248e-03 Nebraska 4.693663e-02 6.489041e-02 3.916396e-02 4.154519e-02 2.530403e-02 Nevada 6.041776e-03 8.308041e-03 3.677108e-03 4.077286e-03 6.878144e-04 New Hampshire 1.391441e-01 1.698682e-01 1.261941e-01 1.304193e-01 1.015213e-01 New Jersey 3.585618e-02 5.472607e-02 2.952516e-02 3.146386e-02 1.873788e-02 New Mexico 3.595312e-04 3.347464e-03 4.068709e-04 2.018328e-04 3.438835e-03 New York 3.744944e-03 1.273269e-02 1.944963e-03 2.369745e-03 9.582330e-04 North Carolina 6.723075e-03 8.023246e-03 1.028662e-02 9.039475e-03 2.120049e-02 North Dakota 1.384077e-01 1.690331e-01 1.251704e-01 1.296179e-01 1.007616e-01 Ohio 5.111893e-02 6.895500e-02 4.331588e-02 4.554174e-02 2.831352e-02 Oklahoma 1.697825e-02 2.964050e-02 1.246624e-02 1.376280e-02 5.584235e-03 Oregon 1.581117e-02 2.309657e-02 1.090322e-02 1.232159e-02 3.580442e-03 Pennsylvania 6.219557e-02 8.474290e-02 5.390715e-02 5.639318e-02 3.818388e-02 Rhode Island 2.618377e-02 4.685592e-02 2.116969e-02 2.301108e-02 1.510500e-02 South Carolina 2.503299e-03 3.802228e-03 5.029613e-03 3.949550e-03 1.275627e-02 South Dakota 2.958899e-02 4.463975e-02 2.349699e-02 2.530384e-02 1.315610e-02 Tennessee 3.212135e-03 8.290276e-03 2.105188e-03 1.984214e-03 7.404146e-04 Texas 9.816236e-03 2.050470e-02 6.933171e-03 7.524554e-03 2.394185e-03 Utah 6.154161e-02 7.983365e-02 5.215179e-02 5.514731e-02 3.549792e-02 Vermont 6.377570e-02 7.953585e-02 5.437871e-02 5.715906e-02 3.647957e-02 Virginia 1.067416e-02 2.111223e-02 7.372475e-03 8.164218e-03 2.416336e-03 Washington 2.793788e-02 3.957629e-02 2.142554e-02 2.343360e-02 1.091309e-02 West Virginia 2.139991e-02 3.723317e-02 1.716281e-02 1.820022e-02 9.481238e-03 Wisconsin 2.041241e-01 2.392690e-01 1.887790e-01 1.937297e-01 1.582904e-01 Wyoming 6.736718e-03 1.795410e-02 4.242138e-03 4.931862e-03 1.921136e-03 Colorado Connecticut Delaware Florida Georgia Alaska Arizona Arkansas California Colorado Connecticut 3.377147e-02 Delaware 8.825452e-03 4.969521e-02 Florida 1.183787e-02 6.959729e-02 2.381262e-03 Georgia 6.400773e-03 5.646812e-02 3.079057e-03 1.781186e-03 Hawaii 2.264679e-01 1.070889e-01 2.866504e-01 3.229940e-01 2.893300e-01 Idaho 4.053591e-03 1.775091e-02 9.228616e-03 1.792734e-02 1.222725e-02 Illinois 4.468362e-03 4.125628e-02 8.969001e-04 3.786038e-03 2.085318e-03 Indiana 1.220102e-02 7.288989e-03 3.060119e-02 4.258524e-02 3.033231e-02 Iowa 8.892154e-02 1.824423e-02 1.240853e-01 1.516076e-01 1.297648e-01 Kansas 1.266000e-02 5.545648e-03 2.816555e-02 4.107094e-02 2.975414e-02 Kentucky 4.910030e-03 1.630316e-02 1.531276e-02 2.321619e-02 1.392955e-02 Louisiana 9.773184e-03 6.124514e-02 1.490332e-03 4.342680e-04 8.227891e-04 Maine 2.152527e-02 1.779277e-03 3.284746e-02 4.960260e-02 3.911045e-02 Maryland 1.396641e-02 7.493911e-02 3.161038e-03 1.403165e-04 2.860952e-03 Massachusetts 1.477010e-02 4.296360e-03 2.544141e-02 3.984055e-02 3.022187e-02 Michigan 4.345148e-03 5.410369e-02 2.600266e-03 1.897786e-03 6.768634e-04 Minnesota 6.852078e-02 1.083950e-02 1.012398e-01 1.257980e-01 1.057427e-01 Mississippi 2.533743e-02 9.637848e-02 8.515000e-03 2.676871e-03 7.330439e-03 Missouri 5.228255e-04 2.958266e-02 6.918201e-03 1.111266e-02 5.602427e-03 Montana 4.639590e-03 1.395732e-02 1.526605e-02 2.423375e-02 1.564720e-02 Nebraska 1.662893e-02 3.621333e-03 3.409253e-02 4.851707e-02 3.640661e-02 Nevada 1.475644e-03 4.794007e-02 6.265525e-03 6.038652e-03 2.619189e-03 New Hampshire 8.315376e-02 1.420976e-02 1.147020e-01 1.420982e-01 1.214604e-01 New Jersey 1.291630e-02 5.322189e-03 2.406833e-02 3.744993e-02 2.748016e-02 New Mexico 9.755101e-03 6.737898e-02 2.532245e-03 1.752156e-04 1.477890e-03 New York 3.812925e-03 4.000477e-02 1.246136e-03 4.204578e-03 2.103147e-03 North Carolina 3.459825e-02 1.121645e-01 1.311779e-02 6.159558e-03 1.351158e-02 North Dakota 8.265855e-02 1.380171e-02 1.135800e-01 1.412370e-01 1.212085e-01 Ohio 1.855278e-02 3.967674e-03 3.846424e-02 5.284976e-02 3.942084e-02 Oklahoma 3.165450e-03 1.816358e-02 1.000268e-02 1.791818e-02 1.122908e-02 Oregon 6.020258e-04 2.564192e-02 1.090611e-02 1.622390e-02 9.807218e-03 Pennsylvania 2.789524e-02 9.460599e-04 4.674116e-02 6.432989e-02 5.019145e-02 Rhode Island 1.371363e-02 1.156309e-02 1.458254e-02 2.759350e-02 2.179847e-02 South Carolina 2.324954e-02 9.497221e-02 8.041860e-03 2.134047e-03 6.703334e-03 South Dakota 7.633744e-03 9.439947e-03 1.987309e-02 3.083485e-02 2.143524e-02 Tennessee 3.071643e-03 4.822749e-02 3.560533e-03 3.559212e-03 6.063282e-04 Texas 2.026340e-03 2.762490e-02 5.618150e-03 1.066611e-02 5.283880e-03 Utah 2.427031e-02 3.066053e-03 4.675147e-02 6.313413e-02 4.930443e-02 Vermont 2.399626e-02 6.294980e-03 5.036754e-02 6.532154e-02 5.020541e-02 Virginia 1.673152e-03 2.644005e-02 6.091605e-03 1.145122e-02 6.009543e-03 Washington 5.150540e-03 1.322498e-02 1.929169e-02 2.878793e-02 1.985784e-02 West Virginia 6.385351e-03 1.390292e-02 1.342271e-02 2.281872e-02 1.466805e-02 Wisconsin 1.345532e-01 4.043128e-02 1.750632e-01 2.077000e-01 1.823023e-01 Wyoming 3.633080e-03 3.195394e-02 2.457132e-03 7.409965e-03 4.245507e-03 Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho 1.990339e-01 Illinois 2.632279e-01 5.379931e-03 Indiana 1.395904e-01 6.780108e-03 2.205761e-02 Iowa 3.790881e-02 6.765109e-02 1.091989e-01 3.649218e-02 Kansas 1.422491e-01 5.429697e-03 2.046115e-02 3.536739e-04 3.651597e-02 Kentucky 1.824912e-01 2.384704e-03 9.191764e-03 3.512341e-03 6.036584e-02 Louisiana 3.061521e-01 1.425023e-02 2.156095e-03 3.640891e-02 1.396239e-01 Maine 1.345890e-01 8.502788e-03 2.616564e-02 4.135216e-03 3.089306e-02 Maryland 3.341347e-01 2.063327e-02 5.154260e-03 4.705334e-02 1.594608e-01 Massachusetts 1.484765e-01 4.612896e-03 1.919355e-02 2.531912e-03 3.827980e-02 Michigan 2.842661e-01 1.030050e-02 1.585992e-03 2.832407e-02 1.258096e-01 Minnesota 5.190890e-02 5.057820e-02 8.742325e-02 2.387198e-02 1.396741e-03 Mississippi 3.758154e-01 3.366979e-02 1.222557e-02 6.527868e-02 1.903349e-01 Missouri 2.228378e-01 2.255749e-03 2.922317e-03 1.067290e-02 8.504083e-02 Montana 1.783628e-01 1.229998e-03 9.398351e-03 2.682485e-03 5.688266e-02 Nebraska 1.298921e-01 8.046272e-03 2.577290e-02 7.111509e-04 3.003748e-02 Nevada 2.610996e-01 8.526555e-03 3.337257e-03 2.163609e-02 1.122135e-01 New Hampshire 4.454854e-02 6.115992e-02 1.008649e-01 3.279011e-02 3.996903e-04 New Jersey 1.512033e-01 4.000657e-03 1.759539e-02 1.781567e-03 4.018798e-02 New Mexico 3.162270e-01 1.649036e-02 3.390973e-03 3.986052e-02 1.473085e-01 New York 2.592807e-01 4.874900e-03 2.952338e-05 2.072973e-02 1.067809e-01 North Carolina 4.068527e-01 4.344118e-02 1.864912e-02 8.003902e-02 2.127797e-01 North Dakota 4.597274e-02 6.035991e-02 1.000883e-01 3.281848e-02 6.178798e-04 Ohio 1.226853e-01 1.042597e-02 2.922931e-02 7.042915e-04 2.733879e-02 Oklahoma 1.967677e-01 2.785864e-04 5.488156e-03 5.666937e-03 6.712479e-02 Oregon 2.068449e-01 2.159756e-03 5.936724e-03 7.749894e-03 7.566239e-02 Pennsylvania 1.086320e-01 1.531765e-02 3.741609e-02 3.704219e-03 1.964363e-02 Rhode Island 1.855875e-01 2.930137e-03 1.140893e-02 9.195867e-03 5.837039e-02 South Carolina 3.720937e-01 3.225303e-02 1.146206e-02 6.328007e-02 1.877693e-01 South Dakota 1.628358e-01 2.188727e-03 1.343895e-02 1.309117e-03 4.750048e-02 Tennessee 2.688943e-01 8.405424e-03 1.500294e-03 2.340434e-02 1.159836e-01 Texas 2.232540e-01 1.749563e-03 2.122004e-03 1.090795e-02 8.422572e-02 Utah 1.094127e-01 1.460484e-02 3.696765e-02 2.652077e-03 2.087052e-02 Vermont 1.071266e-01 1.697075e-02 3.944358e-02 2.763198e-03 2.194224e-02 Virginia 2.196922e-01 1.325822e-03 2.443023e-03 1.001784e-02 8.190813e-02 Washington 1.691312e-01 2.319038e-03 1.273583e-02 1.957986e-03 5.222325e-02 West Virginia 1.838983e-01 1.279017e-03 8.299956e-03 4.260338e-03 5.940804e-02 Wisconsin 1.775521e-02 1.077217e-01 1.579718e-01 6.775400e-02 4.996375e-03 Wyoming 2.407667e-01 2.500536e-03 6.058434e-04 1.586757e-02 9.409729e-02 Kansas Kentucky Louisiana Maine Maryland Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 3.413933e-03 Louisiana 3.487880e-02 1.830562e-02 Maine 2.226830e-03 8.655423e-03 4.266149e-02 Maryland 4.541269e-02 2.675133e-02 1.038220e-03 5.408989e-02 Massachusetts 9.956716e-04 4.865874e-03 3.370842e-02 6.438740e-04 4.392895e-02 Michigan 2.777555e-02 1.351101e-02 1.401455e-03 3.698091e-02 2.822822e-03 Minnesota 2.406496e-02 4.419312e-02 1.150082e-01 2.047182e-02 1.330018e-01 Mississippi 6.327660e-02 4.001617e-02 4.303244e-03 7.270274e-02 1.928025e-03 Missouri 1.052265e-02 3.037660e-03 8.460674e-03 1.778571e-02 1.340894e-02 Montana 2.302693e-03 4.895824e-04 1.959521e-02 6.638864e-03 2.764161e-02 Nebraska 3.546244e-04 5.949783e-03 4.188951e-02 1.761155e-03 5.314286e-02 Nevada 2.209639e-02 1.002857e-02 5.111071e-03 3.263397e-02 7.459683e-03 New Hampshire 3.222060e-02 5.491178e-02 1.303266e-01 2.580944e-02 1.496944e-01 New Jersey 5.811392e-04 3.335912e-03 3.134672e-02 1.260340e-03 4.155323e-02 New Mexico 3.869731e-02 2.155498e-02 6.462751e-04 4.779557e-02 3.980691e-04 New York 1.929494e-02 8.326915e-03 2.472009e-03 2.521353e-02 5.666730e-03 North Carolina 7.739899e-02 5.232682e-02 8.886308e-03 8.640939e-02 4.674613e-03 North Dakota 3.204353e-02 5.504202e-02 1.296923e-01 2.522191e-02 1.486951e-01 Ohio 8.238368e-04 6.804647e-03 4.580278e-02 2.921600e-03 5.778454e-02 Oklahoma 4.823358e-03 1.129667e-03 1.402529e-02 9.042964e-03 2.080693e-02 Oregon 7.970968e-03 2.944936e-03 1.341761e-02 1.526616e-02 1.876051e-02 Pennsylvania 2.999750e-03 1.186837e-02 5.618361e-02 2.046267e-03 6.972031e-02 Rhode Island 6.251557e-03 6.259821e-03 2.253085e-02 4.496060e-03 3.074261e-02 South Carolina 6.152750e-02 3.880133e-02 3.955962e-03 7.142648e-02 1.364500e-03 South Dakota 7.686940e-04 1.498021e-03 2.562240e-02 3.802734e-03 3.457605e-02 Tennessee 2.316600e-02 9.784909e-03 2.248668e-03 3.242961e-02 4.971783e-03 Texas 1.015444e-02 2.520034e-03 7.544954e-03 1.598629e-02 1.305795e-02 Utah 2.707971e-03 1.186301e-02 5.589336e-02 3.679958e-03 6.825945e-02 Vermont 3.816868e-03 1.240839e-02 5.811625e-02 7.040948e-03 7.061069e-02 Virginia 9.313147e-03 2.338698e-03 8.363567e-03 1.508274e-02 1.386188e-02 Washington 1.980724e-03 2.071718e-03 2.436757e-02 6.725629e-03 3.224266e-02 West Virginia 3.237584e-03 6.219254e-04 1.784873e-02 6.297237e-03 2.622348e-02 Wisconsin 6.769391e-02 9.834424e-02 1.935374e-01 5.877712e-02 2.167730e-01 Wyoming 1.426223e-02 5.587461e-03 4.924904e-03 1.886974e-02 9.284010e-03 Massachusetts Michigan Minnesota Mississippi Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan 2.818108e-02 Minnesota 2.607022e-02 1.018751e-01 Mississippi 6.121851e-02 8.747300e-03 1.618569e-01 Missouri 1.169438e-02 4.273322e-03 6.532167e-02 2.429867e-02 Montana 3.199379e-03 1.416577e-02 4.104298e-02 4.205291e-02 Nebraska 1.337927e-03 3.396043e-02 1.882172e-02 7.250118e-02 Nevada 2.417700e-02 1.221263e-03 8.930168e-02 1.579986e-02 New Hampshire 3.300724e-02 1.178555e-01 1.133603e-03 1.793715e-01 New Jersey 1.754158e-04 2.586282e-02 2.749825e-02 5.826636e-02 New Mexico 3.802577e-02 1.124533e-03 1.216468e-01 3.819819e-03 New York 1.830225e-02 1.553165e-03 8.517784e-02 1.307679e-02 North Carolina 7.417065e-02 1.460829e-02 1.829054e-01 1.045676e-03 North Dakota 3.244719e-02 1.172037e-01 1.261615e-03 1.785445e-01 Ohio 2.645466e-03 3.724617e-02 1.663616e-02 7.763387e-02 Oklahoma 4.900833e-03 9.786064e-03 4.996134e-02 3.366424e-02 Oregon 9.707501e-03 7.423041e-03 5.691647e-02 3.182351e-02 Pennsylvania 3.511587e-03 4.823849e-02 1.119332e-02 9.065306e-02 Rhode Island 2.879695e-03 2.051664e-02 4.393374e-02 4.428832e-02 South Carolina 5.984211e-02 7.554648e-03 1.592415e-01 1.585223e-04 South Dakota 1.400063e-03 1.950739e-02 3.314123e-02 5.061274e-02 Tennessee 2.417756e-02 4.618749e-04 9.304374e-02 1.156865e-02 Texas 1.039273e-02 4.738986e-03 6.495496e-02 2.316826e-02 Utah 4.350079e-03 4.590636e-02 1.157226e-02 9.039427e-02 Vermont 7.131098e-03 4.684986e-02 1.232939e-02 9.309277e-02 Virginia 9.608078e-03 5.093389e-03 6.282774e-02 2.454924e-02 Washington 3.457651e-03 1.711751e-02 3.683217e-02 4.853774e-02 West Virginia 3.134844e-03 1.412087e-02 4.367142e-02 3.935344e-02 Wisconsin 6.938415e-02 1.782120e-01 1.164013e-02 2.513628e-01 Wyoming 1.302329e-02 3.568996e-03 7.398726e-02 1.810847e-02 Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana 3.039731e-03 Nebraska 1.444884e-02 4.381148e-03 Nevada 2.301358e-03 1.045786e-02 2.746649e-02 New Hampshire 7.875478e-02 5.150515e-02 2.619027e-02 1.056052e-01 New Jersey 9.984500e-03 2.176395e-03 1.239889e-03 2.176839e-02 New Mexico 9.509025e-03 2.233580e-02 4.588646e-02 4.415361e-03 New York 2.371824e-03 8.547907e-03 2.449080e-02 2.934970e-03 North Carolina 3.365669e-02 5.394955e-02 8.729604e-02 2.334904e-02 North Dakota 7.833782e-02 5.124112e-02 2.595085e-02 1.051308e-01 Ohio 1.647487e-02 5.611184e-03 2.733299e-04 2.989609e-02 Oklahoma 1.517017e-03 5.727171e-04 7.578553e-03 7.491503e-03 Oregon 6.928513e-04 2.198484e-03 1.107861e-02 3.895206e-03 Pennsylvania 2.452714e-02 1.035036e-02 1.570856e-03 4.115819e-02 Rhode Island 9.696117e-03 4.768467e-03 8.009992e-03 2.017624e-02 South Carolina 2.271408e-02 4.049800e-02 7.056938e-02 1.397499e-02 South Dakota 5.786753e-03 4.845911e-04 2.037677e-03 1.509254e-02 Tennessee 2.685147e-03 1.091664e-02 2.900507e-02 9.012386e-04 Texas 4.976872e-04 2.859597e-03 1.417073e-02 3.817432e-03 Utah 2.248185e-02 9.578964e-03 1.151913e-03 3.742808e-02 Vermont 2.304317e-02 1.059336e-02 2.328524e-03 3.703120e-02 Virginia 3.336427e-04 2.391759e-03 1.311941e-02 3.825823e-03 Washington 4.438807e-03 7.233557e-04 3.427053e-03 1.200006e-02 West Virginia 3.757909e-03 5.965854e-04 5.620927e-03 1.177802e-02 Wisconsin 1.296044e-01 9.435780e-02 5.891933e-02 1.624395e-01 Wyoming 1.739357e-03 5.531091e-03 1.872505e-02 4.356573e-03 New Hampshire New Jersey New Mexico New York Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 3.498715e-02 New Mexico 1.382574e-01 3.564405e-02 New York 9.865040e-02 1.667060e-02 3.692938e-03 North Carolina 2.009373e-01 7.141080e-02 7.683278e-03 1.980486e-02 North Dakota 9.754942e-05 3.463353e-02 1.373768e-01 9.792323e-02 Ohio 2.400214e-02 2.315778e-03 5.002431e-02 2.779151e-02 Oklahoma 6.095426e-02 3.894465e-03 1.638909e-02 4.874300e-03 Oregon 7.021423e-02 8.293527e-03 1.399678e-02 5.179480e-03 Pennsylvania 1.615298e-02 3.794255e-03 6.180421e-02 3.599942e-02 Rhode Island 5.104767e-02 3.150699e-03 2.694574e-02 1.109055e-02 South Carolina 1.771396e-01 5.694764e-02 2.965663e-03 1.223833e-02 South Dakota 4.249205e-02 7.932132e-04 2.873962e-02 1.248698e-02 Tennessee 1.084637e-01 2.168984e-02 2.703076e-03 1.305972e-03 Texas 7.735017e-02 8.773200e-03 9.582880e-03 1.700470e-03 Utah 1.814444e-02 4.623593e-03 5.982581e-02 3.540061e-02 Vermont 2.001358e-02 6.893812e-03 6.155388e-02 3.765837e-02 Virginia 7.521147e-02 8.109076e-03 1.020327e-02 1.982409e-03 Washington 4.761185e-02 2.707321e-03 2.623637e-02 1.171654e-02 West Virginia 5.327645e-02 2.125392e-03 2.154396e-02 7.624617e-03 Wisconsin 6.851331e-03 7.207460e-02 2.030378e-01 1.551898e-01 Wyoming 8.625614e-02 1.171561e-02 6.798845e-03 4.755544e-04 North Carolina North Dakota Ohio Oklahoma Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota 1.996933e-01 Ohio 9.337913e-02 2.403302e-02 Oklahoma 4.410526e-02 6.046065e-02 9.486260e-03 Oregon 4.195308e-02 6.965968e-02 1.282594e-02 1.507562e-03 Pennsylvania 1.070592e-01 1.613757e-02 1.299641e-03 1.483403e-02 Rhode Island 5.431806e-02 5.011333e-02 1.076336e-02 4.059749e-03 South Carolina 1.292100e-03 1.762170e-01 7.565745e-02 3.227478e-02 South Dakota 6.322880e-02 4.214087e-02 3.116261e-03 1.766992e-03 Tennessee 1.873623e-02 1.081492e-01 3.166727e-02 7.416755e-03 Texas 3.244859e-02 7.701298e-02 1.634538e-02 1.145361e-03 Utah 1.065685e-01 1.786942e-02 8.706270e-04 1.413252e-02 Vermont 1.101292e-01 2.004842e-02 1.376776e-03 1.575535e-02 Virginia 3.390668e-02 7.478930e-02 1.529539e-02 8.179561e-04 Washington 6.076022e-02 4.711875e-02 4.543149e-03 1.824427e-03 West Virginia 5.091355e-02 5.310067e-02 7.084686e-03 7.430809e-04 Wisconsin 2.765112e-01 7.312103e-03 5.510202e-02 1.071968e-01 Wyoming 2.574505e-02 8.554313e-02 2.179048e-02 2.614155e-03 Oregon Pennsylvania Rhode Island South Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania 2.066515e-02 Rhode Island 9.993923e-03 1.191372e-02 South Carolina 2.968605e-02 8.905882e-02 4.368561e-02 South Dakota 4.128700e-03 6.612715e-03 4.303823e-03 4.893620e-02 Tennessee 5.626792e-03 4.202938e-02 1.805023e-02 1.049161e-02 Texas 1.944419e-03 2.329897e-02 7.177902e-03 2.210892e-02 Utah 1.744046e-02 1.266624e-03 1.420959e-02 8.794858e-02 Vermont 1.757301e-02 2.982420e-03 1.885479e-02 9.032980e-02 Virginia 1.400534e-03 2.221550e-02 6.862824e-03 2.332189e-02 Washington 2.261741e-03 9.572095e-03 6.904314e-03 4.633512e-02 West Virginia 3.946058e-03 1.093856e-02 2.968666e-03 3.839770e-02 Wisconsin 1.183293e-01 4.345579e-02 9.402751e-02 2.488321e-01 Wyoming 3.943917e-03 2.864360e-02 7.063526e-03 1.727931e-02 South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee 1.585995e-02 Texas 5.518434e-03 2.933044e-03 Utah 5.971738e-03 4.029836e-02 2.280962e-02 Vermont 7.283220e-03 4.080774e-02 2.418612e-02 7.075973e-04 Virginia 4.838680e-03 3.331000e-03 5.841769e-05 2.134294e-02 2.267907e-02 Washington 6.418151e-04 1.399898e-02 5.236926e-03 7.201951e-03 7.738360e-03 West Virginia 1.231499e-03 1.078105e-02 2.518222e-03 1.181068e-02 1.367590e-02 Wisconsin 8.228818e-02 1.664591e-01 1.281391e-01 4.604267e-02 4.736804e-02 Wyoming 8.557034e-03 2.739040e-03 7.754091e-04 2.855048e-02 3.110379e-02 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 4.371898e-03 West Virginia 2.341444e-03 2.516785e-03 Wisconsin 1.254636e-01 8.875528e-02 9.687671e-02 Wyoming 9.262637e-04 8.423664e-03 4.534013e-03 1.398206e-01 K-means clustering with 4 clusters of sizes 18, 17, 3, 12 Cluster means: Murder Assault UrbanPop Rape 1 7.461111 170.27778 68.33333 23.23333 2 4.082353 91.41176 66.23529 14.93529 3 14.500000 291.66667 45.66667 18.56667 4 11.850000 253.66667 65.33333 27.81667 Clustering vector: Alabama Alaska Arizona Arkansas California 4 4 4 4 1 Colorado Connecticut Delaware Florida Georgia 1 2 4 4 4 Hawaii Idaho Illinois Indiana Iowa 2 1 1 2 2 Kansas Kentucky Louisiana Maine Maryland 2 1 4 2 4 Massachusetts Michigan Minnesota Mississippi Missouri 2 4 2 3 1 Montana Nebraska Nevada New Hampshire New Jersey 1 2 1 2 2 New Mexico New York North Carolina North Dakota Ohio 4 1 3 2 2 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 1 1 2 1 3 South Dakota Tennessee Texas Utah Vermont 1 4 1 2 2 Virginia Washington West Virginia Wisconsin Wyoming 1 1 1 2 1 Within cluster sum of squares by cluster: [1] 8.690482e-07 1.216409e-03 6.242583e-08 4.003559e-06 Available components: [1] "cluster" "centers" "withinss" "size" wardpearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : pearson Number of objects: 50 singlepearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : pearson Number of objects: 50 completepearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : pearson Number of objects: 50 averagepearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : pearson Number of objects: 50 mcquittypearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : pearson Number of objects: 50 medianpearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : pearson Number of objects: 50 centroidpearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : pearson Number of objects: 50 centroid2pearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : pearson Number of objects: 50 Alabama Alaska Arizona Arkansas California Alaska 9.074976e-03 Arizona 1.430158e-03 1.030379e-02 Arkansas 3.808145e-04 9.343801e-03 3.351289e-04 California 6.187049e-03 1.615382e-02 1.694322e-03 3.513810e-03 Colorado 1.398519e-02 2.441453e-02 6.523358e-03 9.782688e-03 1.575649e-03 Connecticut 1.254392e-01 1.782090e-01 1.083457e-01 1.163327e-01 8.948292e-02 Delaware 3.764497e-03 2.078503e-02 1.896355e-03 2.449370e-03 2.507609e-03 Florida 1.140702e-04 7.354985e-03 1.177936e-03 3.047304e-04 5.676877e-03 Georgia 1.653240e-04 1.029876e-02 7.306609e-04 1.005191e-04 4.479689e-03 Hawaii 6.732324e-01 7.530580e-01 6.342841e-01 6.530622e-01 5.878124e-01 Idaho 2.886980e-02 5.523142e-02 1.977125e-02 2.383795e-02 1.182739e-02 Illinois 5.387816e-03 2.272581e-02 2.450184e-03 3.521504e-03 1.882987e-03 Indiana 6.209755e-02 9.581262e-02 4.810350e-02 5.455576e-02 3.422779e-02 Iowa 2.942405e-01 3.604232e-01 2.663998e-01 2.796569e-01 2.343439e-01 Kansas 6.405805e-02 1.004948e-01 5.049651e-02 5.674189e-02 3.687603e-02 Kentucky 2.705832e-02 5.599008e-02 1.924672e-02 2.269164e-02 1.250165e-02 Louisiana 2.033590e-04 1.172521e-02 1.196530e-03 3.602470e-04 5.302030e-03 Maine 8.728158e-02 1.329940e-01 7.299691e-02 7.960645e-02 5.782217e-02 Maryland 3.370563e-04 5.928568e-03 1.629610e-03 6.447922e-04 6.495491e-03 Massachusetts 6.784543e-02 1.080002e-01 5.482537e-02 6.081244e-02 4.149623e-02 Michigan 1.984378e-03 9.362117e-03 9.586539e-05 6.520520e-04 1.406595e-03 Minnesota 2.385755e-01 2.979766e-01 2.125581e-01 2.249085e-01 1.831794e-01 Mississippi 3.197143e-03 7.330787e-03 8.368882e-03 5.507089e-03 1.749780e-02 Missouri 1.278454e-02 2.917228e-02 6.283758e-03 9.081342e-03 1.931418e-03 Montana 3.373501e-02 6.175820e-02 2.387844e-02 2.831475e-02 1.497844e-02 Nebraska 7.924959e-02 1.178981e-01 6.386131e-02 7.099754e-02 4.805593e-02 Nevada 6.011885e-03 1.084277e-02 1.780354e-03 3.470171e-03 7.477442e-04 New Hampshire 2.734440e-01 3.404163e-01 2.473245e-01 2.597417e-01 2.171395e-01 New Jersey 6.115040e-02 1.002527e-01 4.899926e-02 5.456278e-02 3.670736e-02 New Mexico 6.487958e-04 6.135366e-03 7.460254e-04 3.396609e-04 4.334715e-03 New York 5.748474e-03 2.293982e-02 2.544324e-03 3.744648e-03 1.700354e-03 North Carolina 4.647987e-03 6.507934e-03 1.028120e-02 7.195204e-03 2.006853e-02 North Dakota 2.715277e-01 3.372644e-01 2.451167e-01 2.576735e-01 2.147176e-01 Ohio 8.338657e-02 1.229663e-01 6.764535e-02 7.495444e-02 5.137583e-02 Oklahoma 2.587197e-02 5.163479e-02 1.741102e-02 2.116773e-02 1.020797e-02 Oregon 2.170235e-02 3.695025e-02 1.238747e-02 1.654929e-02 5.062574e-03 Pennsylvania 1.101078e-01 1.589750e-01 9.360353e-02 1.012974e-01 7.572235e-02 Rhode Island 4.812256e-02 8.757412e-02 3.893357e-02 4.305922e-02 2.984781e-02 South Carolina 2.794305e-03 4.907881e-03 7.035191e-03 4.622417e-03 1.531563e-02 South Dakota 4.697548e-02 7.859289e-02 3.521202e-02 4.057811e-02 2.394620e-02 Tennessee 1.872822e-03 1.208320e-02 7.522718e-05 5.891533e-04 1.274168e-03 Texas 1.256556e-02 3.418489e-02 7.327411e-03 9.517218e-03 3.944361e-03 Utah 1.079317e-01 1.479852e-01 8.900199e-02 9.786319e-02 6.917741e-02 Vermont 1.056208e-01 1.418652e-01 8.606431e-02 9.522557e-02 6.585780e-02 Virginia 1.431624e-02 3.543291e-02 8.251699e-03 1.084171e-02 4.011554e-03 Washington 4.323450e-02 6.788332e-02 3.057976e-02 3.637141e-02 1.888759e-02 West Virginia 3.240251e-02 6.510028e-02 2.446101e-02 2.797308e-02 1.727660e-02 Wisconsin 4.124673e-01 4.894121e-01 3.815031e-01 3.963213e-01 3.448349e-01 Wyoming 1.088461e-02 3.250546e-02 6.384162e-03 8.216390e-03 3.799824e-03 Colorado Connecticut Delaware Florida Georgia Alaska Arizona Arkansas California Colorado Connecticut 7.546171e-02 Delaware 6.538017e-03 8.669546e-02 Florida 1.316819e-02 1.278020e-01 4.277540e-03 Georgia 1.133675e-02 1.171867e-01 2.426070e-03 2.805297e-04 Hawaii 5.463653e-01 2.586307e-01 5.929808e-01 6.761814e-01 6.564484e-01 Idaho 7.811527e-03 3.686702e-02 1.216289e-02 2.946459e-02 2.472970e-02 Illinois 4.780115e-03 8.023965e-02 2.050245e-04 5.804303e-03 3.701418e-03 Indiana 2.461410e-02 1.447701e-02 3.606009e-02 6.286649e-02 5.599220e-02 Iowa 2.075034e-01 4.032561e-02 2.356589e-01 2.968049e-01 2.818148e-01 Kansas 2.758820e-02 1.207273e-02 3.728408e-02 6.515411e-02 5.791635e-02 Kentucky 9.729474e-03 3.722947e-02 1.071699e-02 2.806520e-02 2.315428e-02 Louisiana 1.254673e-02 1.164966e-01 2.339249e-03 5.096810e-04 8.329132e-05 Maine 4.725479e-02 3.648331e-03 5.529807e-02 8.924159e-02 8.033769e-02 Maryland 1.428912e-02 1.337062e-01 5.518249e-03 8.573684e-05 6.755946e-04 Massachusetts 3.259493e-02 9.417965e-03 4.000009e-02 6.938344e-02 6.163863e-02 Michigan 5.816708e-03 1.096187e-01 2.584483e-03 1.527138e-03 1.236747e-03 Minnesota 1.588760e-01 2.170845e-02 1.855725e-01 2.406281e-01 2.271444e-01 Mississippi 2.935591e-02 1.654343e-01 1.360760e-02 3.273826e-03 4.814255e-03 Missouri 1.120573e-03 6.556326e-02 3.775743e-03 1.268010e-02 1.006247e-02 Montana 1.007658e-02 3.182571e-02 1.534768e-02 3.440889e-02 2.925834e-02 Nebraska 3.668209e-02 7.478982e-03 4.921823e-02 8.036003e-02 7.240668e-02 Nevada 2.802721e-03 1.041493e-01 4.973858e-03 5.018727e-03 4.702367e-03 New Hampshire 1.921920e-01 3.174537e-02 2.166672e-01 2.762765e-01 2.615031e-01 New Jersey 2.879477e-02 1.206127e-02 3.485140e-02 6.268205e-02 5.527702e-02 New Mexico 1.089030e-02 1.263698e-01 4.462845e-03 2.420422e-04 6.272953e-04 New York 4.324466e-03 7.916877e-02 3.150006e-04 6.118239e-03 3.989339e-03 North Carolina 3.248745e-02 1.755206e-01 1.662712e-02 4.554345e-03 6.546806e-03 North Dakota 1.895303e-01 3.132653e-02 2.149791e-01 2.741991e-01 2.595744e-01 Ohio 3.957062e-02 6.341252e-03 5.248968e-02 8.455143e-02 7.637666e-02 Oklahoma 6.897811e-03 4.001260e-02 1.020911e-02 2.648132e-02 2.196524e-02 Oregon 1.318412e-03 5.761301e-02 9.829559e-03 2.115046e-02 1.818552e-02 Pennsylvania 6.257230e-02 6.346078e-04 7.392715e-02 1.121364e-01 1.022817e-01 Rhode Island 2.508150e-02 1.946458e-02 2.524691e-02 5.003645e-02 4.313941e-02 South Carolina 2.629212e-02 1.641083e-01 1.302408e-02 2.555120e-03 4.251135e-03 South Dakota 1.683245e-02 2.149923e-02 2.462051e-02 4.779061e-02 4.168807e-02 Tennessee 5.665101e-03 1.028980e-01 1.295115e-03 1.710313e-03 9.778609e-04 Texas 4.233982e-03 6.034955e-02 2.675487e-03 1.313844e-02 9.906990e-03 Utah 5.388092e-02 5.262845e-03 7.289895e-02 1.087805e-01 9.990796e-02 Vermont 5.008010e-02 8.859050e-03 7.159077e-02 1.060095e-01 9.764121e-02 Virginia 3.452354e-03 5.769581e-02 3.666739e-03 1.474005e-02 1.143492e-02 Washington 1.115517e-02 3.017928e-02 2.301283e-02 4.323956e-02 3.810603e-02 West Virginia 1.418203e-02 3.137079e-02 1.416484e-02 3.377610e-02 2.822414e-02 Wisconsin 3.135298e-01 9.408378e-02 3.445757e-01 4.158451e-01 3.983843e-01 Wyoming 4.866008e-03 6.375716e-02 1.876205e-03 1.154564e-02 8.452577e-03 Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho 4.577742e-01 Illinois 5.770235e-01 9.417114e-03 Indiana 3.666838e-01 6.424493e-03 3.127254e-02 Iowa 1.000986e-01 1.464509e-01 2.246581e-01 9.372643e-02 Kansas 3.613977e-01 7.187131e-03 3.259544e-02 2.385679e-04 9.024350e-02 Kentucky 4.640278e-01 4.590237e-04 8.398644e-03 8.031629e-03 1.497014e-01 Louisiana 6.563738e-01 2.496216e-02 3.743961e-03 5.634822e-02 2.815127e-01 Maine 3.175245e-01 1.757949e-02 5.010164e-02 4.479124e-03 6.710780e-02 Maryland 6.867285e-01 3.220086e-02 7.167215e-03 6.671805e-02 3.049530e-01 Massachusetts 3.538220e-01 9.117451e-03 3.542665e-02 1.329233e-03 8.574092e-02 Michigan 6.345837e-01 2.010625e-02 2.999141e-03 4.828916e-02 2.671625e-01 Minnesota 1.385269e-01 1.062679e-01 1.754780e-01 6.161952e-02 3.598257e-03 Mississippi 7.486415e-01 5.093177e-02 1.673942e-02 9.268591e-02 3.519333e-01 Missouri 5.333065e-01 4.221023e-03 2.246785e-03 2.009171e-02 1.962375e-01 Montana 4.412824e-01 1.958289e-04 1.227445e-02 4.409532e-03 1.363076e-01 Nebraska 3.306067e-01 1.282337e-02 4.377597e-02 1.218173e-03 7.431295e-02 Nevada 6.140384e-01 1.782210e-02 4.561864e-03 4.294760e-02 2.544632e-01 New Hampshire 1.144742e-01 1.319665e-01 2.063207e-01 8.258582e-02 7.233602e-04 New Jersey 3.686331e-01 6.950602e-03 3.063575e-02 1.359099e-03 9.368611e-02 New Mexico 6.704558e-01 2.814302e-02 5.665704e-03 6.063351e-02 2.931923e-01 New York 5.740270e-01 8.918483e-03 1.288113e-05 3.036633e-02 2.226576e-01 North Carolina 7.655905e-01 5.635604e-02 1.998073e-02 9.986011e-02 3.654627e-01 North Dakota 1.152187e-01 1.302720e-01 2.045534e-01 8.100070e-02 6.147553e-04 Ohio 3.228093e-01 1.456593e-02 4.688904e-02 1.796726e-03 7.034262e-02 Oklahoma 4.684667e-01 8.700334e-05 7.719537e-03 7.980209e-03 1.530086e-01 Oregon 5.014375e-01 3.486063e-03 7.259701e-03 1.469515e-02 1.772426e-01 Pennsylvania 2.793952e-01 2.818049e-02 6.779897e-02 9.063731e-03 4.916610e-02 Rhode Island 4.048043e-01 5.061665e-03 2.215058e-02 4.879275e-03 1.140755e-01 South Carolina 7.443013e-01 4.910542e-02 1.585254e-02 9.015983e-02 3.489513e-01 South Dakota 4.026800e-01 2.248799e-03 2.073531e-02 1.124841e-03 1.134821e-01 Tennessee 6.233637e-01 1.747639e-02 1.680845e-03 4.456893e-02 2.583471e-01 Texas 5.279940e-01 3.440975e-03 1.503453e-03 1.918696e-02 1.912433e-01 Utah 2.833643e-01 2.591855e-02 6.606093e-02 6.585748e-03 5.274718e-02 Vermont 2.905931e-01 2.518978e-02 6.460572e-02 6.538369e-03 5.769875e-02 Virginia 5.191079e-01 2.555059e-03 2.193899e-03 1.703648e-02 1.856404e-01 Washington 4.196499e-01 2.340391e-03 1.895374e-02 2.886666e-03 1.255116e-01 West Virginia 4.472656e-01 1.338683e-03 1.170695e-02 6.838019e-03 1.391806e-01 Wisconsin 4.504819e-02 2.382714e-01 3.320116e-01 1.712942e-01 1.252331e-02 Wyoming 5.378582e-01 4.569299e-03 9.828208e-04 2.164577e-02 1.976912e-01 Kansas Kentucky Louisiana Maine Maryland Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 8.231510e-03 Louisiana 5.800286e-02 2.300848e-02 Maine 2.869001e-03 1.767247e-02 7.980833e-02 Maryland 6.921995e-02 3.092632e-02 9.957310e-04 9.423520e-02 Massachusetts 4.419740e-04 9.414726e-03 6.136307e-02 1.393042e-03 7.374682e-02 Michigan 5.097007e-02 1.998809e-02 1.881166e-03 7.411831e-02 1.880850e-03 Minnesota 5.909145e-02 1.096463e-01 2.271411e-01 4.157692e-02 2.479674e-01 Mississippi 9.484420e-02 4.814828e-02 4.680136e-03 1.216214e-01 2.720910e-03 Missouri 2.203860e-02 4.901044e-03 1.068546e-02 3.885815e-02 1.426624e-02 Montana 5.013493e-03 7.611294e-04 2.947079e-02 1.418495e-02 3.736587e-02 Nebraska 8.540941e-04 1.436877e-02 7.257680e-02 1.631358e-03 8.479441e-02 Nevada 4.633035e-02 1.908370e-02 5.874083e-03 7.006485e-02 5.341845e-03 New Hampshire 7.881256e-02 1.343524e-01 2.609117e-01 5.630972e-02 2.843388e-01 New Jersey 5.297329e-04 7.009590e-03 5.496123e-02 2.461325e-03 6.687035e-02 New Mexico 6.332029e-02 2.740916e-02 1.128056e-03 8.805222e-02 2.498186e-04 New York 3.174793e-02 8.037402e-03 4.081172e-03 4.924798e-02 7.490796e-03 North Carolina 1.022889e-01 5.368020e-02 6.515884e-03 1.303539e-01 3.753010e-03 North Dakota 7.746123e-02 1.329554e-01 2.591201e-01 5.558310e-02 2.821718e-01 Ohio 1.328512e-03 1.613915e-02 7.652385e-02 1.402451e-03 8.910399e-02 Oklahoma 8.752525e-03 3.473335e-04 2.215332e-02 1.971990e-02 2.910604e-02 Oregon 1.718247e-02 5.560576e-03 1.929343e-02 3.358031e-02 2.287855e-02 Pennsylvania 7.215542e-03 2.881808e-02 1.018147e-01 1.437607e-03 1.176229e-01 Rhode Island 3.621587e-03 3.769320e-03 4.238067e-02 6.546666e-03 5.399523e-02 South Carolina 9.275539e-02 4.700808e-02 4.404341e-03 1.203531e-01 1.896234e-03 South Dakota 1.414029e-03 3.161479e-03 4.189336e-02 7.795678e-03 5.124937e-02 Tennessee 4.681200e-02 1.693083e-02 1.395769e-03 6.849300e-02 2.316956e-03 Texas 2.016936e-02 2.849607e-03 9.953212e-03 3.458175e-02 1.509736e-02 Utah 6.413903e-03 2.882954e-02 1.004581e-01 4.679230e-03 1.136635e-01 Vermont 7.035820e-03 2.889779e-02 9.857129e-02 7.202806e-03 1.105947e-01 Virginia 1.820585e-02 2.396213e-03 1.163700e-02 3.260704e-02 1.672477e-02 Washington 4.362227e-03 4.598711e-03 3.896892e-02 1.427998e-02 4.613166e-02 West Virginia 6.472128e-03 4.215431e-04 2.780838e-02 1.374143e-02 3.699779e-02 Wisconsin 1.662233e-01 2.414187e-01 3.976134e-01 1.332780e-01 4.253112e-01 Wyoming 2.252881e-02 3.652983e-03 8.393472e-03 3.719055e-02 1.344029e-02 Massachusetts Michigan Minnesota Mississippi Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan 5.568505e-02 Minnesota 5.598960e-02 2.130320e-01 Mississippi 9.896462e-02 9.103637e-03 2.920462e-01 Missouri 2.565513e-02 6.207400e-03 1.493703e-01 2.858318e-02 Montana 6.707812e-03 2.423252e-02 9.757310e-02 5.726735e-02 Nebraska 1.075780e-03 6.423722e-02 4.611964e-02 1.130583e-01 Nevada 5.196229e-02 1.117471e-03 2.010167e-01 1.550827e-02 New Hampshire 7.396436e-02 2.484091e-01 2.332809e-03 3.291263e-01 New Jersey 1.894932e-04 4.990557e-02 6.255830e-02 9.083043e-02 New Mexico 6.807942e-02 8.039214e-04 2.369434e-01 4.591026e-03 New York 3.465457e-02 3.040318e-03 1.736083e-01 1.741160e-02 North Carolina 1.067867e-01 1.090400e-02 3.044343e-01 1.840015e-04 North Dakota 7.293050e-02 2.460555e-01 1.791346e-03 3.272493e-01 Ohio 1.396825e-03 6.804363e-02 4.299778e-02 1.179202e-01 Oklahoma 1.071047e-02 1.779504e-02 1.119986e-01 4.692268e-02 Oregon 2.148120e-02 1.178698e-02 1.322223e-01 4.089419e-02 Pennsylvania 5.349924e-03 9.464583e-02 2.767723e-02 1.482428e-01 Rhode Island 2.759848e-03 4.032131e-02 8.044212e-02 7.399693e-02 South Carolina 9.745947e-02 7.462303e-03 2.888054e-01 2.584835e-04 South Dakota 2.629287e-03 3.556709e-02 7.821005e-02 7.403684e-02 Tennessee 5.092842e-02 2.225546e-04 2.053133e-01 9.680903e-03 Texas 2.248588e-02 7.869609e-03 1.457036e-01 2.818102e-02 Utah 6.806483e-03 8.895503e-02 2.906302e-02 1.467783e-01 Vermont 8.337522e-03 8.561126e-02 3.271721e-02 1.442180e-01 Virginia 2.076240e-02 8.626049e-03 1.405234e-01 3.088233e-02 Washington 7.192417e-03 3.023162e-02 8.773179e-02 6.949892e-02 West Virginia 6.871682e-03 2.548909e-02 1.010646e-01 5.472791e-02 Wisconsin 1.593622e-01 3.827006e-01 2.943651e-02 4.770919e-01 Wyoming 2.472380e-02 7.039971e-03 1.515839e-01 2.552396e-02 Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana 6.171962e-03 Nebraska 3.095203e-02 9.861539e-03 Nevada 4.750634e-03 2.154367e-02 5.838248e-02 New Hampshire 1.801739e-01 1.223213e-01 6.419919e-02 2.372406e-01 New Jersey 2.193978e-02 4.913073e-03 1.967879e-03 4.675980e-02 New Mexico 1.127645e-02 3.299481e-02 7.813863e-02 3.283538e-03 New York 1.921859e-03 1.171640e-02 4.277220e-02 4.367653e-03 North Carolina 3.230755e-02 6.302909e-02 1.210870e-01 1.738284e-02 North Dakota 1.780106e-01 1.206787e-01 6.285979e-02 2.344930e-01 Ohio 3.363882e-02 1.139639e-02 5.685156e-05 6.201788e-02 Oklahoma 3.308768e-03 5.287462e-04 1.492555e-02 1.595370e-02 Oregon 1.433708e-03 4.742502e-03 2.431089e-02 7.889494e-03 Pennsylvania 5.379445e-02 2.375939e-02 3.770670e-03 8.916964e-02 Rhode Island 1.721085e-02 3.857385e-03 7.111440e-03 3.963982e-02 South Carolina 2.647106e-02 5.538897e-02 1.106557e-01 1.285082e-02 South Dakota 1.232631e-02 1.119271e-03 4.343808e-03 3.178208e-02 Tennessee 5.104304e-03 2.135235e-02 5.975182e-02 1.783447e-03 Texas 1.012227e-03 5.224375e-03 2.917963e-02 8.117571e-03 Utah 4.874226e-02 2.171305e-02 2.654310e-03 8.036983e-02 Vermont 4.638484e-02 2.119826e-02 3.431426e-03 7.602573e-02 Virginia 6.501680e-04 4.155494e-03 2.672837e-02 8.136819e-03 Washington 9.208389e-03 1.668455e-03 7.731955e-03 2.482234e-02 West Virginia 8.155258e-03 1.211055e-03 1.192835e-02 2.496206e-02 Wisconsin 2.994769e-01 2.256071e-01 1.449862e-01 3.686791e-01 Wyoming 1.415708e-03 6.560137e-03 3.203747e-02 7.887858e-03 New Hampshire New Jersey New Mexico New York Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 8.129350e-02 New Mexico 2.732923e-01 6.156276e-02 New York 2.044885e-01 2.993790e-02 5.877810e-03 North Carolina 3.424737e-01 9.837446e-02 5.813490e-03 2.067956e-02 North Dakota 5.912424e-05 8.025535e-02 2.710014e-01 2.026859e-01 Ohio 6.049338e-02 2.485202e-03 8.230314e-02 4.585839e-02 Oklahoma 1.381052e-01 8.289875e-03 2.531302e-02 7.276272e-03 Oregon 1.630459e-01 1.861112e-02 1.871378e-02 6.664761e-03 Pennsylvania 4.004188e-02 7.455720e-03 1.105231e-01 6.675799e-02 Rhode Island 9.966909e-02 1.600563e-03 4.992227e-02 2.173163e-02 South Carolina 3.267403e-01 8.947547e-02 3.374560e-03 1.642450e-02 South Dakota 1.007843e-01 1.739543e-03 4.608990e-02 2.002354e-02 Tennessee 2.394610e-01 4.530400e-02 1.281661e-03 1.750203e-03 Texas 1.742886e-01 1.872301e-02 1.264201e-02 1.331951e-03 Utah 4.524998e-02 9.065862e-03 1.055379e-01 6.473427e-02 Vermont 5.062906e-02 1.052538e-02 1.022015e-01 6.319485e-02 Virginia 1.692214e-01 1.723093e-02 1.392390e-02 1.942077e-03 Washington 1.134548e-01 6.097298e-03 4.058954e-02 1.811148e-02 West Virginia 1.239115e-01 4.786768e-03 3.343280e-02 1.135904e-02 Wisconsin 1.712766e-02 1.697666e-01 4.122941e-01 3.297774e-01 Wyoming 1.802680e-01 2.072458e-02 1.129277e-02 8.799210e-04 North Carolina North Dakota Ohio Oklahoma Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota 3.404907e-01 Ohio 1.261250e-01 5.919393e-02 Oklahoma 5.216386e-02 1.364245e-01 1.679407e-02 Oregon 4.494900e-02 1.605516e-01 2.666870e-02 3.188907e-03 Pennsylvania 1.577418e-01 3.937338e-02 2.989262e-03 3.100356e-02 Rhode Island 8.108719e-02 9.891155e-02 8.037991e-03 5.711051e-03 South Carolina 3.451176e-04 3.246325e-01 1.155140e-01 4.522892e-02 South Dakota 8.057267e-02 9.923501e-02 5.383842e-03 3.181700e-03 Tennessee 1.182526e-02 2.373095e-01 6.341453e-02 1.524924e-02 Texas 3.235404e-02 1.726065e-01 3.173795e-02 2.438702e-03 Utah 1.555736e-01 4.373469e-02 2.063400e-03 2.895242e-02 Vermont 1.526381e-01 4.878563e-02 2.981646e-03 2.821622e-02 Virginia 3.513154e-02 1.674282e-01 2.920317e-02 1.724589e-03 Washington 7.530451e-02 1.113316e-01 9.059940e-03 3.203952e-03 West Virginia 6.075696e-02 1.227732e-01 1.345185e-02 1.411476e-03 Wisconsin 4.924554e-01 1.776334e-02 1.395074e-01 2.462831e-01 Wyoming 2.957228e-02 1.786542e-01 3.469543e-02 3.396764e-03 Oregon Pennsylvania Rhode Island South Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania 4.633939e-02 Rhode Island 1.688506e-02 1.408346e-02 South Carolina 3.777776e-02 1.466521e-01 7.359996e-02 South Dakota 9.114300e-03 1.487789e-02 2.792747e-03 7.196578e-02 Tennessee 1.091066e-02 8.854381e-02 3.561902e-02 8.376207e-03 Texas 3.934272e-03 4.948954e-02 1.268069e-02 2.703951e-02 Utah 3.850643e-02 3.117345e-03 1.818404e-02 1.434526e-01 Vermont 3.536863e-02 5.947249e-03 2.027010e-02 1.402743e-01 Virginia 2.728187e-03 4.692846e-02 1.206076e-02 2.942604e-02 Washington 4.814743e-03 2.210984e-02 8.039389e-03 6.637951e-02 West Virginia 8.832404e-03 2.392922e-02 1.734187e-03 5.396548e-02 Wisconsin 2.771145e-01 1.080410e-01 1.947142e-01 4.745022e-01 Wyoming 5.070391e-03 5.271140e-02 1.390326e-02 2.461462e-02 South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee 3.214758e-02 Texas 1.112121e-02 5.920991e-03 Utah 1.310033e-02 8.428726e-02 4.798165e-02 Vermont 1.300545e-02 8.155615e-02 4.698186e-02 4.695915e-04 Virginia 9.576908e-03 6.771469e-03 1.254515e-04 4.451661e-02 4.324851e-02 Washington 1.482748e-03 2.792682e-02 1.037760e-02 1.622681e-02 1.446869e-02 West Virginia 2.647154e-03 2.183808e-02 5.069413e-03 2.568471e-02 2.654045e-02 Wisconsin 1.967071e-01 3.721095e-01 2.923844e-01 1.151479e-01 1.222457e-01 Wyoming 1.297814e-02 5.077548e-03 9.609983e-05 5.179474e-02 5.094010e-02 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 8.415084e-03 West Virginia 4.662982e-03 5.536062e-03 Wisconsin 2.860111e-01 2.128783e-01 2.275928e-01 Wyoming 4.349517e-04 1.243499e-02 5.926389e-03 2.998325e-01 K-means clustering with 4 clusters of sizes 14, 19, 11, 6 Cluster means: Murder Assault UrbanPop Rape 1 9.414286 218.92857 74.57143 28.82143 2 5.026316 115.78947 64.47368 15.96842 3 13.309091 267.63636 57.81818 25.51818 4 2.616667 54.83333 62.00000 12.33333 Clustering vector: Alabama Alaska Arizona Arkansas California 3 3 1 3 1 Colorado Connecticut Delaware Florida Georgia 1 2 1 3 3 Hawaii Idaho Illinois Indiana Iowa 4 2 1 2 4 Kansas Kentucky Louisiana Maine Maryland 2 2 3 2 3 Massachusetts Michigan Minnesota Mississippi Missouri 2 1 4 3 1 Montana Nebraska Nevada New Hampshire New Jersey 2 2 1 4 2 New Mexico New York North Carolina North Dakota Ohio 3 1 3 4 2 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 2 1 2 2 3 South Dakota Tennessee Texas Utah Vermont 2 1 1 2 2 Virginia Washington West Virginia Wisconsin Wyoming 1 2 2 4 1 Within cluster sum of squares by cluster: [1] 3.390500e-06 2.347051e-05 9.996126e-07 8.814207e-06 Available components: [1] "cluster" "centers" "withinss" "size" wardcorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : correlation Number of objects: 50 singlecorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : correlation Number of objects: 50 completecorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : correlation Number of objects: 50 averagecorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : correlation Number of objects: 50 mcquittycorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : correlation Number of objects: 50 mediancorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : correlation Number of objects: 50 centroidcorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : correlation Number of objects: 50 centroid2correlation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : correlation Number of objects: 50 Alabama Alaska Arizona Arkansas California Colorado Connecticut Alaska 0 Arizona 0 0 Arkansas 0 0 0 California 0 0 0 0 Colorado 0 0 0 0 0 Connecticut 0 0 0 0 0 0 Delaware 0 0 0 0 0 0 0 Florida 0 0 0 0 0 0 0 Georgia 0 0 0 0 0 0 0 Hawaii 2 2 2 2 2 2 2 Idaho 0 0 0 0 0 0 0 Illinois 0 0 0 0 0 0 0 Indiana 0 0 0 0 0 0 0 Iowa 2 2 2 2 2 2 2 Kansas 0 0 0 0 0 0 0 Kentucky 0 0 0 0 0 0 0 Louisiana 0 0 0 0 0 0 0 Maine 0 0 0 0 0 0 0 Maryland 0 0 0 0 0 0 0 Massachusetts 0 0 0 0 0 0 0 Michigan 0 0 0 0 0 0 0 Minnesota 0 0 0 0 0 0 0 Mississippi 0 0 0 0 0 0 0 Missouri 0 0 0 0 0 0 0 Montana 0 0 0 0 0 0 0 Nebraska 0 0 0 0 0 0 0 Nevada 0 0 0 0 0 0 0 New Hampshire 0 0 0 0 0 0 0 New Jersey 0 0 0 0 0 0 0 New Mexico 0 0 0 0 0 0 0 New York 0 0 0 0 0 0 0 North Carolina 0 0 0 0 0 0 0 North Dakota 0 0 0 0 0 0 0 Ohio 0 0 0 0 0 0 0 Oklahoma 0 0 0 0 0 0 0 Oregon 0 0 0 0 0 0 0 Pennsylvania 0 0 0 0 0 0 0 Rhode Island 0 0 0 0 0 0 0 South Carolina 0 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 0 Texas 0 0 0 0 0 0 0 Utah 0 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 0 Washington 0 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 0 Wisconsin 2 2 2 2 2 2 2 Wyoming 0 0 0 0 0 0 0 Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida 0 Georgia 0 0 Hawaii 2 2 2 Idaho 0 0 0 2 Illinois 0 0 0 2 0 Indiana 0 0 0 2 0 0 Iowa 2 2 2 0 2 2 2 Kansas 0 0 0 2 0 0 0 2 Kentucky 0 0 0 2 0 0 0 2 Louisiana 0 0 0 2 0 0 0 2 Maine 0 0 0 2 0 0 0 2 Maryland 0 0 0 2 0 0 0 2 Massachusetts 0 0 0 2 0 0 0 2 Michigan 0 0 0 2 0 0 0 2 Minnesota 0 0 0 2 0 0 0 2 Mississippi 0 0 0 2 0 0 0 2 Missouri 0 0 0 2 0 0 0 2 Montana 0 0 0 2 0 0 0 2 Nebraska 0 0 0 2 0 0 0 2 Nevada 0 0 0 2 0 0 0 2 New Hampshire 0 0 0 2 0 0 0 2 New Jersey 0 0 0 2 0 0 0 2 New Mexico 0 0 0 2 0 0 0 2 New York 0 0 0 2 0 0 0 2 North Carolina 0 0 0 2 0 0 0 2 North Dakota 0 0 0 2 0 0 0 2 Ohio 0 0 0 2 0 0 0 2 Oklahoma 0 0 0 2 0 0 0 2 Oregon 0 0 0 2 0 0 0 2 Pennsylvania 0 0 0 2 0 0 0 2 Rhode Island 0 0 0 2 0 0 0 2 South Carolina 0 0 0 2 0 0 0 2 South Dakota 0 0 0 2 0 0 0 2 Tennessee 0 0 0 2 0 0 0 2 Texas 0 0 0 2 0 0 0 2 Utah 0 0 0 2 0 0 0 2 Vermont 0 0 0 2 0 0 0 2 Virginia 0 0 0 2 0 0 0 2 Washington 0 0 0 2 0 0 0 2 West Virginia 0 0 0 2 0 0 0 2 Wisconsin 2 2 2 0 2 2 2 0 Wyoming 0 0 0 2 0 0 0 2 Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 0 Louisiana 0 0 Maine 0 0 0 Maryland 0 0 0 0 Massachusetts 0 0 0 0 0 Michigan 0 0 0 0 0 0 Minnesota 0 0 0 0 0 0 0 Mississippi 0 0 0 0 0 0 0 Missouri 0 0 0 0 0 0 0 Montana 0 0 0 0 0 0 0 Nebraska 0 0 0 0 0 0 0 Nevada 0 0 0 0 0 0 0 New Hampshire 0 0 0 0 0 0 0 New Jersey 0 0 0 0 0 0 0 New Mexico 0 0 0 0 0 0 0 New York 0 0 0 0 0 0 0 North Carolina 0 0 0 0 0 0 0 North Dakota 0 0 0 0 0 0 0 Ohio 0 0 0 0 0 0 0 Oklahoma 0 0 0 0 0 0 0 Oregon 0 0 0 0 0 0 0 Pennsylvania 0 0 0 0 0 0 0 Rhode Island 0 0 0 0 0 0 0 South Carolina 0 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 0 Texas 0 0 0 0 0 0 0 Utah 0 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 0 Washington 0 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 0 Wisconsin 2 2 2 2 2 2 2 Wyoming 0 0 0 0 0 0 0 Minnesota Mississippi Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi 0 Missouri 0 0 Montana 0 0 0 Nebraska 0 0 0 0 Nevada 0 0 0 0 0 New Hampshire 0 0 0 0 0 0 New Jersey 0 0 0 0 0 0 New Mexico 0 0 0 0 0 0 New York 0 0 0 0 0 0 North Carolina 0 0 0 0 0 0 North Dakota 0 0 0 0 0 0 Ohio 0 0 0 0 0 0 Oklahoma 0 0 0 0 0 0 Oregon 0 0 0 0 0 0 Pennsylvania 0 0 0 0 0 0 Rhode Island 0 0 0 0 0 0 South Carolina 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 Texas 0 0 0 0 0 0 Utah 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 Washington 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 Wisconsin 2 2 2 2 2 2 Wyoming 0 0 0 0 0 0 New Hampshire New Jersey New Mexico New York North Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 0 New Mexico 0 0 New York 0 0 0 North Carolina 0 0 0 0 North Dakota 0 0 0 0 0 Ohio 0 0 0 0 0 Oklahoma 0 0 0 0 0 Oregon 0 0 0 0 0 Pennsylvania 0 0 0 0 0 Rhode Island 0 0 0 0 0 South Carolina 0 0 0 0 0 South Dakota 0 0 0 0 0 Tennessee 0 0 0 0 0 Texas 0 0 0 0 0 Utah 0 0 0 0 0 Vermont 0 0 0 0 0 Virginia 0 0 0 0 0 Washington 0 0 0 0 0 West Virginia 0 0 0 0 0 Wisconsin 2 2 2 2 2 Wyoming 0 0 0 0 0 North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio 0 Oklahoma 0 0 Oregon 0 0 0 Pennsylvania 0 0 0 0 Rhode Island 0 0 0 0 0 South Carolina 0 0 0 0 0 0 South Dakota 0 0 0 0 0 0 Tennessee 0 0 0 0 0 0 Texas 0 0 0 0 0 0 Utah 0 0 0 0 0 0 Vermont 0 0 0 0 0 0 Virginia 0 0 0 0 0 0 Washington 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 Wisconsin 2 2 2 2 2 2 Wyoming 0 0 0 0 0 0 South Carolina South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota 0 Tennessee 0 0 Texas 0 0 0 Utah 0 0 0 0 Vermont 0 0 0 0 0 Virginia 0 0 0 0 0 0 Washington 0 0 0 0 0 0 West Virginia 0 0 0 0 0 0 Wisconsin 2 2 2 2 2 2 Wyoming 0 0 0 0 0 0 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 0 West Virginia 0 0 Wisconsin 2 2 2 Wyoming 0 0 0 2 K-means clustering with 4 clusters of sizes 50, 0, 0, 0 Cluster means: Murder Assault UrbanPop Rape 1 7.788 170.76 65.54 21.232 2 NaN NaN NaN NaN 3 NaN NaN NaN NaN 4 NaN NaN NaN NaN Clustering vector: Alabama Alaska Arizona Arkansas California 1 1 1 1 1 Colorado Connecticut Delaware Florida Georgia 1 1 1 1 1 Hawaii Idaho Illinois Indiana Iowa 1 1 1 1 1 Kansas Kentucky Louisiana Maine Maryland 1 1 1 1 1 Massachusetts Michigan Minnesota Mississippi Missouri 1 1 1 1 1 Montana Nebraska Nevada New Hampshire New Jersey 1 1 1 1 1 New Mexico New York North Carolina North Dakota Ohio 1 1 1 1 1 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 1 1 1 1 1 South Dakota Tennessee Texas Utah Vermont 1 1 1 1 1 Virginia Washington West Virginia Wisconsin Wyoming 1 1 1 1 1 Within cluster sum of squares by cluster: [1] 0 0 0 0 Available components: [1] "cluster" "centers" "withinss" "size" wardspearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : spearman Number of objects: 50 singlespearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : spearman Number of objects: 50 completespearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : spearman Number of objects: 50 averagespearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : spearman Number of objects: 50 mcquittyspearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : spearman Number of objects: 50 medianspearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : spearman Number of objects: 50 centroidspearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : spearman Number of objects: 50 centroid2spearman Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : spearman Number of objects: 50 Alabama Alaska Arizona Arkansas California Colorado Alaska 0.0000000 Arizona 0.0000000 0.0000000 Arkansas 0.0000000 0.0000000 0.0000000 California 0.0000000 0.0000000 0.0000000 0.0000000 Colorado 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Connecticut 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Delaware 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Florida 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Georgia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Hawaii 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Idaho 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Illinois 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Indiana 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Iowa 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Kansas 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Kentucky 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Louisiana 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Maine 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Maryland 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Massachusetts 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Michigan 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Minnesota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Mississippi 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Missouri 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Montana 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Nebraska 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Nevada 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Hampshire 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Jersey 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Mexico 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New York 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 North Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 North Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Ohio 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oklahoma 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oregon 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Pennsylvania 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Rhode Island 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Tennessee 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Texas 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Utah 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Vermont 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Connecticut Delaware Florida Georgia Hawaii Idaho Alaska Arizona Arkansas California Colorado Connecticut Delaware 0.0000000 Florida 0.0000000 0.0000000 Georgia 0.0000000 0.0000000 0.0000000 Hawaii 0.1666667 0.1666667 0.1666667 0.1666667 Idaho 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 Illinois 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Indiana 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Iowa 0.1666667 0.1666667 0.1666667 0.1666667 0.0000000 0.1666667 Kansas 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Kentucky 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Louisiana 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Maine 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Maryland 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Massachusetts 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Michigan 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Minnesota 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Mississippi 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Missouri 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Montana 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Nebraska 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Nevada 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 New Hampshire 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 New Jersey 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 New Mexico 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 New York 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 North Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 North Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Ohio 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Oklahoma 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Oregon 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Pennsylvania 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Rhode Island 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 South Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 South Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Tennessee 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Texas 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Utah 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Vermont 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Washington 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.0000000 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 Illinois Indiana Iowa Kansas Kentucky Louisiana Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana 0.0000000 Iowa 0.1666667 0.1666667 Kansas 0.0000000 0.0000000 0.1666667 Kentucky 0.0000000 0.0000000 0.1666667 0.0000000 Louisiana 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 Maine 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Maryland 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Massachusetts 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Michigan 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Minnesota 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Mississippi 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Missouri 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Montana 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Nebraska 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Nevada 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 New Hampshire 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 New Jersey 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 New Mexico 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 New York 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 North Carolina 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 North Dakota 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Ohio 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Oklahoma 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Oregon 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Pennsylvania 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Rhode Island 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 South Carolina 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 South Dakota 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Tennessee 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Texas 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Utah 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Vermont 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Virginia 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.0000000 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 Maine Maryland Massachusetts Michigan Minnesota Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland 0.0000000 Massachusetts 0.0000000 0.0000000 Michigan 0.0000000 0.0000000 0.0000000 Minnesota 0.0000000 0.0000000 0.0000000 0.0000000 Mississippi 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Missouri 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Montana 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Nebraska 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Nevada 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Hampshire 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Jersey 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Mexico 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New York 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 North Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 North Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Ohio 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oklahoma 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oregon 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Pennsylvania 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Rhode Island 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Tennessee 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Texas 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Utah 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Vermont 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Mississippi Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri 0.0000000 Montana 0.0000000 0.0000000 Nebraska 0.0000000 0.0000000 0.0000000 Nevada 0.0000000 0.0000000 0.0000000 0.0000000 New Hampshire 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Jersey 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Mexico 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New York 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 North Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 North Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Ohio 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oklahoma 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oregon 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Pennsylvania 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Rhode Island 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Tennessee 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Texas 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Utah 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Vermont 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 New Hampshire New Jersey New Mexico New York North Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 0.0000000 New Mexico 0.0000000 0.0000000 New York 0.0000000 0.0000000 0.0000000 North Carolina 0.0000000 0.0000000 0.0000000 0.0000000 North Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Ohio 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oklahoma 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Oregon 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Pennsylvania 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Rhode Island 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Tennessee 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Texas 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Utah 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Vermont 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 North Dakota Ohio Oklahoma Oregon Pennsylvania Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio 0.0000000 Oklahoma 0.0000000 0.0000000 Oregon 0.0000000 0.0000000 0.0000000 Pennsylvania 0.0000000 0.0000000 0.0000000 0.0000000 Rhode Island 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Carolina 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 South Dakota 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Tennessee 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Texas 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Utah 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Vermont 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Rhode Island South Carolina South Dakota Tennessee Texas Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina 0.0000000 South Dakota 0.0000000 0.0000000 Tennessee 0.0000000 0.0000000 0.0000000 Texas 0.0000000 0.0000000 0.0000000 0.0000000 Utah 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Vermont 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 Utah Vermont Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont 0.0000000 Virginia 0.0000000 0.0000000 Washington 0.0000000 0.0000000 0.0000000 West Virginia 0.0000000 0.0000000 0.0000000 0.0000000 Wisconsin 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 Wyoming 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 K-means clustering with 4 clusters of sizes 50, 0, 0, 0 Cluster means: Murder Assault UrbanPop Rape 1 7.788 170.76 65.54 21.232 2 NaN NaN NaN NaN 3 NaN NaN NaN NaN 4 NaN NaN NaN NaN Clustering vector: Alabama Alaska Arizona Arkansas California 1 1 1 1 1 Colorado Connecticut Delaware Florida Georgia 1 1 1 1 1 Hawaii Idaho Illinois Indiana Iowa 1 1 1 1 1 Kansas Kentucky Louisiana Maine Maryland 1 1 1 1 1 Massachusetts Michigan Minnesota Mississippi Missouri 1 1 1 1 1 Montana Nebraska Nevada New Hampshire New Jersey 1 1 1 1 1 New Mexico New York North Carolina North Dakota Ohio 1 1 1 1 1 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 1 1 1 1 1 South Dakota Tennessee Texas Utah Vermont 1 1 1 1 1 Virginia Washington West Virginia Wisconsin Wyoming 1 1 1 1 1 Within cluster sum of squares by cluster: [1] 0 0 0 0 Available components: [1] "cluster" "centers" "withinss" "size" wardkendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : kendall Number of objects: 50 singlekendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : kendall Number of objects: 50 completekendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : kendall Number of objects: 50 averagekendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : kendall Number of objects: 50 mcquittykendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : kendall Number of objects: 50 mediankendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : kendall Number of objects: 50 centroidkendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : kendall Number of objects: 50 centroid2kendall Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : kendall Number of objects: 50 Alabama Alaska Arizona Arkansas California Alaska 4.967609e-03 Arizona 7.860089e-04 5.622967e-03 Arkansas 2.480350e-04 5.092370e-03 2.013352e-04 California 4.567700e-03 9.632533e-03 2.080549e-03 2.730268e-03 Colorado 1.160541e-02 1.655015e-02 7.617445e-03 8.642576e-03 1.742772e-03 Connecticut 6.742317e-02 9.296038e-02 5.858196e-02 6.154513e-02 4.341992e-02 Delaware 2.120614e-03 1.152689e-02 1.114363e-03 1.504542e-03 3.161308e-03 Florida 8.133686e-05 4.081315e-03 6.870513e-04 2.810234e-04 4.650542e-03 Georgia 1.391515e-03 6.554862e-03 1.546865e-03 9.358075e-04 2.226189e-03 Hawaii 3.188827e-01 3.536003e-01 3.001641e-01 3.058034e-01 2.597179e-01 Idaho 1.710962e-02 3.042756e-02 1.222800e-02 1.385416e-02 5.904912e-03 Illinois 3.342110e-03 1.248383e-02 1.691925e-03 2.095278e-03 1.175956e-03 Indiana 4.110010e-02 5.627745e-02 3.412146e-02 3.601888e-02 2.064139e-02 Iowa 1.486720e-01 1.783990e-01 1.350998e-01 1.394689e-01 1.088196e-01 Kansas 3.954576e-02 5.650297e-02 3.264991e-02 3.466314e-02 2.013683e-02 Kentucky 2.183410e-02 3.527083e-02 1.771576e-02 1.849547e-02 9.031711e-03 Louisiana 1.776390e-04 6.389860e-03 6.862038e-04 1.970560e-04 3.543434e-03 Maine 4.780901e-02 7.037322e-02 4.030847e-02 4.285832e-02 2.831878e-02 Maryland 3.812263e-04 3.542378e-03 1.158916e-03 7.688422e-04 5.998311e-03 Massachusetts 3.829269e-02 5.799896e-02 3.146718e-02 3.372154e-02 2.060844e-02 Michigan 1.869783e-03 5.660296e-03 7.637758e-04 8.377736e-04 7.689734e-04 Minnesota 1.232162e-01 1.496674e-01 1.106210e-01 1.146434e-01 8.648955e-02 Mississippi 2.884033e-03 5.343614e-03 5.955353e-03 4.633688e-03 1.428097e-02 Missouri 1.055828e-02 1.852245e-02 7.044989e-03 7.882921e-03 1.698581e-03 Montana 2.309511e-02 3.642118e-02 1.794453e-02 1.933791e-02 8.973248e-03 Nebraska 4.693663e-02 6.489041e-02 3.916396e-02 4.154519e-02 2.530403e-02 Nevada 6.041776e-03 8.308041e-03 3.677108e-03 4.077286e-03 6.878144e-04 New Hampshire 1.391441e-01 1.698682e-01 1.261941e-01 1.304193e-01 1.015213e-01 New Jersey 3.585618e-02 5.472607e-02 2.952516e-02 3.146386e-02 1.873788e-02 New Mexico 3.595312e-04 3.347464e-03 4.068709e-04 2.018328e-04 3.438835e-03 New York 3.744944e-03 1.273269e-02 1.944963e-03 2.369745e-03 9.582330e-04 North Carolina 6.723075e-03 8.023246e-03 1.028662e-02 9.039475e-03 2.120049e-02 North Dakota 1.384077e-01 1.690331e-01 1.251704e-01 1.296179e-01 1.007616e-01 Ohio 5.111893e-02 6.895500e-02 4.331588e-02 4.554174e-02 2.831352e-02 Oklahoma 1.697825e-02 2.964050e-02 1.246624e-02 1.376280e-02 5.584235e-03 Oregon 1.581117e-02 2.309657e-02 1.090322e-02 1.232159e-02 3.580442e-03 Pennsylvania 6.219557e-02 8.474290e-02 5.390715e-02 5.639318e-02 3.818388e-02 Rhode Island 2.618377e-02 4.685592e-02 2.116969e-02 2.301108e-02 1.510500e-02 South Carolina 2.503299e-03 3.802228e-03 5.029613e-03 3.949550e-03 1.275627e-02 South Dakota 2.958899e-02 4.463975e-02 2.349699e-02 2.530384e-02 1.315610e-02 Tennessee 3.212135e-03 8.290276e-03 2.105188e-03 1.984214e-03 7.404146e-04 Texas 9.816236e-03 2.050470e-02 6.933171e-03 7.524554e-03 2.394185e-03 Utah 6.154161e-02 7.983365e-02 5.215179e-02 5.514731e-02 3.549792e-02 Vermont 6.377570e-02 7.953585e-02 5.437871e-02 5.715906e-02 3.647957e-02 Virginia 1.067416e-02 2.111223e-02 7.372475e-03 8.164218e-03 2.416336e-03 Washington 2.793788e-02 3.957629e-02 2.142554e-02 2.343360e-02 1.091309e-02 West Virginia 2.139991e-02 3.723317e-02 1.716281e-02 1.820022e-02 9.481238e-03 Wisconsin 2.041241e-01 2.392690e-01 1.887790e-01 1.937297e-01 1.582904e-01 Wyoming 6.736718e-03 1.795410e-02 4.242138e-03 4.931862e-03 1.921136e-03 Colorado Connecticut Delaware Florida Georgia Alaska Arizona Arkansas California Colorado Connecticut 3.377147e-02 Delaware 8.825452e-03 4.969521e-02 Florida 1.183787e-02 6.959729e-02 2.381262e-03 Georgia 6.400773e-03 5.646812e-02 3.079057e-03 1.781186e-03 Hawaii 2.264679e-01 1.070889e-01 2.866504e-01 3.229940e-01 2.893300e-01 Idaho 4.053591e-03 1.775091e-02 9.228616e-03 1.792734e-02 1.222725e-02 Illinois 4.468362e-03 4.125628e-02 8.969001e-04 3.786038e-03 2.085318e-03 Indiana 1.220102e-02 7.288989e-03 3.060119e-02 4.258524e-02 3.033231e-02 Iowa 8.892154e-02 1.824423e-02 1.240853e-01 1.516076e-01 1.297648e-01 Kansas 1.266000e-02 5.545648e-03 2.816555e-02 4.107094e-02 2.975414e-02 Kentucky 4.910030e-03 1.630316e-02 1.531276e-02 2.321619e-02 1.392955e-02 Louisiana 9.773184e-03 6.124514e-02 1.490332e-03 4.342680e-04 8.227891e-04 Maine 2.152527e-02 1.779277e-03 3.284746e-02 4.960260e-02 3.911045e-02 Maryland 1.396641e-02 7.493911e-02 3.161038e-03 1.403165e-04 2.860952e-03 Massachusetts 1.477010e-02 4.296360e-03 2.544141e-02 3.984055e-02 3.022187e-02 Michigan 4.345148e-03 5.410369e-02 2.600266e-03 1.897786e-03 6.768634e-04 Minnesota 6.852078e-02 1.083950e-02 1.012398e-01 1.257980e-01 1.057427e-01 Mississippi 2.533743e-02 9.637848e-02 8.515000e-03 2.676871e-03 7.330439e-03 Missouri 5.228255e-04 2.958266e-02 6.918201e-03 1.111266e-02 5.602427e-03 Montana 4.639590e-03 1.395732e-02 1.526605e-02 2.423375e-02 1.564720e-02 Nebraska 1.662893e-02 3.621333e-03 3.409253e-02 4.851707e-02 3.640661e-02 Nevada 1.475644e-03 4.794007e-02 6.265525e-03 6.038652e-03 2.619189e-03 New Hampshire 8.315376e-02 1.420976e-02 1.147020e-01 1.420982e-01 1.214604e-01 New Jersey 1.291630e-02 5.322189e-03 2.406833e-02 3.744993e-02 2.748016e-02 New Mexico 9.755101e-03 6.737898e-02 2.532245e-03 1.752156e-04 1.477890e-03 New York 3.812925e-03 4.000477e-02 1.246136e-03 4.204578e-03 2.103147e-03 North Carolina 3.459825e-02 1.121645e-01 1.311779e-02 6.159558e-03 1.351158e-02 North Dakota 8.265855e-02 1.380171e-02 1.135800e-01 1.412370e-01 1.212085e-01 Ohio 1.855278e-02 3.967674e-03 3.846424e-02 5.284976e-02 3.942084e-02 Oklahoma 3.165450e-03 1.816358e-02 1.000268e-02 1.791818e-02 1.122908e-02 Oregon 6.020258e-04 2.564192e-02 1.090611e-02 1.622390e-02 9.807218e-03 Pennsylvania 2.789524e-02 9.460599e-04 4.674116e-02 6.432989e-02 5.019145e-02 Rhode Island 1.371363e-02 1.156309e-02 1.458254e-02 2.759350e-02 2.179847e-02 South Carolina 2.324954e-02 9.497221e-02 8.041860e-03 2.134047e-03 6.703334e-03 South Dakota 7.633744e-03 9.439947e-03 1.987309e-02 3.083485e-02 2.143524e-02 Tennessee 3.071643e-03 4.822749e-02 3.560533e-03 3.559212e-03 6.063282e-04 Texas 2.026340e-03 2.762490e-02 5.618150e-03 1.066611e-02 5.283880e-03 Utah 2.427031e-02 3.066053e-03 4.675147e-02 6.313413e-02 4.930443e-02 Vermont 2.399626e-02 6.294980e-03 5.036754e-02 6.532154e-02 5.020541e-02 Virginia 1.673152e-03 2.644005e-02 6.091605e-03 1.145122e-02 6.009543e-03 Washington 5.150540e-03 1.322498e-02 1.929169e-02 2.878793e-02 1.985784e-02 West Virginia 6.385351e-03 1.390292e-02 1.342271e-02 2.281872e-02 1.466805e-02 Wisconsin 1.345532e-01 4.043128e-02 1.750632e-01 2.077000e-01 1.823023e-01 Wyoming 3.633080e-03 3.195394e-02 2.457132e-03 7.409965e-03 4.245507e-03 Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho 1.990339e-01 Illinois 2.632279e-01 5.379931e-03 Indiana 1.395904e-01 6.780108e-03 2.205761e-02 Iowa 3.790881e-02 6.765109e-02 1.091989e-01 3.649218e-02 Kansas 1.422491e-01 5.429697e-03 2.046115e-02 3.536739e-04 3.651597e-02 Kentucky 1.824912e-01 2.384704e-03 9.191764e-03 3.512341e-03 6.036584e-02 Louisiana 3.061521e-01 1.425023e-02 2.156095e-03 3.640891e-02 1.396239e-01 Maine 1.345890e-01 8.502788e-03 2.616564e-02 4.135216e-03 3.089306e-02 Maryland 3.341347e-01 2.063327e-02 5.154260e-03 4.705334e-02 1.594608e-01 Massachusetts 1.484765e-01 4.612896e-03 1.919355e-02 2.531912e-03 3.827980e-02 Michigan 2.842661e-01 1.030050e-02 1.585992e-03 2.832407e-02 1.258096e-01 Minnesota 5.190890e-02 5.057820e-02 8.742325e-02 2.387198e-02 1.396741e-03 Mississippi 3.758154e-01 3.366979e-02 1.222557e-02 6.527868e-02 1.903349e-01 Missouri 2.228378e-01 2.255749e-03 2.922317e-03 1.067290e-02 8.504083e-02 Montana 1.783628e-01 1.229998e-03 9.398351e-03 2.682485e-03 5.688266e-02 Nebraska 1.298921e-01 8.046272e-03 2.577290e-02 7.111509e-04 3.003748e-02 Nevada 2.610996e-01 8.526555e-03 3.337257e-03 2.163609e-02 1.122135e-01 New Hampshire 4.454854e-02 6.115992e-02 1.008649e-01 3.279011e-02 3.996903e-04 New Jersey 1.512033e-01 4.000657e-03 1.759539e-02 1.781567e-03 4.018798e-02 New Mexico 3.162270e-01 1.649036e-02 3.390973e-03 3.986052e-02 1.473085e-01 New York 2.592807e-01 4.874900e-03 2.952338e-05 2.072973e-02 1.067809e-01 North Carolina 4.068527e-01 4.344118e-02 1.864912e-02 8.003902e-02 2.127797e-01 North Dakota 4.597274e-02 6.035991e-02 1.000883e-01 3.281848e-02 6.178798e-04 Ohio 1.226853e-01 1.042597e-02 2.922931e-02 7.042915e-04 2.733879e-02 Oklahoma 1.967677e-01 2.785864e-04 5.488156e-03 5.666937e-03 6.712479e-02 Oregon 2.068449e-01 2.159756e-03 5.936724e-03 7.749894e-03 7.566239e-02 Pennsylvania 1.086320e-01 1.531765e-02 3.741609e-02 3.704219e-03 1.964363e-02 Rhode Island 1.855875e-01 2.930137e-03 1.140893e-02 9.195867e-03 5.837039e-02 South Carolina 3.720937e-01 3.225303e-02 1.146206e-02 6.328007e-02 1.877693e-01 South Dakota 1.628358e-01 2.188727e-03 1.343895e-02 1.309117e-03 4.750048e-02 Tennessee 2.688943e-01 8.405424e-03 1.500294e-03 2.340434e-02 1.159836e-01 Texas 2.232540e-01 1.749563e-03 2.122004e-03 1.090795e-02 8.422572e-02 Utah 1.094127e-01 1.460484e-02 3.696765e-02 2.652077e-03 2.087052e-02 Vermont 1.071266e-01 1.697075e-02 3.944358e-02 2.763198e-03 2.194224e-02 Virginia 2.196922e-01 1.325822e-03 2.443023e-03 1.001784e-02 8.190813e-02 Washington 1.691312e-01 2.319038e-03 1.273583e-02 1.957986e-03 5.222325e-02 West Virginia 1.838983e-01 1.279017e-03 8.299956e-03 4.260338e-03 5.940804e-02 Wisconsin 1.775521e-02 1.077217e-01 1.579718e-01 6.775400e-02 4.996375e-03 Wyoming 2.407667e-01 2.500536e-03 6.058434e-04 1.586757e-02 9.409729e-02 Kansas Kentucky Louisiana Maine Maryland Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 3.413933e-03 Louisiana 3.487880e-02 1.830562e-02 Maine 2.226830e-03 8.655423e-03 4.266149e-02 Maryland 4.541269e-02 2.675133e-02 1.038220e-03 5.408989e-02 Massachusetts 9.956716e-04 4.865874e-03 3.370842e-02 6.438740e-04 4.392895e-02 Michigan 2.777555e-02 1.351101e-02 1.401455e-03 3.698091e-02 2.822822e-03 Minnesota 2.406496e-02 4.419312e-02 1.150082e-01 2.047182e-02 1.330018e-01 Mississippi 6.327660e-02 4.001617e-02 4.303244e-03 7.270274e-02 1.928025e-03 Missouri 1.052265e-02 3.037660e-03 8.460674e-03 1.778571e-02 1.340894e-02 Montana 2.302693e-03 4.895824e-04 1.959521e-02 6.638864e-03 2.764161e-02 Nebraska 3.546244e-04 5.949783e-03 4.188951e-02 1.761155e-03 5.314286e-02 Nevada 2.209639e-02 1.002857e-02 5.111071e-03 3.263397e-02 7.459683e-03 New Hampshire 3.222060e-02 5.491178e-02 1.303266e-01 2.580944e-02 1.496944e-01 New Jersey 5.811392e-04 3.335912e-03 3.134672e-02 1.260340e-03 4.155323e-02 New Mexico 3.869731e-02 2.155498e-02 6.462751e-04 4.779557e-02 3.980691e-04 New York 1.929494e-02 8.326915e-03 2.472009e-03 2.521353e-02 5.666730e-03 North Carolina 7.739899e-02 5.232682e-02 8.886308e-03 8.640939e-02 4.674613e-03 North Dakota 3.204353e-02 5.504202e-02 1.296923e-01 2.522191e-02 1.486951e-01 Ohio 8.238368e-04 6.804647e-03 4.580278e-02 2.921600e-03 5.778454e-02 Oklahoma 4.823358e-03 1.129667e-03 1.402529e-02 9.042964e-03 2.080693e-02 Oregon 7.970968e-03 2.944936e-03 1.341761e-02 1.526616e-02 1.876051e-02 Pennsylvania 2.999750e-03 1.186837e-02 5.618361e-02 2.046267e-03 6.972031e-02 Rhode Island 6.251557e-03 6.259821e-03 2.253085e-02 4.496060e-03 3.074261e-02 South Carolina 6.152750e-02 3.880133e-02 3.955962e-03 7.142648e-02 1.364500e-03 South Dakota 7.686940e-04 1.498021e-03 2.562240e-02 3.802734e-03 3.457605e-02 Tennessee 2.316600e-02 9.784909e-03 2.248668e-03 3.242961e-02 4.971783e-03 Texas 1.015444e-02 2.520034e-03 7.544954e-03 1.598629e-02 1.305795e-02 Utah 2.707971e-03 1.186301e-02 5.589336e-02 3.679958e-03 6.825945e-02 Vermont 3.816868e-03 1.240839e-02 5.811625e-02 7.040948e-03 7.061069e-02 Virginia 9.313147e-03 2.338698e-03 8.363567e-03 1.508274e-02 1.386188e-02 Washington 1.980724e-03 2.071718e-03 2.436757e-02 6.725629e-03 3.224266e-02 West Virginia 3.237584e-03 6.219254e-04 1.784873e-02 6.297237e-03 2.622348e-02 Wisconsin 6.769391e-02 9.834424e-02 1.935374e-01 5.877712e-02 2.167730e-01 Wyoming 1.426223e-02 5.587461e-03 4.924904e-03 1.886974e-02 9.284010e-03 Massachusetts Michigan Minnesota Mississippi Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan 2.818108e-02 Minnesota 2.607022e-02 1.018751e-01 Mississippi 6.121851e-02 8.747300e-03 1.618569e-01 Missouri 1.169438e-02 4.273322e-03 6.532167e-02 2.429867e-02 Montana 3.199379e-03 1.416577e-02 4.104298e-02 4.205291e-02 Nebraska 1.337927e-03 3.396043e-02 1.882172e-02 7.250118e-02 Nevada 2.417700e-02 1.221263e-03 8.930168e-02 1.579986e-02 New Hampshire 3.300724e-02 1.178555e-01 1.133603e-03 1.793715e-01 New Jersey 1.754158e-04 2.586282e-02 2.749825e-02 5.826636e-02 New Mexico 3.802577e-02 1.124533e-03 1.216468e-01 3.819819e-03 New York 1.830225e-02 1.553165e-03 8.517784e-02 1.307679e-02 North Carolina 7.417065e-02 1.460829e-02 1.829054e-01 1.045676e-03 North Dakota 3.244719e-02 1.172037e-01 1.261615e-03 1.785445e-01 Ohio 2.645466e-03 3.724617e-02 1.663616e-02 7.763387e-02 Oklahoma 4.900833e-03 9.786064e-03 4.996134e-02 3.366424e-02 Oregon 9.707501e-03 7.423041e-03 5.691647e-02 3.182351e-02 Pennsylvania 3.511587e-03 4.823849e-02 1.119332e-02 9.065306e-02 Rhode Island 2.879695e-03 2.051664e-02 4.393374e-02 4.428832e-02 South Carolina 5.984211e-02 7.554648e-03 1.592415e-01 1.585223e-04 South Dakota 1.400063e-03 1.950739e-02 3.314123e-02 5.061274e-02 Tennessee 2.417756e-02 4.618749e-04 9.304374e-02 1.156865e-02 Texas 1.039273e-02 4.738986e-03 6.495496e-02 2.316826e-02 Utah 4.350079e-03 4.590636e-02 1.157226e-02 9.039427e-02 Vermont 7.131098e-03 4.684986e-02 1.232939e-02 9.309277e-02 Virginia 9.608078e-03 5.093389e-03 6.282774e-02 2.454924e-02 Washington 3.457651e-03 1.711751e-02 3.683217e-02 4.853774e-02 West Virginia 3.134844e-03 1.412087e-02 4.367142e-02 3.935344e-02 Wisconsin 6.938415e-02 1.782120e-01 1.164013e-02 2.513628e-01 Wyoming 1.302329e-02 3.568996e-03 7.398726e-02 1.810847e-02 Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana 3.039731e-03 Nebraska 1.444884e-02 4.381148e-03 Nevada 2.301358e-03 1.045786e-02 2.746649e-02 New Hampshire 7.875478e-02 5.150515e-02 2.619027e-02 1.056052e-01 New Jersey 9.984500e-03 2.176395e-03 1.239889e-03 2.176839e-02 New Mexico 9.509025e-03 2.233580e-02 4.588646e-02 4.415361e-03 New York 2.371824e-03 8.547907e-03 2.449080e-02 2.934970e-03 North Carolina 3.365669e-02 5.394955e-02 8.729604e-02 2.334904e-02 North Dakota 7.833782e-02 5.124112e-02 2.595085e-02 1.051308e-01 Ohio 1.647487e-02 5.611184e-03 2.733299e-04 2.989609e-02 Oklahoma 1.517017e-03 5.727171e-04 7.578553e-03 7.491503e-03 Oregon 6.928513e-04 2.198484e-03 1.107861e-02 3.895206e-03 Pennsylvania 2.452714e-02 1.035036e-02 1.570856e-03 4.115819e-02 Rhode Island 9.696117e-03 4.768467e-03 8.009992e-03 2.017624e-02 South Carolina 2.271408e-02 4.049800e-02 7.056938e-02 1.397499e-02 South Dakota 5.786753e-03 4.845911e-04 2.037677e-03 1.509254e-02 Tennessee 2.685147e-03 1.091664e-02 2.900507e-02 9.012386e-04 Texas 4.976872e-04 2.859597e-03 1.417073e-02 3.817432e-03 Utah 2.248185e-02 9.578964e-03 1.151913e-03 3.742808e-02 Vermont 2.304317e-02 1.059336e-02 2.328524e-03 3.703120e-02 Virginia 3.336427e-04 2.391759e-03 1.311941e-02 3.825823e-03 Washington 4.438807e-03 7.233557e-04 3.427053e-03 1.200006e-02 West Virginia 3.757909e-03 5.965854e-04 5.620927e-03 1.177802e-02 Wisconsin 1.296044e-01 9.435780e-02 5.891933e-02 1.624395e-01 Wyoming 1.739357e-03 5.531091e-03 1.872505e-02 4.356573e-03 New Hampshire New Jersey New Mexico New York Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 3.498715e-02 New Mexico 1.382574e-01 3.564405e-02 New York 9.865040e-02 1.667060e-02 3.692938e-03 North Carolina 2.009373e-01 7.141080e-02 7.683278e-03 1.980486e-02 North Dakota 9.754942e-05 3.463353e-02 1.373768e-01 9.792323e-02 Ohio 2.400214e-02 2.315778e-03 5.002431e-02 2.779151e-02 Oklahoma 6.095426e-02 3.894465e-03 1.638909e-02 4.874300e-03 Oregon 7.021423e-02 8.293527e-03 1.399678e-02 5.179480e-03 Pennsylvania 1.615298e-02 3.794255e-03 6.180421e-02 3.599942e-02 Rhode Island 5.104767e-02 3.150699e-03 2.694574e-02 1.109055e-02 South Carolina 1.771396e-01 5.694764e-02 2.965663e-03 1.223833e-02 South Dakota 4.249205e-02 7.932132e-04 2.873962e-02 1.248698e-02 Tennessee 1.084637e-01 2.168984e-02 2.703076e-03 1.305972e-03 Texas 7.735017e-02 8.773200e-03 9.582880e-03 1.700470e-03 Utah 1.814444e-02 4.623593e-03 5.982581e-02 3.540061e-02 Vermont 2.001358e-02 6.893812e-03 6.155388e-02 3.765837e-02 Virginia 7.521147e-02 8.109076e-03 1.020327e-02 1.982409e-03 Washington 4.761185e-02 2.707321e-03 2.623637e-02 1.171654e-02 West Virginia 5.327645e-02 2.125392e-03 2.154396e-02 7.624617e-03 Wisconsin 6.851331e-03 7.207460e-02 2.030378e-01 1.551898e-01 Wyoming 8.625614e-02 1.171561e-02 6.798845e-03 4.755544e-04 North Carolina North Dakota Ohio Oklahoma Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota 1.996933e-01 Ohio 9.337913e-02 2.403302e-02 Oklahoma 4.410526e-02 6.046065e-02 9.486260e-03 Oregon 4.195308e-02 6.965968e-02 1.282594e-02 1.507562e-03 Pennsylvania 1.070592e-01 1.613757e-02 1.299641e-03 1.483403e-02 Rhode Island 5.431806e-02 5.011333e-02 1.076336e-02 4.059749e-03 South Carolina 1.292100e-03 1.762170e-01 7.565745e-02 3.227478e-02 South Dakota 6.322880e-02 4.214087e-02 3.116261e-03 1.766992e-03 Tennessee 1.873623e-02 1.081492e-01 3.166727e-02 7.416755e-03 Texas 3.244859e-02 7.701298e-02 1.634538e-02 1.145361e-03 Utah 1.065685e-01 1.786942e-02 8.706270e-04 1.413252e-02 Vermont 1.101292e-01 2.004842e-02 1.376776e-03 1.575535e-02 Virginia 3.390668e-02 7.478930e-02 1.529539e-02 8.179561e-04 Washington 6.076022e-02 4.711875e-02 4.543149e-03 1.824427e-03 West Virginia 5.091355e-02 5.310067e-02 7.084686e-03 7.430809e-04 Wisconsin 2.765112e-01 7.312103e-03 5.510202e-02 1.071968e-01 Wyoming 2.574505e-02 8.554313e-02 2.179048e-02 2.614155e-03 Oregon Pennsylvania Rhode Island South Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania 2.066515e-02 Rhode Island 9.993923e-03 1.191372e-02 South Carolina 2.968605e-02 8.905882e-02 4.368561e-02 South Dakota 4.128700e-03 6.612715e-03 4.303823e-03 4.893620e-02 Tennessee 5.626792e-03 4.202938e-02 1.805023e-02 1.049161e-02 Texas 1.944419e-03 2.329897e-02 7.177902e-03 2.210892e-02 Utah 1.744046e-02 1.266624e-03 1.420959e-02 8.794858e-02 Vermont 1.757301e-02 2.982420e-03 1.885479e-02 9.032980e-02 Virginia 1.400534e-03 2.221550e-02 6.862824e-03 2.332189e-02 Washington 2.261741e-03 9.572095e-03 6.904314e-03 4.633512e-02 West Virginia 3.946058e-03 1.093856e-02 2.968666e-03 3.839770e-02 Wisconsin 1.183293e-01 4.345579e-02 9.402751e-02 2.488321e-01 Wyoming 3.943917e-03 2.864360e-02 7.063526e-03 1.727931e-02 South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee 1.585995e-02 Texas 5.518434e-03 2.933044e-03 Utah 5.971738e-03 4.029836e-02 2.280962e-02 Vermont 7.283220e-03 4.080774e-02 2.418612e-02 7.075973e-04 Virginia 4.838680e-03 3.331000e-03 5.841769e-05 2.134294e-02 2.267907e-02 Washington 6.418151e-04 1.399898e-02 5.236926e-03 7.201951e-03 7.738360e-03 West Virginia 1.231499e-03 1.078105e-02 2.518222e-03 1.181068e-02 1.367590e-02 Wisconsin 8.228818e-02 1.664591e-01 1.281391e-01 4.604267e-02 4.736804e-02 Wyoming 8.557034e-03 2.739040e-03 7.754091e-04 2.855048e-02 3.110379e-02 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 4.371898e-03 West Virginia 2.341444e-03 2.516785e-03 Wisconsin 1.254636e-01 8.875528e-02 9.687671e-02 Wyoming 9.262637e-04 8.423664e-03 4.534013e-03 1.398206e-01 K-means clustering with 4 clusters of sizes 6, 12, 13, 19 Cluster means: Murder Assault UrbanPop Rape 1 2.616667 54.83333 62.00000 12.33333 2 4.791667 109.25000 66.58333 16.05833 3 6.753846 149.84615 64.92308 20.66923 4 12.021053 260.52632 66.42105 27.69474 Clustering vector: Alabama Alaska Arizona Arkansas California 4 4 4 4 4 Colorado Connecticut Delaware Florida Georgia 3 2 4 4 4 Hawaii Idaho Illinois Indiana Iowa 1 3 4 2 1 Kansas Kentucky Louisiana Maine Maryland 2 3 4 2 4 Massachusetts Michigan Minnesota Mississippi Missouri 2 4 1 4 3 Montana Nebraska Nevada New Hampshire New Jersey 3 2 4 1 2 New Mexico New York North Carolina North Dakota Ohio 4 4 4 1 2 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 3 3 2 3 4 South Dakota Tennessee Texas Utah Vermont 2 4 3 2 2 Virginia Washington West Virginia Wisconsin Wyoming 3 3 3 1 3 Within cluster sum of squares by cluster: [1] 1.765606e-06 9.227279e-06 3.860314e-06 5.013077e-06 Available components: [1] "cluster" "centers" "withinss" "size" wardabspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : abspearson Number of objects: 50 singleabspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : abspearson Number of objects: 50 completeabspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : abspearson Number of objects: 50 averageabspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : abspearson Number of objects: 50 mcquittyabspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : abspearson Number of objects: 50 medianabspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : abspearson Number of objects: 50 centroidabspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : abspearson Number of objects: 50 centroid2abspearson Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : abspearson Number of objects: 50 Alabama Alaska Arizona Arkansas California Alaska 9.074976e-03 Arizona 1.430158e-03 1.030379e-02 Arkansas 3.808145e-04 9.343801e-03 3.351289e-04 California 6.187049e-03 1.615382e-02 1.694322e-03 3.513810e-03 Colorado 1.398519e-02 2.441453e-02 6.523358e-03 9.782688e-03 1.575649e-03 Connecticut 1.254392e-01 1.782090e-01 1.083457e-01 1.163327e-01 8.948292e-02 Delaware 3.764497e-03 2.078503e-02 1.896355e-03 2.449370e-03 2.507609e-03 Florida 1.140702e-04 7.354985e-03 1.177936e-03 3.047304e-04 5.676877e-03 Georgia 1.653240e-04 1.029876e-02 7.306609e-04 1.005191e-04 4.479689e-03 Hawaii 6.732324e-01 7.530580e-01 6.342841e-01 6.530622e-01 5.878124e-01 Idaho 2.886980e-02 5.523142e-02 1.977125e-02 2.383795e-02 1.182739e-02 Illinois 5.387816e-03 2.272581e-02 2.450184e-03 3.521504e-03 1.882987e-03 Indiana 6.209755e-02 9.581262e-02 4.810350e-02 5.455576e-02 3.422779e-02 Iowa 2.942405e-01 3.604232e-01 2.663998e-01 2.796569e-01 2.343439e-01 Kansas 6.405805e-02 1.004948e-01 5.049651e-02 5.674189e-02 3.687603e-02 Kentucky 2.705832e-02 5.599008e-02 1.924672e-02 2.269164e-02 1.250165e-02 Louisiana 2.033590e-04 1.172521e-02 1.196530e-03 3.602470e-04 5.302030e-03 Maine 8.728158e-02 1.329940e-01 7.299691e-02 7.960645e-02 5.782217e-02 Maryland 3.370563e-04 5.928568e-03 1.629610e-03 6.447922e-04 6.495491e-03 Massachusetts 6.784543e-02 1.080002e-01 5.482537e-02 6.081244e-02 4.149623e-02 Michigan 1.984378e-03 9.362117e-03 9.586539e-05 6.520520e-04 1.406595e-03 Minnesota 2.385755e-01 2.979766e-01 2.125581e-01 2.249085e-01 1.831794e-01 Mississippi 3.197143e-03 7.330787e-03 8.368882e-03 5.507089e-03 1.749780e-02 Missouri 1.278454e-02 2.917228e-02 6.283758e-03 9.081342e-03 1.931418e-03 Montana 3.373501e-02 6.175820e-02 2.387844e-02 2.831475e-02 1.497844e-02 Nebraska 7.924959e-02 1.178981e-01 6.386131e-02 7.099754e-02 4.805593e-02 Nevada 6.011885e-03 1.084277e-02 1.780354e-03 3.470171e-03 7.477442e-04 New Hampshire 2.734440e-01 3.404163e-01 2.473245e-01 2.597417e-01 2.171395e-01 New Jersey 6.115040e-02 1.002527e-01 4.899926e-02 5.456278e-02 3.670736e-02 New Mexico 6.487958e-04 6.135366e-03 7.460254e-04 3.396609e-04 4.334715e-03 New York 5.748474e-03 2.293982e-02 2.544324e-03 3.744648e-03 1.700354e-03 North Carolina 4.647987e-03 6.507934e-03 1.028120e-02 7.195204e-03 2.006853e-02 North Dakota 2.715277e-01 3.372644e-01 2.451167e-01 2.576735e-01 2.147176e-01 Ohio 8.338657e-02 1.229663e-01 6.764535e-02 7.495444e-02 5.137583e-02 Oklahoma 2.587197e-02 5.163479e-02 1.741102e-02 2.116773e-02 1.020797e-02 Oregon 2.170235e-02 3.695025e-02 1.238747e-02 1.654929e-02 5.062574e-03 Pennsylvania 1.101078e-01 1.589750e-01 9.360353e-02 1.012974e-01 7.572235e-02 Rhode Island 4.812256e-02 8.757412e-02 3.893357e-02 4.305922e-02 2.984781e-02 South Carolina 2.794305e-03 4.907881e-03 7.035191e-03 4.622417e-03 1.531563e-02 South Dakota 4.697548e-02 7.859289e-02 3.521202e-02 4.057811e-02 2.394620e-02 Tennessee 1.872822e-03 1.208320e-02 7.522718e-05 5.891533e-04 1.274168e-03 Texas 1.256556e-02 3.418489e-02 7.327411e-03 9.517218e-03 3.944361e-03 Utah 1.079317e-01 1.479852e-01 8.900199e-02 9.786319e-02 6.917741e-02 Vermont 1.056208e-01 1.418652e-01 8.606431e-02 9.522557e-02 6.585780e-02 Virginia 1.431624e-02 3.543291e-02 8.251699e-03 1.084171e-02 4.011554e-03 Washington 4.323450e-02 6.788332e-02 3.057976e-02 3.637141e-02 1.888759e-02 West Virginia 3.240251e-02 6.510028e-02 2.446101e-02 2.797308e-02 1.727660e-02 Wisconsin 4.124673e-01 4.894121e-01 3.815031e-01 3.963213e-01 3.448349e-01 Wyoming 1.088461e-02 3.250546e-02 6.384162e-03 8.216390e-03 3.799824e-03 Colorado Connecticut Delaware Florida Georgia Alaska Arizona Arkansas California Colorado Connecticut 7.546171e-02 Delaware 6.538017e-03 8.669546e-02 Florida 1.316819e-02 1.278020e-01 4.277540e-03 Georgia 1.133675e-02 1.171867e-01 2.426070e-03 2.805297e-04 Hawaii 5.463653e-01 2.586307e-01 5.929808e-01 6.761814e-01 6.564484e-01 Idaho 7.811527e-03 3.686702e-02 1.216289e-02 2.946459e-02 2.472970e-02 Illinois 4.780115e-03 8.023965e-02 2.050245e-04 5.804303e-03 3.701418e-03 Indiana 2.461410e-02 1.447701e-02 3.606009e-02 6.286649e-02 5.599220e-02 Iowa 2.075034e-01 4.032561e-02 2.356589e-01 2.968049e-01 2.818148e-01 Kansas 2.758820e-02 1.207273e-02 3.728408e-02 6.515411e-02 5.791635e-02 Kentucky 9.729474e-03 3.722947e-02 1.071699e-02 2.806520e-02 2.315428e-02 Louisiana 1.254673e-02 1.164966e-01 2.339249e-03 5.096810e-04 8.329132e-05 Maine 4.725479e-02 3.648331e-03 5.529807e-02 8.924159e-02 8.033769e-02 Maryland 1.428912e-02 1.337062e-01 5.518249e-03 8.573684e-05 6.755946e-04 Massachusetts 3.259493e-02 9.417965e-03 4.000009e-02 6.938344e-02 6.163863e-02 Michigan 5.816708e-03 1.096187e-01 2.584483e-03 1.527138e-03 1.236747e-03 Minnesota 1.588760e-01 2.170845e-02 1.855725e-01 2.406281e-01 2.271444e-01 Mississippi 2.935591e-02 1.654343e-01 1.360760e-02 3.273826e-03 4.814255e-03 Missouri 1.120573e-03 6.556326e-02 3.775743e-03 1.268010e-02 1.006247e-02 Montana 1.007658e-02 3.182571e-02 1.534768e-02 3.440889e-02 2.925834e-02 Nebraska 3.668209e-02 7.478982e-03 4.921823e-02 8.036003e-02 7.240668e-02 Nevada 2.802721e-03 1.041493e-01 4.973858e-03 5.018727e-03 4.702367e-03 New Hampshire 1.921920e-01 3.174537e-02 2.166672e-01 2.762765e-01 2.615031e-01 New Jersey 2.879477e-02 1.206127e-02 3.485140e-02 6.268205e-02 5.527702e-02 New Mexico 1.089030e-02 1.263698e-01 4.462845e-03 2.420422e-04 6.272953e-04 New York 4.324466e-03 7.916877e-02 3.150006e-04 6.118239e-03 3.989339e-03 North Carolina 3.248745e-02 1.755206e-01 1.662712e-02 4.554345e-03 6.546806e-03 North Dakota 1.895303e-01 3.132653e-02 2.149791e-01 2.741991e-01 2.595744e-01 Ohio 3.957062e-02 6.341252e-03 5.248968e-02 8.455143e-02 7.637666e-02 Oklahoma 6.897811e-03 4.001260e-02 1.020911e-02 2.648132e-02 2.196524e-02 Oregon 1.318412e-03 5.761301e-02 9.829559e-03 2.115046e-02 1.818552e-02 Pennsylvania 6.257230e-02 6.346078e-04 7.392715e-02 1.121364e-01 1.022817e-01 Rhode Island 2.508150e-02 1.946458e-02 2.524691e-02 5.003645e-02 4.313941e-02 South Carolina 2.629212e-02 1.641083e-01 1.302408e-02 2.555120e-03 4.251135e-03 South Dakota 1.683245e-02 2.149923e-02 2.462051e-02 4.779061e-02 4.168807e-02 Tennessee 5.665101e-03 1.028980e-01 1.295115e-03 1.710313e-03 9.778609e-04 Texas 4.233982e-03 6.034955e-02 2.675487e-03 1.313844e-02 9.906990e-03 Utah 5.388092e-02 5.262845e-03 7.289895e-02 1.087805e-01 9.990796e-02 Vermont 5.008010e-02 8.859050e-03 7.159077e-02 1.060095e-01 9.764121e-02 Virginia 3.452354e-03 5.769581e-02 3.666739e-03 1.474005e-02 1.143492e-02 Washington 1.115517e-02 3.017928e-02 2.301283e-02 4.323956e-02 3.810603e-02 West Virginia 1.418203e-02 3.137079e-02 1.416484e-02 3.377610e-02 2.822414e-02 Wisconsin 3.135298e-01 9.408378e-02 3.445757e-01 4.158451e-01 3.983843e-01 Wyoming 4.866008e-03 6.375716e-02 1.876205e-03 1.154564e-02 8.452577e-03 Hawaii Idaho Illinois Indiana Iowa Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho 4.577742e-01 Illinois 5.770235e-01 9.417114e-03 Indiana 3.666838e-01 6.424493e-03 3.127254e-02 Iowa 1.000986e-01 1.464509e-01 2.246581e-01 9.372643e-02 Kansas 3.613977e-01 7.187131e-03 3.259544e-02 2.385679e-04 9.024350e-02 Kentucky 4.640278e-01 4.590237e-04 8.398644e-03 8.031629e-03 1.497014e-01 Louisiana 6.563738e-01 2.496216e-02 3.743961e-03 5.634822e-02 2.815127e-01 Maine 3.175245e-01 1.757949e-02 5.010164e-02 4.479124e-03 6.710780e-02 Maryland 6.867285e-01 3.220086e-02 7.167215e-03 6.671805e-02 3.049530e-01 Massachusetts 3.538220e-01 9.117451e-03 3.542665e-02 1.329233e-03 8.574092e-02 Michigan 6.345837e-01 2.010625e-02 2.999141e-03 4.828916e-02 2.671625e-01 Minnesota 1.385269e-01 1.062679e-01 1.754780e-01 6.161952e-02 3.598257e-03 Mississippi 7.486415e-01 5.093177e-02 1.673942e-02 9.268591e-02 3.519333e-01 Missouri 5.333065e-01 4.221023e-03 2.246785e-03 2.009171e-02 1.962375e-01 Montana 4.412824e-01 1.958289e-04 1.227445e-02 4.409532e-03 1.363076e-01 Nebraska 3.306067e-01 1.282337e-02 4.377597e-02 1.218173e-03 7.431295e-02 Nevada 6.140384e-01 1.782210e-02 4.561864e-03 4.294760e-02 2.544632e-01 New Hampshire 1.144742e-01 1.319665e-01 2.063207e-01 8.258582e-02 7.233602e-04 New Jersey 3.686331e-01 6.950602e-03 3.063575e-02 1.359099e-03 9.368611e-02 New Mexico 6.704558e-01 2.814302e-02 5.665704e-03 6.063351e-02 2.931923e-01 New York 5.740270e-01 8.918483e-03 1.288113e-05 3.036633e-02 2.226576e-01 North Carolina 7.655905e-01 5.635604e-02 1.998073e-02 9.986011e-02 3.654627e-01 North Dakota 1.152187e-01 1.302720e-01 2.045534e-01 8.100070e-02 6.147553e-04 Ohio 3.228093e-01 1.456593e-02 4.688904e-02 1.796726e-03 7.034262e-02 Oklahoma 4.684667e-01 8.700334e-05 7.719537e-03 7.980209e-03 1.530086e-01 Oregon 5.014375e-01 3.486063e-03 7.259701e-03 1.469515e-02 1.772426e-01 Pennsylvania 2.793952e-01 2.818049e-02 6.779897e-02 9.063731e-03 4.916610e-02 Rhode Island 4.048043e-01 5.061665e-03 2.215058e-02 4.879275e-03 1.140755e-01 South Carolina 7.443013e-01 4.910542e-02 1.585254e-02 9.015983e-02 3.489513e-01 South Dakota 4.026800e-01 2.248799e-03 2.073531e-02 1.124841e-03 1.134821e-01 Tennessee 6.233637e-01 1.747639e-02 1.680845e-03 4.456893e-02 2.583471e-01 Texas 5.279940e-01 3.440975e-03 1.503453e-03 1.918696e-02 1.912433e-01 Utah 2.833643e-01 2.591855e-02 6.606093e-02 6.585748e-03 5.274718e-02 Vermont 2.905931e-01 2.518978e-02 6.460572e-02 6.538369e-03 5.769875e-02 Virginia 5.191079e-01 2.555059e-03 2.193899e-03 1.703648e-02 1.856404e-01 Washington 4.196499e-01 2.340391e-03 1.895374e-02 2.886666e-03 1.255116e-01 West Virginia 4.472656e-01 1.338683e-03 1.170695e-02 6.838019e-03 1.391806e-01 Wisconsin 4.504819e-02 2.382714e-01 3.320116e-01 1.712942e-01 1.252331e-02 Wyoming 5.378582e-01 4.569299e-03 9.828208e-04 2.164577e-02 1.976912e-01 Kansas Kentucky Louisiana Maine Maryland Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky 8.231510e-03 Louisiana 5.800286e-02 2.300848e-02 Maine 2.869001e-03 1.767247e-02 7.980833e-02 Maryland 6.921995e-02 3.092632e-02 9.957310e-04 9.423520e-02 Massachusetts 4.419740e-04 9.414726e-03 6.136307e-02 1.393042e-03 7.374682e-02 Michigan 5.097007e-02 1.998809e-02 1.881166e-03 7.411831e-02 1.880850e-03 Minnesota 5.909145e-02 1.096463e-01 2.271411e-01 4.157692e-02 2.479674e-01 Mississippi 9.484420e-02 4.814828e-02 4.680136e-03 1.216214e-01 2.720910e-03 Missouri 2.203860e-02 4.901044e-03 1.068546e-02 3.885815e-02 1.426624e-02 Montana 5.013493e-03 7.611294e-04 2.947079e-02 1.418495e-02 3.736587e-02 Nebraska 8.540941e-04 1.436877e-02 7.257680e-02 1.631358e-03 8.479441e-02 Nevada 4.633035e-02 1.908370e-02 5.874083e-03 7.006485e-02 5.341845e-03 New Hampshire 7.881256e-02 1.343524e-01 2.609117e-01 5.630972e-02 2.843388e-01 New Jersey 5.297329e-04 7.009590e-03 5.496123e-02 2.461325e-03 6.687035e-02 New Mexico 6.332029e-02 2.740916e-02 1.128056e-03 8.805222e-02 2.498186e-04 New York 3.174793e-02 8.037402e-03 4.081172e-03 4.924798e-02 7.490796e-03 North Carolina 1.022889e-01 5.368020e-02 6.515884e-03 1.303539e-01 3.753010e-03 North Dakota 7.746123e-02 1.329554e-01 2.591201e-01 5.558310e-02 2.821718e-01 Ohio 1.328512e-03 1.613915e-02 7.652385e-02 1.402451e-03 8.910399e-02 Oklahoma 8.752525e-03 3.473335e-04 2.215332e-02 1.971990e-02 2.910604e-02 Oregon 1.718247e-02 5.560576e-03 1.929343e-02 3.358031e-02 2.287855e-02 Pennsylvania 7.215542e-03 2.881808e-02 1.018147e-01 1.437607e-03 1.176229e-01 Rhode Island 3.621587e-03 3.769320e-03 4.238067e-02 6.546666e-03 5.399523e-02 South Carolina 9.275539e-02 4.700808e-02 4.404341e-03 1.203531e-01 1.896234e-03 South Dakota 1.414029e-03 3.161479e-03 4.189336e-02 7.795678e-03 5.124937e-02 Tennessee 4.681200e-02 1.693083e-02 1.395769e-03 6.849300e-02 2.316956e-03 Texas 2.016936e-02 2.849607e-03 9.953212e-03 3.458175e-02 1.509736e-02 Utah 6.413903e-03 2.882954e-02 1.004581e-01 4.679230e-03 1.136635e-01 Vermont 7.035820e-03 2.889779e-02 9.857129e-02 7.202806e-03 1.105947e-01 Virginia 1.820585e-02 2.396213e-03 1.163700e-02 3.260704e-02 1.672477e-02 Washington 4.362227e-03 4.598711e-03 3.896892e-02 1.427998e-02 4.613166e-02 West Virginia 6.472128e-03 4.215431e-04 2.780838e-02 1.374143e-02 3.699779e-02 Wisconsin 1.662233e-01 2.414187e-01 3.976134e-01 1.332780e-01 4.253112e-01 Wyoming 2.252881e-02 3.652983e-03 8.393472e-03 3.719055e-02 1.344029e-02 Massachusetts Michigan Minnesota Mississippi Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan 5.568505e-02 Minnesota 5.598960e-02 2.130320e-01 Mississippi 9.896462e-02 9.103637e-03 2.920462e-01 Missouri 2.565513e-02 6.207400e-03 1.493703e-01 2.858318e-02 Montana 6.707812e-03 2.423252e-02 9.757310e-02 5.726735e-02 Nebraska 1.075780e-03 6.423722e-02 4.611964e-02 1.130583e-01 Nevada 5.196229e-02 1.117471e-03 2.010167e-01 1.550827e-02 New Hampshire 7.396436e-02 2.484091e-01 2.332809e-03 3.291263e-01 New Jersey 1.894932e-04 4.990557e-02 6.255830e-02 9.083043e-02 New Mexico 6.807942e-02 8.039214e-04 2.369434e-01 4.591026e-03 New York 3.465457e-02 3.040318e-03 1.736083e-01 1.741160e-02 North Carolina 1.067867e-01 1.090400e-02 3.044343e-01 1.840015e-04 North Dakota 7.293050e-02 2.460555e-01 1.791346e-03 3.272493e-01 Ohio 1.396825e-03 6.804363e-02 4.299778e-02 1.179202e-01 Oklahoma 1.071047e-02 1.779504e-02 1.119986e-01 4.692268e-02 Oregon 2.148120e-02 1.178698e-02 1.322223e-01 4.089419e-02 Pennsylvania 5.349924e-03 9.464583e-02 2.767723e-02 1.482428e-01 Rhode Island 2.759848e-03 4.032131e-02 8.044212e-02 7.399693e-02 South Carolina 9.745947e-02 7.462303e-03 2.888054e-01 2.584835e-04 South Dakota 2.629287e-03 3.556709e-02 7.821005e-02 7.403684e-02 Tennessee 5.092842e-02 2.225546e-04 2.053133e-01 9.680903e-03 Texas 2.248588e-02 7.869609e-03 1.457036e-01 2.818102e-02 Utah 6.806483e-03 8.895503e-02 2.906302e-02 1.467783e-01 Vermont 8.337522e-03 8.561126e-02 3.271721e-02 1.442180e-01 Virginia 2.076240e-02 8.626049e-03 1.405234e-01 3.088233e-02 Washington 7.192417e-03 3.023162e-02 8.773179e-02 6.949892e-02 West Virginia 6.871682e-03 2.548909e-02 1.010646e-01 5.472791e-02 Wisconsin 1.593622e-01 3.827006e-01 2.943651e-02 4.770919e-01 Wyoming 2.472380e-02 7.039971e-03 1.515839e-01 2.552396e-02 Missouri Montana Nebraska Nevada Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana 6.171962e-03 Nebraska 3.095203e-02 9.861539e-03 Nevada 4.750634e-03 2.154367e-02 5.838248e-02 New Hampshire 1.801739e-01 1.223213e-01 6.419919e-02 2.372406e-01 New Jersey 2.193978e-02 4.913073e-03 1.967879e-03 4.675980e-02 New Mexico 1.127645e-02 3.299481e-02 7.813863e-02 3.283538e-03 New York 1.921859e-03 1.171640e-02 4.277220e-02 4.367653e-03 North Carolina 3.230755e-02 6.302909e-02 1.210870e-01 1.738284e-02 North Dakota 1.780106e-01 1.206787e-01 6.285979e-02 2.344930e-01 Ohio 3.363882e-02 1.139639e-02 5.685156e-05 6.201788e-02 Oklahoma 3.308768e-03 5.287462e-04 1.492555e-02 1.595370e-02 Oregon 1.433708e-03 4.742502e-03 2.431089e-02 7.889494e-03 Pennsylvania 5.379445e-02 2.375939e-02 3.770670e-03 8.916964e-02 Rhode Island 1.721085e-02 3.857385e-03 7.111440e-03 3.963982e-02 South Carolina 2.647106e-02 5.538897e-02 1.106557e-01 1.285082e-02 South Dakota 1.232631e-02 1.119271e-03 4.343808e-03 3.178208e-02 Tennessee 5.104304e-03 2.135235e-02 5.975182e-02 1.783447e-03 Texas 1.012227e-03 5.224375e-03 2.917963e-02 8.117571e-03 Utah 4.874226e-02 2.171305e-02 2.654310e-03 8.036983e-02 Vermont 4.638484e-02 2.119826e-02 3.431426e-03 7.602573e-02 Virginia 6.501680e-04 4.155494e-03 2.672837e-02 8.136819e-03 Washington 9.208389e-03 1.668455e-03 7.731955e-03 2.482234e-02 West Virginia 8.155258e-03 1.211055e-03 1.192835e-02 2.496206e-02 Wisconsin 2.994769e-01 2.256071e-01 1.449862e-01 3.686791e-01 Wyoming 1.415708e-03 6.560137e-03 3.203747e-02 7.887858e-03 New Hampshire New Jersey New Mexico New York Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey 8.129350e-02 New Mexico 2.732923e-01 6.156276e-02 New York 2.044885e-01 2.993790e-02 5.877810e-03 North Carolina 3.424737e-01 9.837446e-02 5.813490e-03 2.067956e-02 North Dakota 5.912424e-05 8.025535e-02 2.710014e-01 2.026859e-01 Ohio 6.049338e-02 2.485202e-03 8.230314e-02 4.585839e-02 Oklahoma 1.381052e-01 8.289875e-03 2.531302e-02 7.276272e-03 Oregon 1.630459e-01 1.861112e-02 1.871378e-02 6.664761e-03 Pennsylvania 4.004188e-02 7.455720e-03 1.105231e-01 6.675799e-02 Rhode Island 9.966909e-02 1.600563e-03 4.992227e-02 2.173163e-02 South Carolina 3.267403e-01 8.947547e-02 3.374560e-03 1.642450e-02 South Dakota 1.007843e-01 1.739543e-03 4.608990e-02 2.002354e-02 Tennessee 2.394610e-01 4.530400e-02 1.281661e-03 1.750203e-03 Texas 1.742886e-01 1.872301e-02 1.264201e-02 1.331951e-03 Utah 4.524998e-02 9.065862e-03 1.055379e-01 6.473427e-02 Vermont 5.062906e-02 1.052538e-02 1.022015e-01 6.319485e-02 Virginia 1.692214e-01 1.723093e-02 1.392390e-02 1.942077e-03 Washington 1.134548e-01 6.097298e-03 4.058954e-02 1.811148e-02 West Virginia 1.239115e-01 4.786768e-03 3.343280e-02 1.135904e-02 Wisconsin 1.712766e-02 1.697666e-01 4.122941e-01 3.297774e-01 Wyoming 1.802680e-01 2.072458e-02 1.129277e-02 8.799210e-04 North Carolina North Dakota Ohio Oklahoma Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota 3.404907e-01 Ohio 1.261250e-01 5.919393e-02 Oklahoma 5.216386e-02 1.364245e-01 1.679407e-02 Oregon 4.494900e-02 1.605516e-01 2.666870e-02 3.188907e-03 Pennsylvania 1.577418e-01 3.937338e-02 2.989262e-03 3.100356e-02 Rhode Island 8.108719e-02 9.891155e-02 8.037991e-03 5.711051e-03 South Carolina 3.451176e-04 3.246325e-01 1.155140e-01 4.522892e-02 South Dakota 8.057267e-02 9.923501e-02 5.383842e-03 3.181700e-03 Tennessee 1.182526e-02 2.373095e-01 6.341453e-02 1.524924e-02 Texas 3.235404e-02 1.726065e-01 3.173795e-02 2.438702e-03 Utah 1.555736e-01 4.373469e-02 2.063400e-03 2.895242e-02 Vermont 1.526381e-01 4.878563e-02 2.981646e-03 2.821622e-02 Virginia 3.513154e-02 1.674282e-01 2.920317e-02 1.724589e-03 Washington 7.530451e-02 1.113316e-01 9.059940e-03 3.203952e-03 West Virginia 6.075696e-02 1.227732e-01 1.345185e-02 1.411476e-03 Wisconsin 4.924554e-01 1.776334e-02 1.395074e-01 2.462831e-01 Wyoming 2.957228e-02 1.786542e-01 3.469543e-02 3.396764e-03 Oregon Pennsylvania Rhode Island South Carolina Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania 4.633939e-02 Rhode Island 1.688506e-02 1.408346e-02 South Carolina 3.777776e-02 1.466521e-01 7.359996e-02 South Dakota 9.114300e-03 1.487789e-02 2.792747e-03 7.196578e-02 Tennessee 1.091066e-02 8.854381e-02 3.561902e-02 8.376207e-03 Texas 3.934272e-03 4.948954e-02 1.268069e-02 2.703951e-02 Utah 3.850643e-02 3.117345e-03 1.818404e-02 1.434526e-01 Vermont 3.536863e-02 5.947249e-03 2.027010e-02 1.402743e-01 Virginia 2.728187e-03 4.692846e-02 1.206076e-02 2.942604e-02 Washington 4.814743e-03 2.210984e-02 8.039389e-03 6.637951e-02 West Virginia 8.832404e-03 2.392922e-02 1.734187e-03 5.396548e-02 Wisconsin 2.771145e-01 1.080410e-01 1.947142e-01 4.745022e-01 Wyoming 5.070391e-03 5.271140e-02 1.390326e-02 2.461462e-02 South Dakota Tennessee Texas Utah Vermont Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee 3.214758e-02 Texas 1.112121e-02 5.920991e-03 Utah 1.310033e-02 8.428726e-02 4.798165e-02 Vermont 1.300545e-02 8.155615e-02 4.698186e-02 4.695915e-04 Virginia 9.576908e-03 6.771469e-03 1.254515e-04 4.451661e-02 4.324851e-02 Washington 1.482748e-03 2.792682e-02 1.037760e-02 1.622681e-02 1.446869e-02 West Virginia 2.647154e-03 2.183808e-02 5.069413e-03 2.568471e-02 2.654045e-02 Wisconsin 1.967071e-01 3.721095e-01 2.923844e-01 1.151479e-01 1.222457e-01 Wyoming 1.297814e-02 5.077548e-03 9.609983e-05 5.179474e-02 5.094010e-02 Virginia Washington West Virginia Wisconsin Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington 8.415084e-03 West Virginia 4.662982e-03 5.536062e-03 Wisconsin 2.860111e-01 2.128783e-01 2.275928e-01 Wyoming 4.349517e-04 1.243499e-02 5.926389e-03 2.998325e-01 K-means clustering with 4 clusters of sizes 20, 20, 6, 4 Cluster means: Murder Assault UrbanPop Rape 1 5.020000 117.95000 64.60 16.63500 2 10.990000 235.60000 71.40 27.73500 3 2.616667 54.83333 62.00 12.33333 4 13.375000 284.50000 46.25 25.05000 Clustering vector: Alabama Alaska Arizona Arkansas California 2 4 2 2 2 Colorado Connecticut Delaware Florida Georgia 2 1 2 2 2 Hawaii Idaho Illinois Indiana Iowa 3 1 2 1 3 Kansas Kentucky Louisiana Maine Maryland 1 1 2 1 2 Massachusetts Michigan Minnesota Mississippi Missouri 1 2 3 4 2 Montana Nebraska Nevada New Hampshire New Jersey 1 1 2 3 1 New Mexico New York North Carolina North Dakota Ohio 2 2 4 3 1 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 1 1 1 1 4 South Dakota Tennessee Texas Utah Vermont 1 2 2 1 1 Virginia Washington West Virginia Wisconsin Wyoming 2 1 1 3 2 Within cluster sum of squares by cluster: [1] 1.718668e-05 1.726487e-05 8.814207e-06 1.552004e-08 Available components: [1] "cluster" "centers" "withinss" "size" wardabscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : ward Distance : abscorrelation Number of objects: 50 singleabscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : single Distance : abscorrelation Number of objects: 50 completeabscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : complete Distance : abscorrelation Number of objects: 50 averageabscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : average Distance : abscorrelation Number of objects: 50 mcquittyabscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : mcquitty Distance : abscorrelation Number of objects: 50 medianabscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : median Distance : abscorrelation Number of objects: 50 centroidabscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid Distance : abscorrelation Number of objects: 50 centroid2abscorrelation Call: hcluster(x = USArrests, method = mymethod, link = mylink, nbproc = 4) Cluster method : centroid2 Distance : abscorrelation Number of objects: 50 Warning messages: 1: did not converge in 10 iterations 2: empty cluster: try a better set of initial centers 3: empty cluster: try a better set of initial centers 4: empty cluster: try a better set of initial centers 5: did not converge in 10 iterations > > hc <- hcluster(USArrests, nbproc=1) > print(hc) Call: hcluster(x = USArrests, nbproc = 1) Cluster method : complete Distance : euclidean Number of objects: 50 > > > > > > > KERNELS = c("gaussien", "quartic", "triweight", "epanechikov" , + "cosinus", "uniform") > > for(myKernel in KERNELS) { + myacp = acprob(USArrests, kernel = myKernel); + print(myacp) + } Standard deviations: Comp 1 Comp 2 Comp 3 Comp 4 1.5533005 1.0238885 0.5964794 0.4279277 Eigen values: [1] 3.2817172 1.0106413 0.4610868 0.3944977 Standard deviations: Comp 1 Comp 2 Comp 3 Comp 4 1.5533005 1.0238885 0.5964794 0.4279277 Eigen values: [1] 3.2817172 1.0106413 0.4610868 0.3944977 Standard deviations: Comp 1 Comp 2 Comp 3 Comp 4 1.5533005 1.0238885 0.5964794 0.4279277 Eigen values: [1] 3.2817172 1.0106413 0.4610868 0.3944977 Standard deviations: Comp 1 Comp 2 Comp 3 Comp 4 1.5533005 1.0238885 0.5964794 0.4279277 Eigen values: [1] 3.2817172 1.0106413 0.4610868 0.3944977 Standard deviations: Comp 1 Comp 2 Comp 3 Comp 4 1.5533005 1.0238885 0.5964794 0.4279277 Eigen values: [1] 3.2817172 1.0106413 0.4610868 0.3944977 Standard deviations: Comp 1 Comp 2 Comp 3 Comp 4 1.5533005 1.0238885 0.5964794 0.4279277 Eigen values: [1] 3.2817172 1.0106413 0.4610868 0.3944977 > > > > d <-2 * matrix(c(9, 8, 5, 7, 7, 2 + , 8, 9, 2, 5, 1, 7 + , 5, 2, 9, 8, 7, 1 + , 7, 5, 8, 9, 3, 2 + , 7, 1, 7, 3, 9, 6 + , 2, 7, 1, 2, 6, 9),ncol=6,byrow=TRUE) - 9 > > pop(d) Upper bound (half cost) : 39 Final partition (half cost) : 25 Number of classes : 2 Forward move count : 124 Backward move count : 124 Constraints evaluations count : 248 Number of local optima : 2 Individual class 1 1 1 2 2 2 3 3 1 4 4 1 5 5 1 6 6 2 > > > > > > > proc.time() user system elapsed 0.222 0.224 0.418 amap/src/0000755000176200001440000000000014326566177012000 5ustar liggesusersamap/src/matriceTriangle.h0000644000176200001440000000302713275645271015260 0ustar liggesusers#ifndef AMAP_TRIANGULAR_MATRIX #define AMAP_TRIANGULAR_MATRIX #include "matrice.h" namespace amap { /** * Matrix data. * * a triangular matrix with 4 row and 4 cols * +---+---+---+---+ * | | | | | * +---+---+---+---+ * | 1 | | | | * +---+---+---+---+ * | 2 | 4 | | | * +---+---+---+---+ * | 3 | 5 | 6 | | * +---+---+---+---+ * * matrix is 4x4 but dataSet is of a size 6 (when not diagonal). * dataSet is of size 10 if matrix is diagonal. * */ template class matriceTriangle : public matrice { private: T blankValue; bool isDiagonal; public: /** * Contructor. * \param values_p the data matrix * \param nrows_p the number of rows */ matriceTriangle(T * values_p, int nrow_p, bool isDiagonal_p) : matrice(values_p, nrow_p, nrow_p), isDiagonal(isDiagonal_p) { }; /** * Accessor on data. */ virtual T & operator[] (int index) { blankValue = 0; int i = index % this->getNrow(); int j = index / this->getNrow(); if (i == j && !isDiagonal) { return blankValue; } if (i <= j) { int temp = i; i = j; j = temp; } int maxRowSize = this->getNrow(); if (!isDiagonal) { i--; maxRowSize--; } // // j * *(j + 1) / 2 : nombres de points qui sont dans "le triangle du haut". // int ij = i + j * maxRowSize - j * (j + 1) / 2; return matrice::operator[](ij); }; }; }; #endif amap/src/hclust_T.h0000644000176200001440000000206613574503130013722 0ustar liggesusers #ifndef _AMAP_HCLUST_TEMPLATE #define _AMAP_HCLUST_TEMPLATE 1 namespace hclust_T { enum {WARD=1,SINGLE,COMPLETE,AVERAGE,MCQUITTY,MEDIAN,CENTROID,CENTROID2}; template void hcluster(double *x, int *nr, int *nc, int *diag, int *method, int *iopt , int *ia , int *ib,int *iorder, double *crit,double *membr, int *nbprocess, int * result); template void hclust(int *nbprocess,double *mx,int nr, int nc,int *method,int *n,int *len, int *iopt ,int *ia , int *ib,int *iorder,double *crit, double *membr,T *diss,int *result); /** \brief Return indice * * The upper half diagonal distance matrix is stored as a vector... * so distance between individual i and j is stored at postion ioffst(i,j) * * \param n number of individuals (distance matrix is nxn) * \param i,j: indices in matrix */ inline int ioffst(int n,int i,int j) { return j+i*n-(i+1)*(i+2)/2 ; } } #endif #ifndef _AMAP_HCLUST_TEMPLATE_CPP #define _AMAP_HCLUST_TEMPLATE_CPP 1 #include "hclust_T.h.h" #endif amap/src/diss.c0000644000176200001440000000136613275645271013107 0ustar liggesusers #include /** \fn diss compute a dissimilarity matrix * \brief diss(i,j) = number of values in individual i that * are equal to values in individual j * - number of values that are different */ void diss (int * data, double * res, int * n, int * p,double * w) { int k,i,j=0; for(i=0; i< (*n); i++) { /* follow lines: case when i=j */ j = i; res[i + (j * (*n))] = *p; for(j=i+1; j < (*n); j++) { res[j + (i * (*n))] = 0; for(k=0; k< (*p);k++) { if(data[i + (k * (*n))] == data[j + (k * (*n))]) (res[j + (i * (*n))]) +=w[k] ; else (res[j + (i * (*n))]) -=w[k] ; } res[i + (j * (*n))] = res[j + (i * (*n))] ; } } } amap/src/kmeans.h0000644000176200001440000000043313275645271013422 0ustar liggesusers #ifndef KMEANS_HEADER_AMAP #define KMEANS_HEADER_AMAP 1 #ifdef __cplusplus extern "C" { #endif void kmeans_Lloyd2(double *x, int *pn, int *pp, double *cen, int *pk, int *cl, int *pmaxiter, int *nc, double *wss, int * method); #ifdef __cplusplus } #endif #endif amap/src/smartPtr.h0000644000176200001440000000207713275645271013766 0ustar liggesusers#ifndef AMAP_MEMORY #define AMAP_MEMORY 1 #include #include "R.h" /** * This class is like std:auto_ptr - but with a new xxx[size] and delete [] ... */ template class SmartPtr { private: T* data; public: /** * Constructor. Create an array T*. * * \param size size of array. */ SmartPtr(int size) : data(0) { reset(size); } ~SmartPtr() { clear(); } /** */ void reset(int size) { clear(); if (size > 0) { //data = new T[size]; data = (T*) calloc(size, sizeof(T)); if ( data == 0) { int sizeInMo = size * sizeof(T) / 1024 / 1024; error("AMAP: cannot allocate %d Mo", sizeInMo); } } else { data = 0; } } /** * Clear data (free). */ void clear() { if (data != 0 ) { //delete [] data; free(data); } data = 0; } /** Accesssor. */ T & operator[](int i) { return data[i]; } /** * Get data. */ T * get(){ return data; } private: /** * This is to avoid a copy. */ SmartPtr(const SmartPtr&){}; }; #endif amap/src/burt.c0000644000176200001440000000247113275645271013117 0ustar liggesusers /** matind * \brief create indicatrices instead of factors. * * \param nblev number of levels for each variables (size 1xm) * \param data: input data n individuals with m variables * \param res: return matrix, indicatrics of size nxsum(nblev) * \param n,m size of matrix data. * * color size color.blue color.red size.large size.medium size.small blue large 1 0 1 0 0 red large 0 1 1 0 0 red small => 0 1 0 0 1 blue medium 1 0 0 1 0 red large 0 1 1 0 0 nblev = 2,3 x = 1 1 2 1 2 2 1 3 2 1 */ void matind(int * nblev,int * data,int * res, int * n, int * m,int * k) { int i,j,curr_col_in_res=0; /* for all variables ... */ for(j = 0; j< *m; j++) { /* for all individuals ... */ for(i = 0; i< *n; i++) { if((i + (*n)*(curr_col_in_res+ data[i+ (*n)*j] -1)) >= 0) { /* res[i,(curr_col_in_res+ data[i,j] -1)] ++;*/ res[i + (*n)*(curr_col_in_res+ data[i+ (*n)*j] -1)] ++; } } curr_col_in_res = curr_col_in_res + nblev[j]; } } amap/src/distance_T.h0000644000176200001440000003174613574503147014231 0ustar liggesusers #ifndef _AMAP_DISTANCE_TEMPLATE #define _AMAP_DISTANCE_TEMPLATE 1 #include "smartPtr.h" #include "matrice.h" namespace amap { template class distance_T { public: /* == 1,2,..., defined by order in the r function dist */ enum { EUCLIDEAN=1, MAXIMUM, MANHATTAN, CANBERRA, BINARY ,PEARSON, CORRELATION, SPEARMAN, KENDALL, ABSPEARSON, ABSCORRELATION}; class T_tri { public: SmartPtr data_tri_x; SmartPtr order_tri_x; SmartPtr rank_tri_x; SmartPtr data_tri_y; SmartPtr order_tri_y; SmartPtr rank_tri_y; T_tri() : data_tri_x(0), order_tri_x(0), rank_tri_x(0), data_tri_y(0), order_tri_y(0), rank_tri_y(0) {}; void reset(int size) { data_tri_x.reset(size); order_tri_x.reset(size); rank_tri_x.reset(size); data_tri_y.reset(size); order_tri_y.reset(size); rank_tri_y.reset(size); } }; typedef T (* distfunction)(vecteur & x, vecteur & y , int *, T_tri &); private: /** \brief arguments sent to distance thread */ struct T_argument { short int id; double * x; int * nr; int * nc; bool dc; T * d; int * method; int nbprocess; int * ierr; int i2; }; // only static functions; no attributes distance_T(); ~distance_T(); public: /** return a distance function, depending on method */ static void getDistfunction(int method,distfunction & distfun); /** \brief R_distance compute parallelized distance. * * compute distance and call function thread_dist * that call one of function R_euclidean or R_... * * \param x input matrix * \param nr,nc number of row and columns * nr individuals with nc values. * \param d distance half matrix. * \param diag if we compute diagonal of dist matrix (usualy: no). * \param method 1, 2,... method used (correspond to the enum) * \param nbprocess: number of threads to create * \param ierr error return; 1 good; 0 missing values * \param i2: if -1: ignored, else, compute * distance between individual i2 and others */ static void distance(double *x, int *nr, int *nc, T *d, int *diag, int *method,int *nbprocess, int * ierr,int i2); /** \brief R_distance_kms: compute distance between individual i1 and * centroid i2 * * compute distance and call one of function R_euclidean or R_... * This function is called by kmeans_Lloyd2 * * \param x input matrix (individuals) * \param y input matrix (centroids) * \param nr1,nr2,nc number of row (nr1:x, nr2:y) and columns * nr individuals with nc values. * \param i1, i2: indice of individuals (individual i1, centroid i2) * \param method 1, 2,... method used (correspond to the enum) * \param ierr for NA 0 if no value can be comuted due to NA * \param opt optional parameter required for spearman */ static T distance_kms(vecteur & x, vecteur & y , int *method, int * ierr, T_tri & opt); private: static void* thread_dist(void* arguments); /** \brief Distance euclidean (i.e. sqrt(sum of square) ) * * Euclidean distance between 2 vectors a,b is * \f[ d = \sqrt{ \sum_i^n (a_i - b_i)^2} * \f] * * When NA values found for a_i or b_i, both a_i and b_i are * skipped. Number of values skipped is couned (#NA in next formula) * * \f[ d = \sqrt{\frac{n}{#NA} \sum_{i=1; a_i \in \Re; b_i \in \Re}^n (a_i - b_i)^2} * \f] * * This function compute distance between 2 vectors x[i1,] & y[i2,] * x and y are matrix; we use here only line i1 from x and * line i2 from y. Number of column (nc) is the same in x and y, * number of column can differ (nr_x, nr_y). * * Flag will be set to 0 if too many NA to compute distance * * When call by function distance or hclust, x and y are the same; it computes * distance between vector x[i1,] and x[i2,] * * \param x matrix of size nr_x * nc; line i1 is of interest * \param y matrix of size nr_y * nc; line i1 is of interest * \param nr_x number of row in matrix x * \param nr_y number of row in matrix y * \param nc number of column in matrix x or y * \param i1 row choosen in matrix x * \param i2 row choosen in matrix y * \param flag set to 0 if NA value computed in distance * \param opt unused * * \return distance value * */ static T R_euclidean(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Distance maximum (supremum norm) * * Maximum distance between 2 vectors a,b is * \f[ d = \max_i |a_i - b_i| * \f] * * NA values are omitted. * * This function compute distance between 2 vectors x[i1,] & y[i2,] * x and y are matrix; we use here only line i1 from x and * line i2 from y. Number of column (nc) is the same in x and y, * number of column can differ (nr_x, nr_y). * * Flag will be set to 0 if too many NA to compute distance * * When call by function distance or hclust, x and y are the same; it computes * distance between vector x[i1,] and x[i2,] * * \param x matrix of size nr_x * nc; line i1 is of interest * \param y matrix of size nr_y * nc; line i1 is of interest * \param nr_x number of row in matrix x * \param nr_y number of row in matrix y * \param nc number of column in matrix x or y * \param i1 row choosen in matrix x * \param i2 row choosen in matrix y * \param flag set to 0 if NA value computed in distance * \param opt unused * * \return distance value * */ static T R_maximum(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief manhattan (i.e. sum of abs difference ) * * manhattan distance between 2 vectors a,b is * \f[ d = \sum_i^n |a_i - b_i| * \f] * * When NA values found for a_i or b_i, both a_i and b_i are * skipped. Number of values skipped is couned (#NA in next formula) * * \f[ d = \frac{n}{#NA} \sum_{i=1; a_i \in \Re; b_i \in \Re}^n |a_i - b_i|} * \f] * * This function compute distance between 2 vectors x[i1,] & y[i2,] * x and y are matrix; we use here only line i1 from x and * line i2 from y. Number of column (nc) is the same in x and y, * number of column can differ (nr_x, nr_y). * * Flag will be set to 0 if too many NA to compute distance * * When call by function distance or hclust, x and y are the same; it computes * distance between vector x[i1,] and x[i2,] * * \param x matrix of size nr_x * nc; line i1 is of interest * \param y matrix of size nr_y * nc; line i1 is of interest * \param nr_x number of row in matrix x * \param nr_y number of row in matrix y * \param nc number of column in matrix x or y * \param i1 row choosen in matrix x * \param i2 row choosen in matrix y * \param flag set to 0 if NA value computed in distance * \param opt unused * * \return distance value * */ static T R_manhattan(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Camberra distance * * Camberra distance between 2 vectors a,b is * \f[ d = \sum_i^n |a_i - b_i| / |a_i + b_i| * \f] * * When NA values found for a_i or b_i, both a_i and b_i are * skipped. Number of values skipped is couned (#NA in next formula) * * * This function compute distance between 2 vectors x[i1,] & y[i2,] * x and y are matrix; we use here only line i1 from x and * line i2 from y. Number of column (nc) is the same in x and y, * number of column can differ (nr_x, nr_y). * * Flag will be set to 0 if too many NA to compute distance * * When call by function distance or hclust, x and y are the same; it computes * distance between vector x[i1,] and x[i2,] * * \param x matrix of size nr_x * nc; line i1 is of interest * \param y matrix of size nr_y * nc; line i1 is of interest * \param nr_x number of row in matrix x * \param nr_y number of row in matrix y * \param nc number of column in matrix x or y * \param i1 row choosen in matrix x * \param i2 row choosen in matrix y * \param flag set to 0 if NA value computed in distance * \param opt unused * * \return distance value * */ static T R_canberra(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Distance binary */ static T R_dist_binary(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Pearson / Pearson centered (correlation) * \note Added by A. Lucas */ static T R_pearson(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Distance correlation (Uncentered Pearson) * \note Added by A. Lucas */ static T R_correlation(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Pearson / Pearson centered (correlation) * \note Added by L. Cerulo */ static T R_abspearson(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Distance correlation (Uncentered Pearson) * \note Added by L. Cerulo */ static T R_abscorrelation(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Spearman distance (rank base metric) * * Spearman distance between 2 vectors a,b is * \f[ d = \sum_i^n (rank(a_i) - rank(b_i)) ^ 2 * \f] * * If a NA found: return NA, flag is set to 0. * * * This function compute distance between 2 vectors x[i1,] & y[i2,] * x and y are matrix; we use here only line i1 from x and * line i2 from y. Number of column (nc) is the same in x and y, * number of column can differ (nr_x, nr_y). * * * When call by function distance or hclust, x and y are the same; it computes * distance between vector x[i1,] and x[i2,] * * \param x matrix of size nr_x * nc; line i1 is of interest * \param y matrix of size nr_y * nc; line i1 is of interest * \param nr_x number of row in matrix x * \param nr_y number of row in matrix y * \param nc number of column in matrix x or y * \param i1 row choosen in matrix x * \param i2 row choosen in matrix y * \param flag set to 0 if NA value computed in distance * \param opt a set of 6 vectors of size nc, allocated but uninitialised. * aim of this parameter is to avoid several vector allocation * * \return distance value * */ static T R_spearman(vecteur & x, vecteur & y , int * flag, T_tri & opt); /** \brief Kendall distance (rank base metric) * * Kendall distance between 2 vectors a,b is * \f[ d = \sum_{i,j} K_{i,j}(x,y) * \f] * * With \f$ K_{i,j}(x,y)\f$ is 0 if * \f$ (x_i, x_j) \f$ in same order as \f$ ( y_i,y_j) \f$, * 1 if not. * * * If a NA found: return NA, flag is set to 0. * * * This function compute distance between 2 vectors x[i1,] & y[i2,] * x and y are matrix; we use here only line i1 from x and * line i2 from y. Number of column (nc) is the same in x and y, * number of column can differ (nr_x, nr_y). * * * When call by function distance or hclust, x and y are the same; it computes * distance between vector x[i1,] and x[i2,] * * \param x matrix of size nr_x * nc; line i1 is of interest * \param y matrix of size nr_y * nc; line i1 is of interest * \param nr_x number of row in matrix x * \param nr_y number of row in matrix y * \param nc number of column in matrix x or y * \param i1 row choosen in matrix x * \param i2 row choosen in matrix y * \param flag set to 0 if NA value computed in distance * \param opt a set of 6 vectors of size nc, allocated but uninitialised. * aim of this parameter is to avoid several vector allocation * * \return distance value * */ static T R_kendall(vecteur & x, vecteur & y , int * flag, T_tri & opt); }; }; #endif #ifndef _AMAP_DISTANCE_TEMPLATE_CPP #define _AMAP_DISTANCE_TEMPLATE_CPP 1 #include "distance_T.h.h" #endif amap/src/distance.h0000644000176200001440000000147413275645271013744 0ustar liggesusers #ifdef __cplusplus extern "C" { #endif /** * R_distance: compute parallelized distance. Function called direclty by R * \brief compute distance and call function thread_dist * that call one of function R_euclidean or R_... * \param x input matrix * \param nr,nc number of row and columns * nr individuals with nc values. * \param d distance half matrix. * \param diag if we compute diagonal of dist matrix (usualy: no). * \param method 1, 2,... method used * \param nbprocess: number of threads to create * \param ierr error return; 1 good; 0 missing values */ void R_distance(double *x, int *nr, int *nc, double *d, int *diag, int *method,int * nbprocess, int * ierr); void rsort_rank_order(double *x, int *order, int *rank, int * n); #ifdef __cplusplus }; #endif amap/src/hclust.cpp0000644000176200001440000001750213275645271014006 0ustar liggesusers/** \file hclust.c * * \brief Hierarchical Clustering. * * \date Created : 14/11/02 * \date Last Modified : Time-stamp: <2011-11-04 22:29:32 antoine> * * \author F. Murtagh, ESA/ESO/STECF, Garching, February 1986. * \author Modifications for R: Ross Ihaka, Dec 1996 * Fritz Leisch, Jun 2000 * all vars declared: Martin Maechler, Apr 2001 * \author C adaptation: A. Lucas, Dec 2002 */ /* * Parameters: * * N the number of points being clustered * DISS(LEN) dissimilarities in lower half diagonal * storage; LEN = N.N-1/2, * IOPT clustering criterion to be used, * IA, IB, CRIT history of agglomerations; dimensions * N, first N-1 locations only used, * MEMBR, NN, DISNN vectors of length N, used to store * cluster cardinalities, current nearest * neighbour, and the dissimilarity assoc. * with the latter. * MEMBR must be initialized by R to the * default of rep(1, N) * FLAG boolean indicator of agglomerable obj. * clusters. * * * Fortran algorithme: * F. Murtagh, ESA/ESO/STECF, Garching, February 1986. * Modifications for R: Ross Ihaka, Dec 1996 * Fritz Leisch, Jun 2000 * all vars declared: Martin Maechler, Apr 2001 * C adaptation: A. Lucas, Dec 2002 * ------------------------------------------------------------ */ #include #include #include "hclust.h" #include "distance.h" #include "hclust_T.h" #define max( A , B ) ( ( A ) > ( B ) ? ( A ) : ( B ) ) #define min( A , B ) ( ( A ) < ( B ) ? ( A ) : ( B ) ) /** Hierachical clustering * \brief compute hierachical clustering from a distance matrix * hclust can be called directly by R, or with hcluster C function. * \param n number of individuals * \param len = n (n-1) / 2 (size of distance matrix) * \param *iopt integer -> link used * \param ia, ib result (merge) * \param iorder result (order) * \param crit result (height) * \param membr number of individuals in each cluster. * \param diss distance matrix (size len) * \param result flag 0 => correct * 1 => Pb * 2 => Cannot allocate memory * 3 => Pb with distance matrix * * \note this is an adaptation of the fortran function designed from the * R core team. */ void hclust(int *n,int *len, int *iopt ,int *ia , int *ib,int *iorder,double *crit,double *membr,double *diss,int *result) { int nbprocess = 1; if (*iopt!=hclust_T::CENTROID2) { hclust_T::hclust(&nbprocess,NULL,*n,*n,NULL,n,len,iopt ,ia ,ib,iorder, crit,membr,diss, result); } } /* end function hclust */ /** Paralelized hierarchical clustering * \brief allocate distance matrix execute function R_distancepar, launch * hclust on this distance matrix, and free memory of distance matrix. * \param x: data nr x nc * \param nr,nc number of row and columns * \param membr: member, vector 1:nr * \param method integer -> distance method * \param diag integer: if we compute diagonal in distance matrix (usually no) * \param iopt integer -> link used * \param nbprocess nb of process for parallelization * \param precision 1: float; 2: double * \param ia, ib result (merge) * \param iorder result (order) * \param crit result (height) * \param result flag 0 => correct * 1 => Pb * 2 => Cannot allocate memory * 3 => Pb with distance matrix * * \note this is an adaptation of the fortran function designed from the * R core team. */ void hcluster(double *x, int *nr, int *nc, int *diag, int *method, int *iopt ,int *ia , int *ib,int *iorder,double *crit,double *membr,int *nbprocess,int * precision, int * result) { if(*precision == 1) hclust_T::hcluster(x,nr,nc,diag,method, iopt , ia ,ib,iorder,crit,membr, nbprocess, result); else hclust_T::hcluster(x,nr,nc,diag,method, iopt , ia ,ib,iorder,crit,membr, nbprocess, result); return; } /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ /* */ /* Given a HIERARCHIC CLUSTERING, described as a sequence of */ /* agglomerations, prepare the seq. of aggloms. and "horiz." */ /* order of objects for plotting the dendrogram using S routine*/ /* 'plclust'. */ /* */ /* Parameters: */ /* */ /* IA, IB: vectors of dimension N defining the agglomer- */ /* ations. */ /* IIA, IIB: used to store IA and IB values differently */ /* (in form needed for S command `plclust` */ /* IORDER: "horiz." order of objects for dendrogram */ /* */ /* F. Murtagh, ESA/ESO/STECF, Garching, June 1991 */ /* C adaptation: A. Lucas, Nov 2002 */ /* */ /* HISTORY */ /* */ /* Adapted from routine HCASS, which additionally determines */ /* cluster assignments at all levels, at extra comput. expense*/ /* */ /*-------------------------------------------------------------*/ void hierclust::hcass2( int *n, int *ia, int *ib,int *iorder, int *iia, int *iib) { int i,j,k,k1,k2,loc; /* Following bit is to get seq. of merges into format acceptable to plclust * I coded clusters as lowest seq. no. of constituents; S's `hclust' codes * singletons as -ve numbers, and non-singletons with their seq. nos. */ for (i=0; i< *n; i++ ) { iia[i]= - ia[i]; iib[i]= - ib[i]; } for (i=0; i< (*n-2); i++ ) /* In the following, smallest (+ve or -ve) seq. no. wanted */ { k = min ( ia[i] , ib[i] ); for (j=i+1; j< (*n-1); j++ ) { if( ia[j] == k ) iia[j]= i+1; if( ib[j] == k ) iib[j]= i+1; } } for (i=0; i< (*n-1); i++ ) { if( (iia[i] > 0) && (iib[i] < 0) ) { k= iia[i]; iia[i] = iib[i]; iib[i] = k; } if( (iia[i] > 0) && (iib[i] > 0)) { k1= min ( iia[i], iib[i] ); k2= max ( iia[i], iib[i] ); iia[i] = k1; iib[i] = k2; } } /* New part for 'order' */ iorder[0] = - iia[*n-2]; iorder[1] = - iib[*n-2]; loc = 2; for (i=(*n-3); i>= 0; i-- ) { for (j=0; j< loc; j++ ) { if ( -iorder[j] == i +1) { /* REPLACE IORDER(J) WITH IIA(I) AND IIB(I) */ iorder[j] = - iia[i]; if (j == (loc-1)) { loc++; iorder[loc-1]= - iib[i]; break; /* for j */ } loc++; for (k=loc-1; k >= (j+1); k--) { iorder[k]=iorder[k-1]; } iorder[j+1]= - iib[i]; break; /* for j */ } } } } amap/src/init.c0000644000176200001440000000506613275645271013111 0ustar liggesusers#include #include #include #include #include "distance.h" #include "acprob.h" #include "hclust.h" #include "kmeans.h" void diss (int * data, double * res, int * n, int * p,double * w); void matind(int * nblev,int * data,int * res, int * n, int * m,int * k); void checkMatrix(double * values, int * nrow, int * ncol); void checkMatrixTriangle(double * values, int * nrow, int * isDiagonal) ; /* static const R_CMethodDef cMethods[] = { {"R_distance", (DL_FUNC) &R_distance, 8,{REALSXP,INTSXP, INTSXP,REALSXP,INTSXP, INTSXP,INTSXP, INTSXP}}, {"rsort_rank_order", (DL_FUNC) &rsort_rank_order, 4,{REALSXP,INTSXP, INTSXP,INTSXP}}, {"noyau", (DL_FUNC) &noyau, 3, {REALSXP, STRSXP, REALSXP}}, {"W", (DL_FUNC) &W, 8, {REALSXP,REALSXP,REALSXP,INTSXP, INTSXP,STRSXP,REALSXP,INTSXP}}, {"VarRob", (DL_FUNC) &VarRob, 8, {REALSXP,REALSXP,REALSXP,INTSXP, INTSXP,STRSXP,REALSXP,INTSXP}}, {"hclust", (DL_FUNC)&hclust, 10, {INTSXP, INTSXP, INTSXP,INTSXP, INTSXP, INTSXP ,REALSXP ,REALSXP ,REALSXP,INTSXP}}, {"hcluster",(DL_FUNC) &hcluster, 14,{REALSXP,INTSXP, INTSXP, INTSXP,INTSXP, INTSXP, INTSXP,INTSXP, INTSXP,REALSXP ,REALSXP, INTSXP,INTSXP, INTSXP}}, {"kmeans_Lloyd2",(DL_FUNC) &kmeans_Lloyd2,10, {REALSXP, INTSXP, INTSXP,REALSXP, INTSXP, INTSXP, INTSXP, INTSXP,REALSXP, INTSXP}}, {NULL, NULL, 0 } };*/ static const R_CMethodDef cMethods[] = { {"matind", (DL_FUNC) &matind,6}, {"diss", (DL_FUNC) &diss, 5}, {"checkMatrixTriangle", (DL_FUNC)&checkMatrixTriangle, 3}, {"checkMatrix", (DL_FUNC)&checkMatrix, 3}, {"R_distance", (DL_FUNC) &R_distance, 8}, {"rsort_rank_order", (DL_FUNC) &rsort_rank_order, 4}, {"noyau", (DL_FUNC) &noyau, 3}, {"W", (DL_FUNC) &W, 8}, {"VarRob", (DL_FUNC) &VarRob, 8}, {"hclust", (DL_FUNC) &hclust, 10}, {"hcluster", (DL_FUNC) &hcluster, 14}, {"kmeans_Lloyd2", (DL_FUNC) &kmeans_Lloyd2,10}, {NULL, NULL, 0 } }; void F77_NAME(pnkfmb)(int *fmbvr, int *triabs, int *allsol, int *n, double *couts, int * yasve, int * y, int * renum, double* bornth, int * nbcl0, double* z0,int * nbcl, double* z, int * nbemp, int * nbdep, int * nbsol, int * nazp); static const R_FortranMethodDef fMethods[] = { {"pnkfmb", (DL_FUNC) &F77_NAME(pnkfmb), 17}, {NULL, NULL, 0} }; void attribute_visible R_init_amap(DllInfo *info) { R_registerRoutines(info, cMethods,NULL, fMethods, NULL); R_useDynamicSymbols(info, FALSE); R_forceSymbols(info, TRUE); } amap/src/pop.f0000644000176200001440000006207514326566167012756 0ustar liggesusersC======================================================================C C C C CLASSIFICATION ASCENDANTE HIERARCHIQUE C C -------------------------------------- C C C C EN ENTREE : C C N : DIMENSION DE SNN ET DE Y C C SNN ( N , N ) : MATRICE DES SIMILARITES SYMETRIQUE C C ( MODIFIEE , PUIS RESTAUREE ) C C C C EN SORTIE : C C Y ( N , N ) : PARTITION DES INDIVIDUS C C K : NOMBRE DE CLASSES ( 1 A N ) C C Z : DEMI-COUT DE LA PARTITION C C BORNTH : BORNE SUPERIEURE THEORIQUE DE Z C C C C ATTENTION : C C LA DIAGONALE DE Y CONTIENDRA LES NUMEROS DES CLASSES C C LA DIAGONALE DE SNN N'INTERVIENT JAMAIS DANS LE COUT C C C C======================================================================C C SUBROUTINE PNKCAH ( N , SNN , Y , K , Z , BORNTH ) C IMPLICIT INTEGER ( A - Z ) C C REAL SNN ( N , N ) , DSUP , DIJ , Z , BORNTH DOUBLE PRECISION SNN ( * ) , DSUP , DIJ , Z , BORNTH C C INTEGER Y ( N , N ) INTEGER Y ( * ) C C C INITIALISATION DE LA PARTITION : 1 CLASSE PAR INDIVIDU C CHAQUE CLASSE EST NUMEROTEE DE 1 A N SUR LA DIAGONALE . C ------------------------------------------------------ C DO I = 1 , N DO J = 1 , I-1 Y ( I + (J-1)*N ) = 0 END DO Y ( I + (I-1)*N ) = I END DO C K = N C C C CLASSIFICATION ASCENDANTE HIERARCHIQUE ( COUT < (N*N*N-N)/6 ) C REGROUPEMENT DES 2 CLASSES AYANT LA PLUS GRANDE SIMILARITE ; C ON S'ARRETE LORSQUE TOUTES LES SIMILARITES SNN(I,J) SONT < 0. C -------------------------------------------------------------- C 20 DSUP = -1. I1 = 0 I2 = 0 C DO I = 1 , N C C ON N'EXAMINE QUE LES CLASSES "ACTIVES" : LES AUTRES C LIGNES CORRESPONDENT AUX CLASSES DEJA REGROUPEES C IF ( Y(I+(I-1)*N) .GT. 0 ) THEN C DO J = I+1 , N C C ON N'EXAMINE QUE LES CLASSES "ACTIVES" : LES AUTRES C COLONNES CORRESPONDENT AUX CLASSES DEJA REGROUPEES C IF ( Y(J+(J-1)*N) .GT. 0 ) THEN C DIJ = SNN ( I + (J-1)*N ) C IF ( DIJ.GE.0. .AND. DIJ.GT.DSUP ) THEN C --------- -- C ON REGROUPE EGALEMENT SI DIJ = 0. C I1 = I I2 = J DSUP = DIJ C ENDIF C ENDIF C END DO C ENDIF C END DO C C C TOUTES LES SIMILARITES SONT NEGATIVES : FIN DE L'ALGORITHME C LES NUMEROS DES CLASSES SUR LA DIAGONALE SERONT CONSECUTIFS C ( AVEC CALCUL DU DEMI-COUT HORS DIAGONALE DE LA PARTITION ) C ( MISE A JOUR DES TRIANGULAIRES SUPERIEURES DE Y ET SNN ) C ----------------------------------------------------------- C IF ( I1 .EQ. 0 ) THEN C DO I = 1 , N II = I + (I-1)*N Y(II) = IABS ( Y(II) ) END DO C K0 = 1 DO NCL = 1 , N EFF = 0 DO I = 1 , N II = I + (I-1)*N IF ( Y(II) .EQ. NCL ) THEN Y(II) = K0 EFF = EFF + 1 ENDIF END DO IF ( EFF .NE. 0 ) K0 = K0 + 1 END DO C Z = 0. BORNTH = 0. DO I = 1 , N DO J = 1 , I-1 IJ = I + (J-1) * N JI = J + (I-1) * N SNN (JI) = SNN (IJ) Y (JI) = Y (IJ) Z = Z + Y(IJ) * SNN(IJ) IF ( SNN(IJ) .GT. 0. ) BORNTH = BORNTH + SNN(IJ) END DO END DO C RETURN C ENDIF C C C I1 ET I2 ( I2 > I1 ) SONT LES PLUS PROCHES : ON LES REGROUPE C ------------------------------------------------------------ C LE NOMBRE DE CLASSES DIMINUE DE 1 . C C LE NUMERO DE LA CLASSE DE I1 EST AFFECTE EN NEGATIF A I2 , C AINSI QU'AUX INDIVIDUS DE LA CLASSE DE I2 . C C L'ELEMENT ( I1 , I2 ) DE LA MATRICE DE PARTITION VAUT 1 , C AINSI QUE LES ELEMENTS ( E , I1 ) ET ( E , I2 ) TELS QUE C E SOIT CLASSE , SOIT AVEC I1 , SOIT AVEC I2 . C C K = K - 1 C NEWCLA = - Y ( I1 + (I1-1)*N ) ANCCLA = Y ( I2 + (I2-1)*N ) C DO I = 1 , N II = I + (I-1)*N IF ( Y(II) .EQ. ANCCLA .OR. . Y(II) .EQ. -ANCCLA ) Y(II) = NEWCLA END DO C DO I = 1 , N II = I + (I-1)*N IF ( Y(II) .EQ. NEWCLA .OR. . Y(II) .EQ. -NEWCLA ) THEN DO J = 1 , I-1 JJ = J + (J-1)*N IF ( Y(JJ) .EQ. NEWCLA .OR. . Y(JJ) .EQ. -NEWCLA ) Y ( I + (J-1)*N ) = 1 END DO ENDIF END DO C C C LES SIMILARITES DES AUTRES GROUPES AVEC I1 SONT RECALCULEES C DANS CE CAS PARTICULIER , LES SIMILARITES VERIFIENT : C SNN ( E , I1 U I2 ) = SNN ( E , I1 ) + SNN ( E , I2 ) C ----------------------------------------------------------- C DO E = 1 , I1-1 SNN ( E+(I1-1)*N ) = SNN ( E+(I1-1)*N ) + SNN ( E+(I2-1)*N ) END DO C DO E = I1+1 , I2-1 SNN ( I1+(E-1)*N ) = SNN ( I1+(E-1)*N ) + SNN ( E+(I2-1)*N ) END DO C DO E = I2+1 , N SNN ( I1+(E-1)*N ) = SNN ( I1+(E-1)*N ) + SNN ( I2+(E-1)*N ) END DO C C C ON RELANCE L'ALGORITHME C ----------------------- GOTO 20 C END C======================================================================C C C C ALGORITHME DE CLASSIFICATION : FAURE ET MALGRANGE BOOLEEN C C --------------------------------------------------------- C C C C EN ENTREE : C C UECR : UNITE D'ECRITURE DES RESULTATS C C FMBVR : = .TRUE. POUR LA SOLUTION EXACTE C C = .FALSE. POUR S'ARRETER A LA CAH C C TRIABS : = .TRUE. : TRI INITIAL VAL. ABSOLUE C C = .FALSE. : TRI INITIAL ALGEBRIQUE C C ALLSOL : = .TRUE. POUR TOUTES LES SOLUTIONS C C = .FALSE. POUR UNE SEULE SOLUTION C C N : NOMBRE D'INDIVIDUS C C COUTS (N,N) : MATRICE DES COUTS ( SIGNES ) C C C C EN SORTIE : C C YSAVE (N,N) : SAUVEGARDE DE LA SOLUTION C C Y (N,N) : MATRICE DE PARTITION FINALE C C RENUM (N,N) : ADRESSE DES COUTS DES VARIABLES C C BORNTH : MAJORANT DU COUT DES PARTITIONS C C NBCL0 : NOMBRE DE CLASSES INITIAL C C Z0 : COUT DE LA PARTITION INITIALE C C NBCL : NOMBRE DE CLASSES FINAL C C Z : COUT DE LA PARTITION FINALE C C NBEMP : NOMBRE D'EMPILEMENTS C C NBDEP : NOMBRE DE DEPILEMENTS C C NBSOL : NOMBRE DE SOLUTIONS OPTIMALES C C SAUVEGARDEES APRES LA CAH C C C C ATTENTION : C C LA TRIANGULAIRE INFERIEURE DE RENUM CONTIENT LES C C ADRESSES DES COUTS DES M=N*(N-1)/2 VARIABLES DANS C C LA MATRICE DES COUTS C C C C LA TRIANGULAIRE SUPERIEURE DE RENUM CONTIENT LES C C ADRESSES RECIPROQUES DE CELLES DE LA TRIANGULAIRE C C INFERIEURE . C C C C LA TRIANGULAIRE INFERIEURE DE Y CONTIENT LES C C VALEURS 0 OU 1 CHOISIES POUR CHACUNE DES M C C VARIABLES , OU -1 SI LA VARIABLE N'EST PAS FIXEE . C C C C LA TRIANGULAIRE SUPERIEURE DE Y CONTIENT L' C C ADRESSE DE LA VARIABLE PRECEDEMMENT FIXEE , OU 0 C C POUR LA 1-ERE CHOISIE ; CE NUMERO EST NEGATIF SI C C LA VARIABLE EST CHOISIE PAR IMPLICATION . C C C C LA DIAGONALE DE Y CONTIENDRA LES NUMEROS DES CLASSES C C LA DIAGONALE DE YSAVE AUSSI C C C C LES ARGUMENTS COUTS ET YSAVE PEUVENT AVOIR LA MEME C C ADRESSE , A CONDITION QUE LES DECLARATIONS "REAL" C C ET "INTEGER" SUPPOSENT LE MEME NOMBRE DE MOTS : C C LES COUTS SONT DANS LA TRIANGULAIRE SUPERIEURE , C C LA SAUVEGARDE DANS LA TRIANGULAIRE INFERIEURE . C C C C======================================================================C C C FONCTION D'ADRESSAGE : C ---------------------------------------------------------------- C $ , 1 , 2 , 3 , . . . . . , N-1 C 1 , $ , N , N+1 , , 2*N-3 C 2 , 3 , $ , . C . . C . . C . $ , N*(N-1)/2 C N-1 , 2*N-3 , N*(N-1)/2 , $ C ---------------------------------------------------------------- C ADRSUP(I,J,N) = N*I - (I*(I+1))/2 + J - N C ADRINF(I,J,N) = N*J - (J*(J+1))/2 + I - N C C C ALGORITHME C ---------- C ON ATTRIBUE PROGRESSIVEMENT LA VALEUR Y("K") = 1 , OU Y("K") = 0 C POUR CHAQUE VARIABLE K , AFIN DE DEGRADER LE MOINS POSSIBLE LA C FONCTION ECONOMIQUE Z : Y("K") = 1 SI SON COEFFICIENT DANS Z C EST POSITIF ( OU NUL ) , Y("K") = 0 SINON . C A CHAQUE ATTRIBUTION D'UNE VALEUR A LA VARIABLE K , ON EXAMINE C LES CONTRAINTES : C * SI LA VALEUR ATTRIBUEE EST REFUSEE , ON ATTRIBUE L'AUTRE VALEUR C * SI L'AUTRE VALEUR EST REFUSEE , ON REMET EN QUESTION LE DERNIER C CHOIX EFFECTUE . C * SI LA FONCTION ECONOMIQUE TOMBE EN DESSOUS DU COUT DE LA C SOLUTION SAUVEGARDEE , ON REMET EN QUESTION LE DERNIER CHOIX C EFFECTUE . C * SI ON EST AMENE A REMETTRE EN QUESTION TOUS LES CHOIX JUSQU'A C LA 1-ERE VARIABLE , ET QUE CELLE-CI EST ELLE MEME REFUSEE , C L'ALGORITHME S'ARRETE : LA SOLUTION SAUVEGARDEE EST OPTIMALE . C C ON STOCKE POUR CHAQUE VARIABLE , L'ADRESSE DU DERNIER CHOIX C EFFECTUE , AVEC UN SIGNE NEGATIF LORSQUE CELUI-CI A DEJA ETE C MODIFIE . C C======================================================================C C SUBROUTINE pnkfmb ( FMBVR , TRIABS , ALLSOL , N , , COUTS , YSAVE , Y , RENUM , , BORNTH , NBCL0 , Z0 , NBCL , Z , , NBEMP , NBDEP , NBSOL, NAP ) C IMPLICIT INTEGER ( A - Z ) C INTEGER YSAVE (N*N) , Y (N*N) , RENUM (N*N) C DOUBLE PRECISION COUTS (N*N) , , BORNTH , Z0 , Z , DELTAZ , ZSAVE , ZNEW , , ABS C INTEGER FMBVR , TRIABS , ALLSOL C LOGICAL REFUS , CINTEG C LOGICAL FMBVR , TRIABS , ALLSOL , REFUS , CINTEG C C C----------------------------------------------------------------------C C C C DETERMINATION DU TYPE DE COUTS : REELS OU ENTIERS C CINTEG N'EST UTILISE QU'A L'EDITION DES RESULTATS C ------------------------------------------------- CINTEG = .TRUE. DO I = 1 , N*N ICOUTS = INT ( COUTS(I) ) CINTEG = CINTEG .AND. COUTS(I) .EQ. REAL(ICOUTS) END DO C C C OBTENTION D'UNE PARTITION INITIALE PAR CAH C ------------------------------------------ CALL PNKCAH ( N , COUTS , Y , NBCL0 , Z0 , BORNTH ) C C C ARRET EVENTUEL C --------------------------------------------------- C write (*,*) 'UECR 4000-5002' C IF ( FMBVR .EQ. 0) RETURN C DO I = 1 , N DO J = 1 , I-1 IJ = I + (J-1)*N YSAVE (IJ) = Y (IJ) END DO END DO ZSAVE = Z0 C C C TRI QUADRATIQUE DES COUTS : ARITHMETIQUE OU ALGEBRIQUE C EX-AEQUOS : ON TESTE LES ADRESSES DES ELEMENTS C -------------------------------------------------------------- C LA VARIABLE K (K-EME PLUS GRAND COUT) ASSOCIEE AU COUT (I1,J1) C AURA COMME ADRESSE (IK,JK) DANS LA TRIANGULAIRE INFERIEURE C -------------------------------------------------------------- C DO J1 = 1 , N DO I1 = 1 , J1-1 C I1J1 = I1 + (J1-1) * N J1I1 = J1 + (I1-1) * N RANG = 1 C DO J2 = 1 , N DO I2 = 1 , J2-1 I2J2 = I2 + (J2-1) * N IF ( TRIABS .NE. 0 ) THEN CDIF = ABS(COUTS(I2J2)) - ABS(COUTS(I1J1)) ELSE CDIF = COUTS(I2J2) - COUTS(I1J1) ENDIF C IF ( CDIF ) 50 , 30 , 40 IF (CDIF < 0) THEN GOTO 50 ELSE IF (CDIF == 0) THEN GOTO 30 ELSE GOTO 40 ENDIF 30 IF ( I1J1 .GE. I2J2 ) GOTO 50 40 RANG = RANG + 1 50 CONTINUE C END DO END DO JK = 1 60 FINJ = N*JK - (JK*(JK+1))/2 IF ( RANG .GT. FINJ ) THEN JK = JK + 1 GOTO 60 ENDIF IK = RANG + N - FINJ IKJK = IK + (JK-1)*N RENUM(IKJK) = I1J1 RENUM(I1J1) = IKJK C END DO END DO C C C INITIALISATIONS DIVERSES ; Z EST LE MAJORANT , SAUF POUR K=M C ------------------------------------------------------------ M = ( N * (N-1) ) / 2 C DO I = 1 , N DO J = 1 , I-1 Y ( I + (J-1)*N ) = -1 Y ( J + (I-1)*N ) = 0 END DO Y ( I + (I-1)*N ) = - 1 END DO C NBEMP = 0 NBDEP = 0 NAP = 0 NBSOL = 0 KIJPRE = 1 I = 1 J = 1 K = 0 Z = BORNTH REFUS = .FALSE. C C C EMPILEMENT DE L'ADRESSE SUIVANTE : (I,J)+1 C ------------------------------------------ 1000 IF ( K .GE. M ) GOTO 1500 C NBEMP = NBEMP + 1 I = I + 1 IF ( I .GT. N ) THEN J = J + 1 I = J + 1 ENDIF IJ = I + (J-1)*N JI = J + (I-1)*N K = K + 1 C C C COUT ZNEW = Z +/- DELTAZ ASSOCIE A LA VARIABLE (I,J) , I > J C ------------------------------------------------------------ DELTAZ = COUTS ( RENUM (IJ) ) IF ( DELTAZ .GE. 0. ) THEN VAL01 = 1 ELSE VAL01 = 0 ENDIF C C C CONTROLE DE VALIDITE DU CHOIX INITIAL , PUIS DU CHOIX INVERSE C ON N'INSISTE PAS SI LE MAJORANT Z EST INFERIEUR A ZSAVE C SI REFUS = .TRUE. AVANT CONTROLE , ON VIENT DE DEPILER . C ------------------------------------------------------------- CALL PNKTSY ( N , I , J , VAL01 , Y , RENUM , NAP , REFUS ) IF ( REFUS ) THEN VAL01 = 1 - VAL01 KIJPRE = - KIJPRE CALL PNKTSY ( N , I , J , VAL01 , Y , RENUM , NAP , REFUS ) IF ( REFUS ) GOTO 1200 ENDIF 1100 ZNEW = Z IF ( VAL01 .EQ. 0 ) THEN IF ( DELTAZ .GT. 0. ) ZNEW = Z - DELTAZ ELSE IF ( DELTAZ .LT. 0. ) ZNEW = Z + DELTAZ ENDIF C write (*,'(I13)') ALLSOL IF ( ALLSOL .EQ. 1 ) THEN C write (*,*) "ALLSOL 1" IF ( ZNEW .LT. ZSAVE ) GOTO 1200 ELSE C write (*,*) "ALLSOL 0" IF ( ZNEW .LE. ZSAVE ) GOTO 1200 ENDIF C C C ACCEPTATION DE LA K-EME VARIABLE : ECRITURE DE (I,J) C ---------------------------------------------------- Y(IJ) = VAL01 Y(JI) = KIJPRE KIJPRE = IJ Z = ZNEW GOTO 1000 C C C DEPILEMENT : ANNULATION DE (I,J) C -------------------------------- 1200 NBDEP = NBDEP + 1 IF ( K .LE. 1 ) GOTO 2000 K = K - 1 I = I - 1 IF ( I .LE. J ) THEN J = J - 1 I = N ENDIF IJ = I + (J-1)*N JI = J + (I-1)*N VAL01 = Y(IJ) KIJPRE = Y(JI) Y(IJ) = - 1 Y(JI) = 0 DELTAZ = COUTS ( RENUM (IJ) ) IF ( VAL01 .EQ. 0 ) THEN IF ( DELTAZ .GT. 0. ) Z = Z + DELTAZ ELSE IF ( DELTAZ .LT. 0. ) Z = Z - DELTAZ ENDIF IF ( KIJPRE .LT. 0 ) GOTO 1200 C C C ON ESSAIE L'AUTRE VALEUR C ------------------------ VAL01 = 1 - VAL01 KIJPRE = - KIJPRE CALL PNKTSY ( N , I , J , VAL01 , Y , RENUM , NAP , REFUS ) IF ( REFUS ) GOTO 1200 GOTO 1100 C C C NOUVELLE SOLUTION C ----------------- 1500 DO II = 1 , N DO JJ = 1 , II-1 IJ = II + (JJ-1)*N ISJS = RENUM (IJ) JS = ISJS / N IS = ISJS - JS * N JS = 1 + JS JSIS = JS + (IS-1)*N YSAVE (JSIS) = Y (IJ) END DO END DO ZSAVE = Z NBSOL = NBSOL + 1 C C C CALCUL DU NOMBRE DE CLASSES A PARTIR DE YSAVE C --------------------------------------------- DO IS = 1 , N YSAVE ( IS + (IS-1)*N ) = - 1 END DO NBCL = 0 DO IS = 1 , N ISIS = IS + (IS-1)*N IF ( YSAVE(ISIS) .LT. 0 ) THEN NBCL = NBCL + 1 DO JS = IS+1 , N JSIS = JS + (IS-1)*N JSJS = JS + (JS-1)*N IF ( YSAVE(JSIS) .EQ. 1 ) YSAVE(JSJS) = NBCL END DO YSAVE(ISIS) = NBCL ENDIF END DO C C write (*,*) 'UECR 6000-5002' C C AU MIEUX , ON REEXAMINE K = M : SIMULATION DU REFUS DE K = M+1 C -------------------------------------------------------------- NBDEP = NBDEP - 1 K = M + 1 C I = N J = N GOTO 1200 C C C RECUPERATION DE LA PARTITION OPTIMALE C ------------------------------------- 2000 DO I = 1 , N DO J = 1 , I-1 IJ = I + (J-1)*N JI = J + (I-1)*N Y (IJ) = YSAVE (IJ) Y (JI) = Y (IJ) END DO END DO Z = ZSAVE C C C CALCUL DU NOMBRE DE CLASSES A PARTIR DE Y C ----------------------------------------- NBCL = 0 DO I = 1 , N II = I + (I-1)*N IF ( Y(II) .LT. 0 ) THEN NBCL = NBCL + 1 DO J = I+1 , N IJ = I + (J-1)*N JJ = J + (J-1)*N IF ( Y(IJ) .EQ. 1 ) Y(JJ) = NBCL END DO Y(II) = NBCL ENDIF END DO C C C ECRITURE DE LA PARTITION FINALE ET DES STATISTIQUES C --------------------------------------------------- C write (*,*) 'UECR 7000-5002' C RETURN C END C======================================================================C C C C CONTROLE DE VALIDITE D'UNE NOUVELLE AFFECTATION DANS Y C C ( VOIR PNKFMB ) C C ------------------------------------------------------ C C C C EN ENTREE : C C N : DIMENSION DE Y ET DE RENUM C C I : INDICE DE LIGNE DU NOUVEL Y(I,J) C C J : INDICE DE COLONNE DE Y(I,J) C C VAL01 : VALEUR PROPOSEE POUR Y(I,J) C C Y ( N , N ) : MATRICE DE PARTITION ( DANS LA C C TRIANGULAIRE INFERIEURE ) C C RENUM ( N , N ) : MATRICE DES ADRESSES DES COUTS C C NAP : NOMBRE D'APPELS C C C C EN SORTIE : C C NAP : NOMBRE D'APPELS + 1 C C REFUS : .TRUE. SI ON REFUSE C C .FALSE. SI ON ACCEPTE C C C C ATTENTION : C C LA TRIANGULAIRE INFERIEURE DE RENUM CONTIENT LE C C COUPLE (II,JJ) , ANCIENNE ADRESSE DE LA VARIABLE C C DANS LA TRIANGULAIRE SUPERIEURE , CORRESPONDANT C C AUX COUTS INITIAUX . C C C C LA TRIANGULAIRE SUPERIEURE DE RENUM CONTIENT LE C C COUPLE (I ,J ) , NOUVELLE ADRESSE DE LA VARIABLE C C DANS LA TRIANGULAIRE INFERIEURE , APRES CLASSEMENT C C PAR ORDRE DECROISSANT : VOIR CALREN . C C C C======================================================================C C SUBROUTINE PNKTSY ( N , I , J , VAL01 , Y , RENUM , NAP , REFUS ) C IMPLICIT INTEGER ( A - Z ) C LOGICAL REFUS C C INTEGER Y ( N , N ) , RENUM ( N , N ) INTEGER Y ( * ) , RENUM ( * ) C C NAP = NAP + 1 REFUS = .FALSE. C C C EXTRACTION DES INDICES II ET JJ > II , ASSOCIES A YIJ INITIAL C ------------------------------------------------------------- JJII = RENUM ( I + (J-1)*N ) IIM1 = (JJII-1) / N II = IIM1 + 1 JJ = JJII - N * IIM1 C Y(II,JJ) = VAL01 C C C BOUCLE SUR LES INDICES INITIAUX COHERENTS AVEC YIJ , YIK , YJK C -------------------------------------------------------------- DO 100 KK = 1 , N C C IF ( II - KK ) 10 , 100 , 20 IF ((II - KK) < 0 ) THEN GOTO 10 ELSE IF (( II - KK) == 0) THEN GOTO 100 ELSE GOTO 20 END IF 10 YIK = Y ( RENUM ( II + (KK-1)*N ) ) GOTO 30 20 YIK = Y ( RENUM ( KK + (II-1)*N ) ) C 30 IF ( JJ - KK ) 40 , 100 , 50 30 IF ( ( JJ - KK ) < 0 ) THEN GOTO 40 ELSE IF (( JJ - KK ) == 0 ) THEN GOTO 100 ELSE GOTO 50 ENDIF 40 YJK = Y ( RENUM ( JJ + (KK-1)*N ) ) GOTO 60 50 YJK = Y ( RENUM ( KK + (JJ-1)*N ) ) C C CONTRAIREMENT A LA PROGRAMMATION LINEAIRE , ON TESTE C TROIS PAR TROIS LES CONTRAINTES YIJ + YIK - YJK < 2 C ---------------------------------------------------- C REFUS : YIJ , YIK , YJK ( VALEURS POSSIBLES -1 , 0 , +1 ) C 1 1 0 C 1 0 1 C 0 1 1 C 60 REFUS = VAL01+YIK+YJK .EQ. 2 C IF ( REFUS ) RETURN C 100 CONTINUE C RETURN C END amap/src/hclust_T.h.h0000644000176200001440000001757212444341502014156 0ustar liggesusers #define _AMAP_HCLUST_TEMPLATE_CPP 1 #include "hclust.h" #include "distance_T.h" #include "distance.h" #include "hclust_T.h" #include #include "smartPtr.h" #include "R.h" #include namespace hclust_T { /** hierarchical clustering * \brief allocate distance matrix execute function R_distance, launch * hclust on this distance matrix, and free memory of distance matrix. * \param x: data nr x nc * \param nr,nc number of row and columns * \param membr: member, vector 1:nr * \param method integer -> distance method * \param diag integer: if we compute diagonal in distance matrix (usually no) * \param iopt integer -> link used * \param ia, ib result (merge) * \param iorder result (order) * \param crit result (height) * \param nbprocess number of processes (thread) used * \param result flag 0 => correct * 1 => Pb * 2 => Cannot allocate memory * 3 => Pb with distance matrix * */ template void hcluster(double *x, int *nr, int *nc, int *diag, int *method, int *iopt ,int *ia , int *ib,int *iorder,double *crit,double *membr,int *nbprocess, int * result) { int len = (*nr * (*nr-1) )/2; int flag; SmartPtr d (len); *result = 1; /* * Calculate d: distance matrix */ amap::distance_T::distance(x,nr,nc,d.get(),diag,method,nbprocess,&flag,-1); if(flag == 0) { Rprintf("AMAP: Unable to compute Hierarchical Clustering: missing values in distance matrix\n"); *result = 3; return; } /* * Hierarchical clustering */ hclust_T::hclust(nbprocess,x,*nr,*nc,method,nr,&len,iopt ,ia ,ib,iorder,crit,membr,d.get(),result); *result = 0; } template void hclust(int * nbprocess,double *mx,int nr, int nc, int *method,int *n,int *len, int *iopt ,int *ia , int *ib,int *iorder,double *crit,double *membr,T *diss,int *result) { int im,jm,jj,i,j,ncl,ind,i2,j2,k,ind1,ind2,ind3; double inf,dmin,x,xx; SmartPtr nn (*n); SmartPtr items (0); SmartPtr disnn(*n); SmartPtr flag(*n); int h,idx1,idxitem1,idx2; *result = 1; if(*iopt==CENTROID2) { items.reset(*n * nc); } /* Initialisation */ for ( i=0; i<*n ; i++) { flag[i]=1; idxitem1=i; if(items.get() != NULL) { for ( j=0; j 1) { /* * Next, determine least diss. using list of NNs */ dmin = inf; for ( i=0; i<(*n-1) ; i++) { if( flag[i] ) { if (disnn[i] < dmin ) { dmin = disnn[i]; im=i; jm=nn[i]; } } } ncl = ncl-1; /* * This allows an agglomeration to be carried out. * At step n-ncl, we found dmin=dist[i2,j2] */ i2=MIN (im,jm); j2=MAX (im,jm); ia[*n-ncl-1]=i2+1; ib[*n-ncl-1]=j2+1; crit[*n-ncl-1]=dmin; /* * Update dissimilarities from new cluster. */ flag[j2]=0; dmin=inf; jj=0; /* * Cluster3 CENTROID METHOD - IOPT=8. */ if (*iopt==CENTROID2) { /* compute centroind coordinates*/ idx1=i2; idx2=j2; ind3=ioffst(*n,i2,j2); //printf("Aggregate %d-%d %d-%d (method=%d, dmin=%f (%f))\n",i2,j2,im,jm,*method,dmin,diss[ind3]); for(h = 0 ; h< nc ; h++) { if(R_FINITE(mx[idx1]) && R_FINITE(mx[idx2])) { mx[idx1] = (items[idx1]*mx[idx1] + items[idx2]*mx[idx2])/(items[idx1]+items[idx2]); items[idx1]+=items[idx2]; } else { if(!R_FINITE(mx[idx1]) && R_FINITE(mx[idx2])) { mx[idx1] = mx[idx2]; items[idx1]=items[idx2]; } } idx1 += nr; idx2 += nr; } int flg; int dg=0; /* recompute all distances in parallel */ amap::distance_T::distance(mx,&nr,&nc,diss,&dg,method,nbprocess,&flg, i2); /*update disnn and nn*/ for ( k=0; k< *n ; k++) { if(flag[k] && (k != i2) ) { if (i2 < k) { ind1 = ioffst(*n,i2,k); } else { ind1 = ioffst(*n,k,i2); } if( (i2 < k) && ( diss[ind1] < dmin ) ) { dmin = diss[ind1]; jj=k; } if( (i2 > k) && (nn[k]!=j2) && ( diss[ind1] < disnn[k] ) ) { disnn[k]=diss[ind1]; nn[k]=i2; } } } } else for ( k=0; k< *n ; k++) { if(flag[k] && (k != i2) ) { x = membr[i2] + membr[j2] + membr[k]; if (i2 < k) { ind1 = ioffst(*n,i2,k); } else { ind1 = ioffst(*n,k,i2); } if (j2 < k) { ind2 = ioffst(*n,j2,k); } else { ind2 = ioffst(*n,k,j2); } ind3=ioffst(*n,i2,j2); xx=diss[ind3]; /* * Gi & Gj are agglomerated => Gii * We are calculating D(Gii,Gk) (for all k) * * diss[ind1] = D(Gi,Gk) (will be replaced by D(Gii,Gk)) * diss[ind2] = D(Gj,Gk) * xx = diss[ind3] = D(Gi,Gj) * * membr[i2] = #Gi * membr[j2] = #Gj * membr[k] = #Gk * * x = #Gi + #Gj + #Gk */ switch(*iopt) { /* * WARD'S MINIMUM VARIANCE METHOD - IOPT=1. */ case WARD: { diss[ind1] = (membr[i2]+membr[k])* diss[ind1] + (membr[j2]+membr[k])* diss[ind2] - membr[k] * xx; diss[ind1] = diss[ind1] / x; break; } /* * SINGLE LINK METHOD - IOPT=2. */ case SINGLE: diss[ind1] = MIN (diss[ind1],diss[ind2]); break; /* * COMPLETE LINK METHOD - IOPT=3. */ case COMPLETE: diss[ind1] = MAX (diss[ind1],diss[ind2]); break; /* * AVERAGE LINK (OR GROUP AVERAGE) METHOD - IOPT=4. */ case AVERAGE: diss[ind1] = ( membr[i2] * diss[ind1] + membr[j2] * diss[ind2] ) / (membr[i2] + membr[j2]); break; /* * MCQUITTY'S METHOD - IOPT=5. */ case MCQUITTY: diss[ind1] = 0.5 * diss[ind1]+0.5*diss[ind2]; break; /* * MEDIAN (GOWER'S) METHOD - IOPT=6. */ case MEDIAN: diss[ind1] = 0.5* diss[ind1]+0.5*diss[ind2] -0.25*xx; break; /* * CENTROID METHOD - IOPT=7. */ case CENTROID: diss[ind1] = (membr[i2]*diss[ind1] + membr[j2]*diss[ind2] - membr[i2] * membr[j2]*xx / (membr[i2] + membr[j2]) ) / (membr[i2] + membr[j2]); break; } /* end switch */ if( (i2 < k) && ( diss[ind1] < dmin ) ) { dmin = diss[ind1]; jj=k; } if( (i2 > k) && (nn[k]!=j2) && ( diss[ind1] < disnn[k] ) ) { disnn[k]=diss[ind1]; nn[k]=i2; } } /* 800 */ } membr[i2] = membr[i2] + membr[j2]; disnn[i2] = dmin; nn[i2] = jj; /* * Update list of NNs insofar as this is required. */ for ( i=0; i< (*n-1) ; i++) { if( flag[i] && ((nn[i] == i2 ) || (nn[i] == j2) ) ) { dmin = inf; for ( j=i+1; j< *n ; j++) { ind= ioffst(*n,i,j); if(flag[j] && (i != j) && (diss[ind] < dmin) ) { dmin =diss[ind]; jj=j; } nn[i] = jj; disnn[i] = dmin; } } } /*printf("%d/%d\n",ncl,*n);*/ } /* end of while */ SmartPtr iia (*n ); SmartPtr iib (*n ); hierclust::hcass2(n,ia,ib,iorder,iia.get(),iib.get()); /* * Cette boucle devrait etre evitee... */ for (i=0; i< *n; i++ ) { ia[i]= iia[i]; ib[i]= iib[i]; } *result = 0; } } amap/src/acprob.h0000644000176200001440000000434513275645271013420 0ustar liggesusers#ifndef ACPROB_H #define ACPROB_H 1 #ifdef __cplusplus extern "C" { #endif /*! noyau: base function for kernel computation * \brief compute a kernel. called by W or VarRob * \param u: input data (scalar) * \param k: char, g, q, t, e, c, u for: * gaussien = (2*pi)^(-1/2) * exp(-u^2/2), * quartic = 15/16 * (1-u^2)^2 * (abs(u)<1), * triweight = 35/32 * (1-u^2)^3 * (abs(u)<1), * epanechikov = 3/4 * (1-u^2) * (abs(u)<1), * cosinus = pi/4 * cos (u*pi/2) * (abs(u)<1), * uniform = 1/2 * (abs(u)<1), * \param res: output data: one value of type double */ void noyau(double *u, char **k,double *res) ; /** W compute a "local" variance This function is called directly by R * \brief this functions compute a "local" variance, using a specific kernel. * This function depends on function mult, norm and noyau * \param x: matrix; input data n x p * \param h: window size (scalar) * \param d: scalar product matrix p x p * \param n: length x * \param p: number of columns of x * \param kernel: kernel utilised * \param res: matrix returned (allocated in R) * * \note * matrix x[i,j] (n x p) is substitute * by vector vecteur x[i + j x n] (i=0..n-1 ; j=0..p-1) * * \param result flag 0 => correct * 1 => Pb * 2 => Cannot allocate memory */ void W(double *x,double *h,double *d,int *n,int *p,char **kernel,double *res, int * result); /** VarRob: compute robust variance. Function called birecly by R * \brief Robust variance... gives a low ponderation to isolated * values. This ponderation is determined with kernel and window size. * This function depends on function mult, norm and noyau * \param x: data matrix n x p * \param h: kernel window size (scalar) * \param d: matrix of scalar product p x p * \param n: lenght of x * \param p: length of x * \param kernel: kernel used * \param res result (matrix) * \param result flag 0 => correct * 1 => Pb * 2 => Cannot allocate memory */ void VarRob(double *x,double *h,double *d,int *n,int *p,char **kernel,double *res, int * result); #ifdef __cplusplus }; #endif #endif amap/src/acprob.cpp0000644000176200001440000001334013275645271013746 0ustar liggesusers/*! \file : acprob.c * * * \brief Robust principal component analysis * * \date Created : 06/11/02 * \date Last Modified : Time-stamp: <2014-12-17 18:55:45 antoine> * * This Message must remain attached to this source code at all times. * This source code may not be redistributed, nor may any executable * based upon this source code. * * \author Antoine Lucas (antoinelucas@libertysurf.fr) * * Please notify me of any changes made to the code * * */ #include #include #include #include "R.h" #ifndef M_PIl #define M_PIl 3.1415926535897932384626433832795029L /* pi */ #endif #include "smartPtr.h" #include "acprob.h" /* Compiliation: */ /* R CMD SHLIB acprob.c */ /* Fonction noyau dans R: */ /* dyn.load(paste("prog/acp/src/acprob", .Platform$dynlib.ext, sep = "")) */ /* .C("noyau",as.double(0.6),as.character('g'),res=double(1)) */ /*! noyau: base function for kernel computation * \brief compute a kernel. called by W or VarRob * \param u: input data (scalar) * \param k: char, g, q, t, e, c, u for: * gaussien = (2*pi)^(-1/2) * exp(-u^2/2), * quartic = 15/16 * (1-u^2)^2 * (abs(u)<1), * triweight = 35/32 * (1-u^2)^3 * (abs(u)<1), * epanechikov = 3/4 * (1-u^2) * (abs(u)<1), * cosinus = pi/4 * cos (u*pi/2) * (abs(u)<1), * uniform = 1/2 * (abs(u)<1), * \param res: output data: one value of type double */ void noyau(double *u, char **k,double *res) { double pi= M_PIl; switch (**k) { case 'g' : *res = pow(2 * pi,-0.5) * exp(-pow(*u ,2)/2) ; break; case 'q' : *res = 15.0/16 * pow(1- pow(*u,2),2) * (fabs(*u)<1); break; case 't' : *res = 35.0/32 * pow(1- pow(*u,2),3) * (fabs(*u)<1); break; case 'e' : *res = 3.0/4 * (1- pow(*u,2)) * (fabs(*u)<1); break; case 'c' : *res = pi/4 *cos(*u * pi/2) * (fabs(*u)<1); break; case 'u' : *res = 1.0/2 * (fabs(*u)<1) ; break; } /* return *res; */ } /* dans R: switch(kernel, gaussien = (2*pi)^(-1/2) * exp(-u^2/2), quartic = 15/16 * (1-u^2)^2 * (abs(u)<1), triweight = 35/32 * (1-u^2)^3 * (abs(u)<1), epanechikov = 3/4 * (1-u^2) * (abs(u)<1), cosinus = pi/4 * cos (u*pi/2) * (abs(u)<1), uniform = 1/2 * (abs(u)<1), */ /** norm * \brief compute norm: sqrt(x'.d.x). called by W or VarRob * \param x: vector of size p * \param p: size of vector x and matrix d * \param d: matrix of size pxp */ double norm(double *x,int *p,double *d) /* * x: vecteur p:1 * d: matrice p x p * On calcule sqrt( x'.d.x ) */ { int i,j; double res=0; for (i=0; i < *p ; i++) for (j=0; j < *p ; j++) res += d[i+ j * *p]* x[i]*x[j]; return sqrt ( res ); } /** mult * \brief multiplication x.x' (return a matrix). called by W or VarRob * \param x: vector of size p * \param p: size of vector x and matrix d * \param res: matrix of result */ void mult(double *x,int *p,double *res) /* * x: vecteur p:1 * On calcule la matrice x.x' */ { int i,j; for (i=0; i < *p ; i++) for (j=0; j < *p ; j++) res[i+ j * *p] = x [i] * x [j] ; } /** W compute a "local" variance This function is called directly by R * \brief this functions compute a "local" variance, using a specific kernel. * This function depends on function mult, norm and noyau * \param x: matrix; input data n x p * \param h: window size (scalar) * \param d: scalar product matrix p x p * \param n: length x * \param p: number of columns of x * \param kernel: kernel utilised * \param res: matrix returned (allocated in R) * * \note * matrix x[i,j] (n x p) is substitute * by vector vecteur x[i + j x n] (i=0..n-1 ; j=0..p-1) * * \param result flag 0 => correct * 1 => Pb * 2 => Cannot allocate memory */ void W(double *x,double *h,double *d,int *n,int *p,char **kernel,double *res, int * result) { SmartPtr delta (*p); SmartPtr temp (*p * *p); double N=0,K=0,som=0; int i,j,k,l; *result = 1; for (l=0; l < (*p * *p) ; l++) res[l]=0; for (i=0; i < (*n-1) ; i++) { for (j=i+1; j < *n ; j++) { /* delta = Xi-Xj (ligne i et j de la matrice X) */ for (k=0; k < *p ; k++) delta[k]=x[i+(k * *n)]- x[j+(k * *n)]; N = norm(delta.get(),p,d)/ *h; /* tmp2 = K ( |delta/h|^2 ) */ noyau(&N,kernel,&K); som += K; /* temp = delta * delta' (matrice) */ mult(delta.get(),p,temp.get()); for (l=0; l < (*p * *p) ; l++) res[l] += temp[l] * K ; } } for (l=0; l < (*p * *p) ; l++) res[l] = res[l] / som ; *result = 0; } /** VarRob: compute robust variance. Function called birecly by R * \brief Robust variance... gives a low ponderation to isolated * values. This ponderation is determined with kernel and window size. * This function depends on function mult, norm and noyau * \param x: data matrix n x p * \param h: kernel window size (scalar) * \param d: matrix of scalar product p x p * \param n: lenght of x * \param p: length of x * \param kernel: kernel used * \param res result (matrix) * \param result flag 0 => correct * 1 => Pb * 2 => Cannot allocate memory */ void VarRob(double *x,double *h,double *d,int *n,int *p,char **kernel,double *res, int * result) { int i,j; SmartPtr temp (*p * *p); SmartPtr Xi (*p); double N=0,K=0,som=0; *result = 1; som = 0; for (i=0; i < *n ; i++) { for (j=0; j < *p ; j++) Xi[j]=x[i+(j * *n)]; N = norm(Xi.get(),p,d)/ *h; noyau(&N,kernel,&K); mult(Xi.get(),p,temp.get()); for (j=0; j < (*p * *p) ; j++) res[j] += temp[j] * K ; som += K; } for (j=0; j < (*p * *p) ; j++) res[j] = res[j] / som ; *result = 0; } amap/src/distance_T.h.h0000644000176200001440000006040014326040207014431 0ustar liggesusers/*! \file distance.c * \brief all functions requiered for R dist function and C hcluster function. * * \date Created: probably in 1995 * \date Last modified: Time-stamp: <2022-10-25 22:01:11 (antoine)> * * \author R core members, and lately: Antoine Lucas * * * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 1998, 2001 Robert Gentleman, Ross Ihaka and the * R Development Core Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #define _AMAP_DISTANCE_TEMPLATE_CPP 1 #ifdef HAVE_CONFIG_H #include #endif #include "distance_T.h" #include "matriceTriangle.h" #include "distance.h" #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #define MAX( A , B ) ( ( A ) > ( B ) ? ( A ) : ( B ) ) #define MIN( A , B ) ( ( A ) < ( B ) ? ( A ) : ( B ) ) namespace amap { // --------------------------------------------------------- // Distance euclidean (i.e. sqrt(sum of square) ) // // Euclidean distance between 2 vectors a,b is // d = sqrt[ sum_i (a_i - b_i)^2 ] // // This function compute distance between 2 vectors x[i1,] & y[i2,] // x and y are matrix; we use here only line i1 from x and // line i2 from y. Number of column (nc) is the same in x and y, // number of column can differ (nr_x, nr_y). // // Flag will be set to 0 if NA value computed in distance // // When call by function distance or hclust, x and y are the same; it computes // distance between vector x[i1,] and x[i2,] // // \param x matrix of size nr_x * nc; line i1 is of interest // \param y matrix of size nr_y * nc; line i1 is of interest // \param nr_x number of row in matrix x // \param nr_y number of row in matrix y // \param nc number of column in matrix x or y // \param i1 row choosen in matrix x // \param i2 row choosen in matrix y // \param flag set to 0 if NA value computed in distance // \param opt: unused // // Return: distance value // // --------------------------------------------------------- template T distance_T::R_euclidean(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T dev, dist; int count, i; count= 0; dist = 0; for(i = 0 ; i < x.size() && i < y.size() ; i++) { if(R_FINITE(x[i]) && R_FINITE(y[i])) { dev = (x[i] - y[i]); dist += dev * dev; count++; } } if(count == 0) // NA for all j: { *flag = 0; return NA_REAL; } if(count != x.size()) dist /= ((T)count/x.size()); return sqrt(dist); } // --------------------------------------------------------- // // Distance maximum (supremum norm) // // Maximum distance between 2 vectors a,b is // d = max |ai - bi | // // This function compute distance between 2 vectors x[i1,] & y[i2,] // x and y are matrix; we use here only line i1 from x and // line i2 from y. Number of column (nc) is the same in x and y, // number of column can differ (nr_x, nr_y). // // Flag will be set to 0 if NA value computed in distance // // When call by function distance or hclust, x and y are the same; it computes // distance between vector x[i1,] and x[i2,] // // \param x matrix of size nr_x * nc; line i1 is of interest // \param y matrix of size nr_y * nc; line i1 is of interest // \param nr_x number of row in matrix x // \param nr_y number of row in matrix y // \param nc number of column in matrix x or y // \param i1 row choosen in matrix x // \param i2 row choosen in matrix y // \param flag set to 0 if NA value computed in distance // \param opt: unused // // Return: distance value // // --------------------------------------------------------- template T distance_T::R_maximum(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T dev, dist; int count, j; count = 0; dist = std::numeric_limits::min(); for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { dev = fabs(x[j] - y[j]); if(dev > dist) dist = dev; count++; } } if(count == 0) { *flag = 0; return NA_REAL; } return dist; } // --------------------------------------------------------- // Distance manhattan (i.e. sum of abs difference ) // // manhattan distance between 2 vectors a,b is // d = sum_i | a_i - b_i | // // This function compute distance between 2 vectors x[i1,] & y[i2,] // x and y are matrix; we use here only line i1 from x and // line i2 from y. Number of column (nc) is the same in x and y, // number of column can differ (nr_x, nr_y). // // Flag will be set to 0 if NA value computed in distance // // When call by function distance or hclust, x and y are the same; it computes // distance between vector x[i1,] and x[i2,] // // \param x matrix of size nr_x * nc; line i1 is of interest // \param y matrix of size nr_y * nc; line i1 is of interest // \param nr_x number of row in matrix x // \param nr_y number of row in matrix y // \param nc number of column in matrix x or y // \param i1 row choosen in matrix x // \param i2 row choosen in matrix y // \param flag set to 0 if NA value computed in distance // \param opt: unused // // Return: distance value // // --------------------------------------------------------- template T distance_T::R_manhattan(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T dist; int count, j; count = 0; dist = 0; for(j = 0 ; j < x.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { dist += fabs(x[j] - y[j]); count++; } } if(count == 0) { *flag = 0; return NA_REAL; } if(count != x.size()) dist /= ((T)count/x.size()); return dist; } // --------------------------------------------------------- // Distance Camberra // // Camberra distance between 2 vectors a,b is // d = sum_i | a_i - b_i | / | a_i + b_i | // // This function compute distance between 2 vectors x[i1,] & y[i2,] // x and y are matrix; we use here only line i1 from x and // line i2 from y. Number of column (nc) is the same in x and y, // number of column can differ (nr_x, nr_y). // // Flag will be set to 0 if NA value computed in distance // // When call by function distance or hclust, x and y are the same; it computes // distance between vector x[i1,] and x[i2,] // // \param x matrix of size nr_x * nc; line i1 is of interest // \param y matrix of size nr_y * nc; line i1 is of interest // \param nr_x number of row in matrix x // \param nr_y number of row in matrix y // \param nc number of column in matrix x or y // \param i1 row choosen in matrix x // \param i2 row choosen in matrix y // \param flag set to 0 if NA value computed in distance // \param opt: unused // // Return: distance value // // --------------------------------------------------------- template T distance_T::R_canberra(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T dist, sum, diff; int count, j; count = 0; dist = 0; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { sum = fabs(x[j] + y[j]); diff = fabs(x[j] - y[j]); if (sum > DBL_MIN || diff > DBL_MIN) { dist += diff/sum; count++; } } } if(count == 0) { *flag = 0; return NA_REAL; } if(count != x.size()) dist /= ((T)count/x.size()); return dist; } /** \brief Distance binary */ template T distance_T::R_dist_binary(vecteur & x, vecteur & y , int * flag, T_tri & opt) { int total, count, dist; int j; total = 0; count = 0; dist = 0; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { if(x[j] || y[j]){ count++; if( ! (x[j] && y[j]) ) dist++; } total++; } } if(total == 0) { *flag = 0; return NA_REAL; } if(count == 0) return 0; return (T) dist / count; } /** \brief Pearson / Pearson centered (correlation) * \note Added by A. Lucas */ template T distance_T::R_pearson(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T num,sum1,sum2, dist; int count,j; count= 0; num = 0; sum1 = 0; sum2 = 0; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { num += (x[j] * y[j]); sum1 += (x[j] * x[j]); sum2 += (y[j] * y[j]); count++; } } if(count == 0) { *flag = 0; return NA_REAL; } dist = 1 - ( num / sqrt(sum1 * sum2) ); return dist; } /** \brief Absoulute Pearson / Pearson uncentered (correlation) * \note Added by L. Cerulo */ template T distance_T::R_abspearson(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T num,sum1,sum2, dist; int count,j; count= 0; num = 0; sum1 = 0; sum2 = 0; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { num += (x[j] * y[j]); sum1 += (x[j] * x[j]); sum2 += (y[j] * y[j]); count++; } } if(count == 0) { *flag = 0; return NA_REAL; } dist = ( num / sqrt(sum1 * sum2) ); if (dist<0) { dist*=-1; } return (1-dist); } /** \brief Distance correlation (Uncentered Pearson) * \note Added by A. Lucas */ template T distance_T::R_correlation(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T num,denum2,sumx,sumy,sumxx,sumyy,sumxy; int count,j; count= 0; sumx=0; sumy=0; sumxx=0; sumyy=0; sumxy=0; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { sumxy += (x[j] * y[j]); sumx += x[j]; sumy += y[j]; sumxx += x[j] * x[j]; sumyy += y[j] * y[j]; count++; } } if(count == 0) { *flag = 0; return NA_REAL; } num = sumxy - ( sumx*sumy /count ); denum2 = (sumxx - (sumx*sumx /count ) )* (sumyy - (sumy*sumy /count ) ) ; if(denum2 <=0) { return 0; } return 1 - (num / sqrt(denum2)); } /** \brief Absolute Distance correlation (Uncentered Pearson) * \note Added by L. Cerulo */ template T distance_T::R_abscorrelation(vecteur & x, vecteur & y , int * flag, T_tri & opt) { T num,denum,sumx,sumy,sumxx,sumyy,sumxy,dist,term; int count,j; count= 0; sumx=0; sumy=0; sumxx=0; sumyy=0; sumxy=0; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(R_FINITE(x[j]) && R_FINITE(y[j])) { sumxy += (x[j] * y[j]); sumx += x[j]; sumy += y[j]; sumxx += x[j] * x[j]; sumyy += y[j] * y[j]; count++; } } if(count == 0) { *flag = 0; return NA_REAL; } num = sumxy - ( sumx*sumy /count ); term=(sumxx - (sumx*sumx /count ) )* (sumyy - (sumy*sumy /count ) ); if (term<=0) return 1; denum = sqrt( term ); dist=num/denum; if (dist<0) { dist*=-1; } return (1-dist); } // --------------------------------------------------------- // Distance Spearman // // Spearman distance between 2 vectors a,b is // d = sum_i (rank(a_i) - rank(b_i) )^2 // // If one NA found: return NA // // This function compute distance between 2 vectors x[i1,] & y[i2,] // x and y are matrix; we use here only line i1 from x and // line i2 from y. Number of column (nc) is the same in x and y, // number of column can differ (nr_x, nr_y). // // Flag will be set to 0 if NA value computed in distance // // When call by function distance or hclust, x and y are the same; it computes // distance between vector x[i1,] and x[i2,] // // \param x matrix of size nr_x * nc; line i1 is of interest // \param y matrix of size nr_y * nc; line i1 is of interest // \param nr_x number of row in matrix x // \param nr_y number of row in matrix y // \param nc number of column in matrix x or y // \param i1 row choosen in matrix x // \param i2 row choosen in matrix y // \param flag set to 0 if NA value computed in distance // \param opt: a set of 6 vectors of size nc, allocated but uninitialised. // aim of this parameter is to avoid several vector allocation // // Return: distance value // // --------------------------------------------------------- template T distance_T::R_spearman(vecteur & x, vecteur & y , int * flag, T_tri & opt) { int j; double * data_tri_x = opt.data_tri_x.get(); int * order_tri_x = opt.order_tri_x.get(); int * rank_tri_x = opt.rank_tri_x.get(); double * data_tri_y = opt.data_tri_y.get(); int * order_tri_y = opt.order_tri_y.get(); int * rank_tri_y = opt.rank_tri_y.get(); int n; T diffrang=0; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(!(R_FINITE(x[j]) && R_FINITE(y[j]))) { *flag = 0; return NA_REAL; } order_tri_x[j] = rank_tri_x[j] = order_tri_y[j] = rank_tri_y[j] = j; data_tri_x[j] = x[j]; data_tri_y[j] = y[j]; } n = x.size(); /* sort and compute rank */ /* First list */ rsort_rank_order(data_tri_x, order_tri_x,rank_tri_x, &n); /* Second list */ rsort_rank_order(data_tri_y, order_tri_y,rank_tri_y, &n); for(j=0;j< x.size();j++) { diffrang += pow((T) ( rank_tri_x[j] - rank_tri_y[j]),2); } return( diffrang ); /* * verification in R: * Dist(x,method='spearman') ; n =dim(x)[2] * l=c(x[3,],x[4,]); sum((rank(l[1:n])-rank(l[(n+1):(2*n)]))^2) * cor.test(x[3,],x[4,],method="spearm")$statistic */ } /** \brief Kendall distance (rank base metric) * 1 - corr_kendall(x,y) * * \note Added by A. Lucas * template T distance_T::R_kendall_corr(double * x, double * y , int nr_x, int nr_y, int nc, int i1, int i2, int * flag, T_tri & opt) { int j,k; double * data_tri_x = opt.data_tri_x; int * order_tri_x = opt.order_tri_x; int * rank_tri_x = opt.rank_tri_x; double * data_tri_y = opt.data_tri_y; int * order_tri_y = opt.order_tri_y; int * rank_tri_y = opt.rank_tri_y; int n; T dist,P=0; for(j = 0 ; j < nc ; j++) { if(!(R_FINITE(x[i1]) && R_FINITE(y[i2]))) { *flag = 0; return NA_REAL; } order_tri_x[j] = rank_tri_x[j] = order_tri_y[j] = rank_tri_y[j] = j; data_tri_x[j] = x[i1]; data_tri_y[j] = y[i2]; i1 += nr_x; i2 += nr_y; } n = nc; // sort and compute rank // First list rsort_rank_order(data_tri_x, order_tri_x,rank_tri_x, &n); // Second list rsort_rank_order(data_tri_y, order_tri_y,rank_tri_y, &n); for(j=0;j T distance_T::R_kendall(vecteur & x, vecteur& y , int * flag, T_tri & opt) { int j,k; double * data_tri_x = opt.data_tri_x.get(); int * order_tri_x = opt.order_tri_x.get(); int * rank_tri_x = opt.rank_tri_x.get(); double * data_tri_y = opt.data_tri_y.get(); int * order_tri_y = opt.order_tri_y.get(); int * rank_tri_y = opt.rank_tri_y.get(); int n; T dist,P=0; bool ordre_x,ordre_y; for(j = 0 ; j < x.size() && j < y.size() ; j++) { if(!(R_FINITE(x[j]) && R_FINITE(y[j]))) { *flag = 0; return NA_REAL; } order_tri_x[j] = rank_tri_x[j] = order_tri_y[j] = rank_tri_y[j] = j; data_tri_x[j] = x[j]; data_tri_y[j] = y[j]; } n = x.size(); /* sort and compute rank */ /* First list */ rsort_rank_order(data_tri_x, order_tri_x,rank_tri_x, &n); /* Second list */ rsort_rank_order(data_tri_y, order_tri_y,rank_tri_y, &n); for(j=0;j void distance_T::distance(double *x, int *nr, int *nc, T *d, int *diag, int *method,int *nbprocess, int * ierr,int i2) { int i; T_argument * arguments; bool dc = (*diag) ? 0 : 1; /* diag=1: we do the diagonal */ /* * Arguments sent to thread (adress): * number of thread * nr * nc * dc * *x * *d * *method * *ierr */ arguments = (T_argument * ) malloc ((*nbprocess) * sizeof( T_argument )); //printf("nb processs %d\n",*nbprocess); for(i=0; i< *nbprocess; ++i) { arguments[i].id =i; arguments[i].x=x; arguments[i].nr = nr; arguments[i].nc = nc; arguments[i].dc = dc; arguments[i].d = d; arguments[i].method = method; arguments[i].nbprocess= *nbprocess; arguments[i].ierr=ierr; arguments[i].i2=i2; } *ierr = 1; /* res = 1 => no missing values res = 0 => missings values */ #ifndef WIN32 pthread_t * th = (pthread_t *) malloc ( *nbprocess * sizeof(pthread_t)); for (i=0; i < *nbprocess ; i++) { pthread_create(th+i,0,distance_T::thread_dist,(void *)(arguments+i)); } /* Attends la fin */ for (i=0; i < *nbprocess ; i++) { pthread_join(*(th+i),NULL); } free( th); #else // p_thread not yet used on windows. arguments[0].nbprocess = 1; arguments[0].i2 = i2; thread_dist((void *)arguments); #endif free( arguments ); } //template T distance_T::distance(double * x, double * y , int nr_x, int nr_y, int nc, // // get the distance function // template void distance_T::getDistfunction(int method,distfunction& distfun) { // T (*distfun)(double*,double*,int, int, int, int, int, int *, T_tri &) = NULL; switch(method) { case EUCLIDEAN: distfun = R_euclidean; break; case MAXIMUM: distfun = R_maximum; break; case MANHATTAN: distfun = R_manhattan; break; case CANBERRA: distfun = R_canberra; break; case BINARY: distfun = R_dist_binary; break; case PEARSON: distfun = R_pearson; break; case CORRELATION: distfun = R_correlation; break; case SPEARMAN: distfun = R_spearman; break; case KENDALL: distfun = R_kendall; break; case ABSPEARSON: distfun = R_abspearson; break; case ABSCORRELATION: distfun = R_abscorrelation; break; default: { error("distance(): invalid distance"); distfun = R_euclidean; } } } /** thread_dist function that compute distance. * */ template void* distance_T::thread_dist(void* arguments_void) { int nbprocess,nr,nc,i,j,dc,ij; T_argument * arguments = static_cast(arguments_void); T * d; double * x; int * method; int * ierr; /* for spearman dist */ T_tri opt ; distfunction distfun; short int no = arguments[0].id; nr = *arguments[0].nr; nc = *arguments[0].nc; dc = arguments[0].dc; x = arguments[0].x; d = arguments[0].d; method = arguments[0].method; nbprocess = arguments[0].nbprocess; ierr = arguments[0].ierr; int i2 = arguments[0].i2; matrice myMatrice (x, nr, nc); matriceTriangle distMatrice(d, nr, false); getDistfunction(*method,distfun); if( (*method == SPEARMAN) || (*method == KENDALL)) { opt.reset(nc); } /* debut = ((nr+1) / nbprocess + 1 ) * no ; fin = min ( ((nr+1) / nbprocess + 1) * ( no + 1 ) , (nr+1)); */ /* debut des boucles 0 fin: nr+1 */ int debut = (int) floor( ((nr+1.)*nbprocess - sqrt( (nr+1.)*(nr+1.) * nbprocess * nbprocess - (nr+1.)*(nr+1.) * nbprocess * no ) )/nbprocess); int fin = (int) floor(((nr+1.)*nbprocess - sqrt( (nr+1.)*(nr+1.) * nbprocess * nbprocess - (nr+1.)*(nr+1.) * nbprocess * (no+1.) ) )/nbprocess); if (fin > nr) { fin = nr; } //printf("Thread %d debut %d fin %d i2=%d met=%d\n",no,debut,fin,i2,*method); // here: the computation ! // for(j = 0 ; j <= nr ; j++) if (i2==-1) /* compute all distance matrix*/ { for(j = debut ; j < fin ; j++) { vecteur distRow = distMatrice.getRow(j); vecteur rowJ = myMatrice.getRow(j); ij = (2 * (nr-dc) - j +1) * (j) /2 ; for(i = j+dc ; i < nr ; i++) { vecteur rowI = myMatrice.getRow(i); distRow[i] = distfun(rowI, rowJ ,ierr,opt); } } } else { /* updates the distance only for i2*/ // a row of distance matrix vecteur distRow = distMatrice.getRow(i2); vecteur rowI = myMatrice.getRow(i2); for(j = debut ; j < fin ; j++) { if (i2!=j) { vecteur rowJ = myMatrice.getRow(j); distRow[j] = distfun(rowI, rowJ,ierr,opt); //printf("updated dist %d %d %f\n",i2,j,d[ind1]); } } } return (void*)0; } // --------------------------------------------------------- // // R_distance_kms: compute distance between individual i1 and // centroid i2 // // compute distance and call one of function R_euclidean or R_... // This function is called by kmeans_Lloyd2 // // \param x input matrix (individuals) // \param y input matrix (centroids) // \param nr1,nr2,nc number of row (nr1:x, nr2:y) and columns // nr individuals with nc values. // \param i1, i2: indice of individuals (individual i1, centroid i2) // \param method 1, 2,... method used // \param ierr for NA 0 if no value can be comuted due to NA // \param opt optional parameter send to spearman dist. // // --------------------------------------------------------- template T distance_T::distance_kms(vecteur & x, vecteur & y , int *method, int * ierr, T_tri & opt) { /* * compute distance x[i1,*] - y[i2,*] * x matrix n x p * y matrix m x p * nr1 = n; nr2 = m; nc =p */ T res; distfunction distfun; getDistfunction(*method,distfun); // here: distance computation res = distfun(x,y,ierr, opt); return( res); } }; amap/src/distance.cpp0000644000176200001440000000270413275645271014274 0ustar liggesusers #include "distance.h" #include "distance_T.h" using namespace amap; /** * R_distance: compute parallelized distance. Function called direclty by R * \brief compute distance and call function thread_dist * that call one of function R_euclidean or R_... * \param x input matrix * \param nr,nc number of row and columns * nr individuals with nc values. * \param d distance half matrix. * \param diag if we compute diagonal of dist matrix (usualy: no). * \param method 1, 2,... method used * \param nbprocess: number of threads to create * \param ierr error return; 1 good; 0 missing values */ void R_distance(double *x, int *nr, int *nc, double *d, int *diag, int *method,int *nbprocess, int * ierr) { distance_T::distance(x,nr,nc, d,diag,method, nbprocess, ierr,-1); } /** * Sort, and return order and rank * \brief This function is used by R_spearman. * order and rank must be initialised with 0:(n-1) * make sort, return x sorted * order = order(x) - 1 * rank = rank(x) -1 * */ void rsort_rank_order(double *x, int *order, int *rank, int * n) { double v; int i, j, h, iv; for (h = 1; h <= *n / 9; h = 3 * h + 1); for (; h > 0; h /= 3) for (i = h; i < *n; i++) { v = x[i]; iv = order[i]; j = i; while (j >= h && (x[j - h] > v)) { x[j] = x[j - h]; order[j] = order[j-h]; rank[order[j]] = j; j -= h; } x[j] = v; order[j] = iv; rank[order[j]] = j; } } amap/src/kmeans.cpp0000644000176200001440000000750313275645271013762 0ustar liggesusers/*! \file : kmeans.c * * * \brief K-means clustering * * \date Created : before 2005 * \date Last Modified : Time-stamp: <2014-03-01 12:51:00 antoine> * * \author R core team. Modified by A. Lucas for distance choice. * * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2004 The R Development Core Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include /*#include "modreg.h" */ /* for declarations for registration */ #include "kmeans.h" #include "distance_T.h" using namespace amap; /** K-means clustering using Lloyd algorithm. * \brief compute k-nearest centroid of our dataset. * \param x matrix of size nxp: input data * \param pn nb of individual (pn=n) * \param pp number of observation by individual (pp=p) * \param cen matrix of size k*p: centroids * \param pk number of centroids (k) * \param cl vector of flag of size n * \param pmaxiter integer: maximum iteration * \param nc vector of size k: number of individuals in cluster k. * \param wss vector of size k: sum of square in each cluster. * \param method: which method to use. */ void kmeans_Lloyd2(double *x, int *pn, int *pp, double *cen, int *pk, int *cl, int *pmaxiter, int *nc, double *wss, int * method) { /* n: nb of individuals * k: nb of clusters * p: number of abservations by individuals * x: matrix of size nxp * cen: matrix of size kxp */ int n = *pn, k = *pk, p = *pp, maxiter = *pmaxiter; int iter, i, j, c, it, inew = 0; double best, dd; Rboolean updated; distance_T::T_tri opt; int ierr[1]; //double * data_tri; //int * order_tri; //int * rank_tri; matrice dataMatrice (x, n,p); matrice centroidMatrice (cen, k, p); if( (*method == distance_T::SPEARMAN) || (*method == distance_T::KENDALL)) { opt.reset(p); } for(i = 0; i < n; i++) cl[i] = -1; for(iter = 0; iter < maxiter; iter++) { updated = FALSE; for(i = 0; i < n; i++) { /* find nearest centre for each point */ best = R_PosInf; for(j = 0; j < k; j++) { vecteur dataI = dataMatrice.getRow(i); vecteur centroidJ = centroidMatrice.getRow(j); dd = distance_T::distance_kms(dataI, centroidJ,method,ierr,opt); /*printf("| %f",dd); */ if(dd < best) { best = dd; inew = j+1; } } if(cl[i] != inew) { updated = TRUE; cl[i] = inew; } } if(!updated) break; /* update each centre */ for(j = 0; j < k*p; j++) cen[j] = 0.0; for(j = 0; j < k; j++) nc[j] = 0; for(i = 0; i < n; i++) { it = cl[i] - 1; nc[it]++; for(c = 0; c < p; c++) cen[it+c*k] += x[i+c*n]; } for(j = 0; j < k*p; j++) cen[j] /= nc[j % k]; } *pmaxiter = iter + 1; /* for(j = 0; j < k; j++) wss[j] = 0.0; */ for(i = 0; i < n; i++) { it = cl[i] - 1; vecteur dataI = dataMatrice.getRow(i); vecteur centroidJ = centroidMatrice.getRow(it); wss[it] = distance_T::distance_kms(dataI, centroidJ,method,ierr,opt); wss[it] = wss[it] * (wss[it]) ; /* for(c = 0; c < p; c++) { tmp = x[i+n*c] - cen[it+k*c]; wss[it] += tmp * tmp; }*/ } } amap/src/matrice.h0000644000176200001440000000551013275645271013571 0ustar liggesusers#ifndef AMAP_matrice #define AMAP_matrice 1 #include namespace amap { template class array { public: /** accessor to a data * \param index index in array * \return data */ virtual T & operator[] (int index) = 0; }; template class vecteur { private: array & myMatrice; int indexFirstData; int stepByData; int vectorSize; public: vecteur(array & values_p, int indexFirstData_p, int stepByData_p, int size) : myMatrice(values_p), indexFirstData(indexFirstData_p), stepByData(stepByData_p) , vectorSize(size) { }; /** * get data at index. * \param index index of data. * \return data. */ virtual T & operator[] (int index) { if (index >= vectorSize) { error("vecteur::operator[]: out of bound %d - %d", index, vectorSize); } return (myMatrice)[indexFirstData + (index * stepByData)]; }; /** * get size. * \return size */ virtual int size() { return vectorSize; }; }; /** * Matrix data. * * a matrix with 3 row and 4 cols * +---+---+---+---+ * | 0 | 3 | 6 | 9 | * +---+---+---+---+ * | 1 | 4 | 7 | 10| * +---+---+---+---+ * | 2 | 5 | 8 | 11| * +---+---+---+---+ * * */ template class matrice : public array { private: /** * Array with values */ T * values; /** * number of rows. */ int nrow ; /** * number of cols. */ int ncol; public: /** * Contructor. * \param values_p the data matrix * \param nrows_p the number of rows * \param ncols_p the number of cols. */ matrice(T * values_p, int nrow_p, int ncol_p) : values(values_p), nrow(nrow_p), ncol(ncol_p) { }; /** * Accessor on data. */ virtual T & operator[] (int index) { return values[index]; }; /** * get a row. * \return row i. */ vecteur getRow(int index) { if (index >= nrow) { error("matrice::getRow(): out of bound %d - %d", index, nrow); } vecteur myRow (*this, index, nrow, ncol); return myRow; }; /** * get a column. * \return col i. */ vecteur getCol(int index) { if (index >= ncol) { error("matrice::getCol(): out of bound %d - %d", index, ncol); } vecteur myCol (*this, index*nrow, 1, nrow); return myCol; }; /** * getSize. */ int size() { return nrow * ncol; }; /** * accessor. * \return number of rows. */ int getNrow() { return nrow; } /** * accessor. * \return number of rows. */ int getNcol() { return ncol; } }; }; #endif amap/src/hclust.h0000644000176200001440000000156213275645271013452 0ustar liggesusers#ifdef __cplusplus extern "C" { #endif void hclust(int *n,int *len, int *iopt ,int *ia , int *ib,int *iorder,double *crit,double *membr,double *diss, int *result); void hcluster(double *x, int *nr, int *nc, int *diag, int *method, int *iopt ,int *ia , int *ib,int *iorder,double *crit,double *membr,int *nbprocess,int * precision, int * result); #ifdef __cplusplus }; namespace hierclust { /** Hierachical clustering subroutine * \brief compute hierachical clustering from a distance matrix * This routine is called by hclust * \param n number of individuals * \param ia, ib result (merge) * \param iia, iib result (merge) * \param iorder result (order) * * \note this is an adaptation of the fortran function designed from the * R core team. */ void hcass2( int *n, int *ia, int *ib,int *iorder, int *iia, int *iib); }; #endif amap/src/Makevars.in0000644000176200001440000000003214326047373014064 0ustar liggesusersPKG_LIBS = -pthread -lc_r amap/src/matrice.cpp0000644000176200001440000000161613275645271014127 0ustar liggesusers#include "matrice.h" #include "matriceTriangle.h" #include extern "C" { /** * purpose of this function is to display a matrix, for unitary testing. */ void checkMatrix(double * values, int * nrow, int * ncol) { amap::matrice myMatrix(values, *nrow, *ncol); Rprintf("\n"); for (int i = 0 ; i < *nrow; i++) { amap::vecteur row = myMatrix.getRow(i); for (int j = 0 ; j < row.size(); j++) { Rprintf("%f\t", row[j]); } Rprintf("\n"); } } void checkMatrixTriangle(double * values, int * nrow, int * isDiagonal) { amap::matriceTriangle myMatrix(values, *nrow, *isDiagonal); Rprintf("\n"); for (int i = 0 ; i < *nrow; i++) { amap::vecteur row = myMatrix.getRow(i); for (int j = 0 ; j < row.size(); j++) { Rprintf("%f\t", row[j]); } Rprintf("\n"); } } }; amap/vignettes/0000755000176200001440000000000014326566177013221 5ustar liggesusersamap/vignettes/amap.Rnw0000644000176200001440000000342210677417044014621 0ustar liggesusers% building this document: (in R) Sweave ("ctc.Rnw") \documentclass[a4paper]{article} \title{Amap Package} \author{Antoine Lucas} %\VignetteIndexEntry{Introduction to amap} %\VignettePackage{amap} \SweaveOpts{echo=FALSE} %\usepackage{a4wide} \begin{document} \maketitle \tableofcontents \section{Overview} {\tt Amap} package includes standard hierarchical clustering and k-means. We optimize implementation (with a parallelized hierarchical clustering) and allow the possibility of using different distances like Eulidean or Spearman (rank-based metric). We implement a principal component analysis (with robusts methods). \section{Usage} \subsection{Clustering} The standard way of building a hierarchical clustering: <>= library(amap) data(USArrests) h = hcluster(USArrests) plot(h) @ Or for the ``heatmap'': <>= heatmap(as.matrix(USArrests), hclustfun=hcluster, distfun=function(u){u}) @ On a multiprocessor computer: <>= h = hcluster(USArrests,nbproc=4) @ The K-means clustering: <>= Kmeans(USArrests,centers=3,method="correlation") @ \subsection{Robust tools} A robust variance computation: <>= data(lubisch) lubisch <- lubisch[,-c(1,8)] varrob(scale(lubisch),h=1) @ A robust principal component analysis: <>= p <- acpgen(lubisch,h1=1,h2=1/sqrt(2)) plot(p) @ Another robust pca: <>= p <- acprob(lubisch,h=4) plot(p) @ \section{See Also} Theses examples can be tested with command {\tt demo(amap)}.\\ \noindent All functions has got man pages, try {\tt help.start()}.\\ \noindent Robust tools has been published: \cite{caussinu+ruiz} and \cite{caussinu+ruiz2}. \bibliographystyle{plain} \bibliography{amap} \end{document} amap/vignettes/amap.bib0000644000176200001440000000176313275070200014577 0ustar liggesusers@ARTICLE{caussinu+ruiz, author = "H. Caussinus and S. Hakam and A. Ruiz-Gazen", title= "Projections r\'ev\'elatrices contr\^ol\'ees. Recherche d'individus atypiques", journal = "Revue de Statistique Appliqu\'ee", year = 2002, volume = 50, number=4, } @ARTICLE{caussinu+ruiz2, author = "H. Caussinus and M. Fekri and S. Hakam and A. Ruiz-Gazen", title = "A monitoring display of multivariate outliers", journal = "Computational Statistics and Data Analysis", year = 2003, volume = 44, month = "October", pages = "237-252", } @ARTICLE{mpetitjean, author = "M. Petitjean", title = "Agr\'egation des similarit\'es: une solution oubli\'ee.", journal = "RAIRO Oper. Res.", year = 2002, volume = 36, number=1, pages = "101-108", } @BOOK{R:writtingRExt, author = {R core}, title = {Writing R Extensions}, publisher = {Unknown}, year = 2007, address = {Unknown}, abstract = {covers how to create your own packages, write R help files, and the foreign language (C, C++, Fortran, ...) interfaces.} }amap/Changes0000644000176200001440000000654112444342270012473 0ustar liggesusersWeb Dec 17 2014 * fix C++ warns. Sat Mar 01 2014 * Fix C++ code. Wed Feb 26 2014 * remove DUP=FALSE in .C call. Tue Dec 03 2013 * remove [again] printf in C++ code * fix memory leaks * add non-regression tests. Wed Sep 11 2013 * remove printf in C/c++ code Sun Nov 06 2011: 0.8-6 * fix distances pearson and correlation (problem with vector 0,0,0...) * add new distances: absolute pearson, absolute correlation * add new link "centroid2" Fri Oct 23 2009:0.8-4 * minor bug fix Mon Sep 31 2007: 0.8-2 * add kendall distance. * change afc man page. Mon Sep 31 2007: 0.8-1 * add parameter labels to plot.acp * use matrix instead of data.frame in internal pca data. * remove #include when built with windows. * k-means hclust and dist use common functions for distance computation * k-means possible with spearman distance Sat Sep 29 2007: 0.8 * clustering possible with float precision; use of templates * suppression of duplicated code(used for no thread / multiple thread) * use of more safe parameter to thead function * correction on man page: only ascii characters Mon Jan 22 2007: 0.7-3 * dimnames(x)[[1]] <- NULL seems not to be allowed anymore. -> changes in acp.R acprob.R Wed Jan 21 2007: 0.7-2 * correct package dependences * minor changes in documentation Tue Jan 20 2006: 0.7-1 * new function pop (optimal partition) * new function diss (dissimilarity) Sat Nov 12 2005: 0.6 * new function burt, matlogic & afc * split functions concerning interactions with other software in package ctc * internationalization (mainly: french). Mon Oct 17 2005: 0.5-1 * minor change on doc (reference to acp function deleted) * minor change to R Kmeans function * load Biobase on startup when available. Mon Oct 03 2005: 0.5 * Delete function acp (recomand use of prcomp and princomp) * add support of class "exprSet" in hcluster, dist and kmeans Tue Sep 27 2005 * merge packages ctc and amap Tue Jul 12 2005: 0.4-4 * demo file * vignette Fri Jul 08 2005: 0.4-3 * example amap.php for a web-application. Wed Mar 16 2005: 0.4-2 * man flag \preformated too recent... changed to \code Tue Mar 15 2005: 0.4-1 * code without C++ style comments. Mon Mar 14 2005: 0.4 * Implement kmeans from stats package and add support for several distances. Wed Mar 09 2005 * New distance "spearman" based on rank. Mon Feb 28 2005: 0.3 * Parallelization for functions dist & hcluster * function dist move to Dist. Tue Dec 07 2004: 0.2-7 * Changes on doc, links and references Tue Dec 07 2004: 0.2-7 * .Fists.lib change to load package stats instead of mva. Wed Jun 23 2004: 0.2-6 * deleting functions (redondance with mva) hclust,plot.hclust,plclust Thu Feb 6 2004: 0.2-5 * function zzz.R modified * Change minor "warning" on manual fixed. Thu Feb 5 2004: 0.2-4 * Change e-mail and date in DESCRIPTION file. Fri Jul 11 2003: 0.2-2 * bug fixed in varrob * fixed documentation varrob.Rd Wed May 28 2003 * hcluster check if distance matrix has missing values * new function acprob for robust pca. Mon Feb 17 2003: 0.2-1 * minor bug fixed for acp & acpgen Fri Feb 14 2003: 0.2 * The package now handles memory allocation errors * Dimnames change for loadings and scores in pca * U renamed as varrob * \link{}s in the docs refer to correct packages amap/R/0000755000176200001440000000000013574500477011405 5ustar liggesusersamap/R/acprob.R0000644000176200001440000001120113275576707013000 0ustar liggesusers#------------------------------------------------------- # # Created : 30/10/02 # Last Modified : Time-stamp: <2018-05-12 16:44:23 (antoine)> # # Description : Robust principal component analysis # # Author : Antoine Lucas # lucas@toulouse.inra.fr # # Licence : GPL # #------------------------------------------------------- K <- function(u,kernel="gaussien") { switch(kernel, gaussien = (2*pi)^(-1/2) * exp(-u^2/2), quartic = 15/16 * (1-u^2)^2 * (abs(u)<1), triweight = 35/32 * (1-u^2)^3 * (abs(u)<1), epanechikov = 3/4 * (1-u^2) * (abs(u)<1), cosinus = pi/4 * cos (u*pi/2) * (abs(u)<1), uniform = 1/2 * (abs(u)<1), ) } # Variance locale W <- function(x,h,D=NULL,kernel="gaussien") { x <- as.matrix(x) n <- dim(x)[1] p <- dim(x)[2] if (is.null(D)) { D <- diag(1,p) } x <- as.vector(x) D <- as.vector(D) kernel <- substr(kernel,1,1) VarLoc <- .C( C_W, as.double(x), as.double(h), as.double(D), as.integer(n), as.integer(p), as.character(kernel), res=double(p*p), result = as.integer(1), PACKAGE= "amap" ) if(VarLoc$result == 2) stop("Cannot allocate memory") if(VarLoc$result == 1) stop("Error") matrix(VarLoc$res,p) } varrob <- function(x,h,D=NULL,kernel="gaussien") { x <- as.matrix(x) x <- scale(x, center = TRUE, scale = FALSE) n <- dim(x)[1] p <- dim(x)[2] if (is.null(D)) { D <- diag(1,p) } x <- as.vector(x) D <- as.vector(D) kernel <- substr(kernel,1,1) Calcul <- .C( C_VarRob, as.double(x), as.double(h), as.double(D), as.integer(n), as.integer(p), as.character(kernel), res=double(p*p), result = as.integer(1), PACKAGE= "amap") if(Calcul$result == 2) stop("Cannot allocate memory") if(Calcul$result == 1) stop("Error") S <- matrix(Calcul$res,p) Sinv <- solve(S) solve ( Sinv - D / h) } acpgen <- function(x,h1,h2,center=TRUE,reduce=TRUE,kernel="gaussien") { # CENTRONS, ET REDUISONS x <- as.matrix(x) x <- scale(x ,center = center, scale = FALSE) if (reduce == TRUE) { x <- apply(x,2,function(u) { u/stats::sd(u)}) } # ESTIMATION DE W et VarRob n <- dim(x)[1] VarInv <- solve(stats::var(x)*(n-1)/n) # solve= inverser leU <- varrob(x,h1,D=VarInv,kernel=kernel) leW <- W(x,h2,D=VarInv,kernel=kernel) Winv <- solve(leW) # anal. spec de Var.W^-1 : EIG <- eigen(leU %*% Winv) V <- EIG$vector #EIG <- eigen( x %*% Winv %*% t(x) ) #U <- EIG$vector #n <- dim(x)[1] #p <- dim(x)[2] #S <- diag(Re(EIG$values),n) #S1 <- diag(Re(1/EIG$values),n) #S <- sqrt(S[,1:p]) #S1 <- sqrt(S1[,1:p]) #V <- t(x)%*% U%*% S1 # X=U.S.V' -> V = X' U S^-1 # AFFICHAGE DES RESULTATS scores <- x %*% Winv %*% V V <- as.matrix(V) scores <- as.matrix(scores) dimnames(V)[[2]] <- paste("Comp",1:dim(x)[2]) if(!is.null( dimnames(x)[[2]] )) dimnames(V)[[1]] <- dimnames(x)[[2]] if(!is.null( dimnames(x)[[1]] )) dimnames(scores)[[1]] <- dimnames(x)[[1]] dimnames(scores)[[2]] <- paste("Comp",1:dim(x)[2]) eig <- sqrt(EIG$values) sdev <- apply(scores,2,stats::sd) res <- list(eig=eig,sdev=sdev,scores=scores,loadings=V) class(res) <- "acp" res } acprob <- function(x,h=1,center=TRUE,reduce=TRUE,kernel="gaussien") { x <- as.matrix(x) x <- scale(x ,center = center, scale = FALSE) if (reduce == TRUE) { x <- apply(x,2,function(u) { u/stats::sd(u)}) } EIG <- eigen( varrob(x,h),symmetric=TRUE) V <- EIG$vector # ou bien: V=svd(x)$v val <- sqrt(EIG$values) scores <- x %*% V V <- as.matrix(V) scores <- as.matrix(scores) dimnames(V)[[2]] <- paste("Comp",1:dim(x)[2]) if(!is.null( dimnames(x)[[2]] )) dimnames(V)[[1]] <- dimnames(x)[[2]] if(!is.null( dimnames(x)[[1]] )) dimnames(scores)[[1]] <- dimnames(x)[[1]] dimnames(scores)[[2]] <- paste("Comp",1:dim(x)[2]) sdev <- apply(scores,2,stats::sd) res <- list(eig=val,sdev=sdev,scores=scores,loadings=V) class(res) <- "acp" res } amap/R/acp.R0000644000176200001440000000754313275362715012303 0ustar liggesusers#------------------------------------------------------- # # Created : 29/10/02 # Last Modified : Time-stamp: <2018-05-11 20:49:49 (antoine)> # # Description : Principal component analysis # # Author : Antoine Lucas # lucas@toulouse.inra.fr # # Licence : GPL # #------------------------------------------------------- acp <- function(x,center=TRUE,reduce=TRUE,wI=rep(1,nrow(x)),wV=rep(1,ncol(x))) { x <- as.matrix(x) if(center) x <- t(t(x) - as.vector(( wI %*% x)/sum(wI))) ## x <- scale(x ,center = center, scale = FALSE) if (reduce) x <- apply(x,2,function(u) { u/stats::sd(u)}) ## Di.X'.Dv.X EIG <- eigen( (t(x)* wI) %*% (x * wV) ,symmetric=FALSE) V <- EIG$vector # ou bien: V=svd(x)$v EIG$values <- Re(EIG$values) V <- V %*% diag(sign(EIG$values)) val <- sqrt(abs(EIG$values)) scores <- x %*% V V <- as.matrix(Re(V)) scores <- as.matrix(Re(scores)) dimnames(V)[[2]] <- paste("Comp",1:dim(x)[2]) if(!is.null( dimnames(x)[[2]] )) dimnames(V)[[1]] <- dimnames(x)[[2]] if(!is.null(dimnames(x)[[1]])) dimnames(scores)[[1]] <- dimnames(x)[[1]] dimnames(scores)[[2]] <- paste("Comp",1:dim(x)[2]) ##cmpr <- x %*% (sqrt(wV) * as.matrix(V)) sdev <- apply(scores,2,stats::sd) res <- list(eig=val,sdev=sdev,scores=scores,loadings=V) class(res) <- "acp" res } pca <- acp print.acp <- function(x, ...) { #cat("Call:\n"); dput(x$call) cat("\nStandard deviations:\n") print(x$sdev, ...) cat("\nEigen values:\n") print(x$eig, ...) invisible(x) } # # SECTION GRAPHIQUES # plot.acp <- function(x,i=1,j=2,text=TRUE,label='Composants',col='darkblue',main='Individuals PCA',variables=TRUE,individual.label=NULL,...) { U <- x$scores XLAB <- paste(label,i) YLAB <- paste(label,j) plot.new() plot.window(range(U[,i]),range(U[,j])) axis(1,labels=TRUE,tick=TRUE) axis(2,labels=TRUE,tick=TRUE) box() title(xlab=XLAB,ylab=YLAB,main=main) if(text){ if(is.null(individual.label)) { individual.label=dimnames(x$scores)[[1]] } text(labels=individual.label,U[,i],U[,j],col=col,...) } else{ points(U[,i],U[,j],col=col,...) } if(variables) { par(new=TRUE) biplot.acp(x,circle=FALSE,label="",main="") } } biplot.acp <- function(x,i=1,j=2,label='Composants',col='darkblue',length=0.1,main='Variables PCA',circle=TRUE,...) { U <- x$loadings LIM <- c(-1.3,1.3) XLAB <- paste(label,i) YLAB <- paste(label,j) # PLOT DES AXES graphics::plot.new() graphics::plot.window(LIM,LIM) graphics::axis(1,labels=TRUE,tick=TRUE) graphics::axis(2,labels=TRUE,tick=TRUE) graphics::box() graphics::title(xlab=XLAB,ylab=YLAB,main=main) # PLOT DU NOM DES FLECHES graphics::text(x=U[,i]*1.3,y=U[,j]*1.3,labels=dimnames(U)[[1]],col=col) # PLOT DES FLECHES graphics::arrows(0,0,U[,i],U[,j],length = length,col=col) # CERCLE if(circle) { t2p <- 2 * pi * seq(0,1, length = 200) xc <- cos(t2p) yc <- sin(t2p) graphics::lines(xc,yc,col='darkblue') } } # Graphique: Eboulis des valeurs propres plot2 <- function(x,pourcent=FALSE,eigen=TRUE,label='Comp.',col='lightgrey',main='Scree Graph',ylab='Eigen Values') { if(eigen){ U <- x$eig } else { U <- x$sdev } if(pourcent){U <- U/sum(U) } n <- length(U) names <- paste(label,1:n) graphics::barplot(U,main=main,ylab=ylab,col=col,names.arg=names) } plotAll <- function(x) { graphics::par(mfrow=c(2,2)) plot2(x) ## boxplot(as.list(as.data.frame(x$cmpr))) graphics::plot(x,variables=FALSE) stats::biplot(x) graphics::plot(x,main="Both",variables=TRUE) } amap/R/Kmeans.R0000644000176200001440000000604113574500477012747 0ustar liggesusersKmeans <- function(x, centers, iter.max = 10, nstart = 1, method = "euclidean") { dokmeans <- function() { Z <- .C(C_kmeans_Lloyd2, as.double(x), as.integer(m), as.integer(ncol(x)), centers = as.double(centers), as.integer(k), c1 = integer(m), iter = as.integer(iter.max), nc = integer(k), wss = double(k), method=as.integer(method), PACKAGE="amap") if (Z$iter > iter.max) warning("did not converge in ", iter.max, " iterations", call. = FALSE) if (any(Z$nc == 0)) warning("empty cluster: try a better set of initial centers", call. = FALSE) Z } METHODS <- c("euclidean", "maximum", "manhattan", "canberra", "binary","pearson","correlation","spearman","kendall","abspearson","abscorrelation") method <- pmatch(method, METHODS) if (is.na(method)) stop("invalid distance method") if (method == -1) stop("ambiguous distance method") if(inherits(x,"exprSet")) { requireNamespace("Biobase") x <- Biobase::exprs(x) } x <- as.matrix(x) m <- nrow(x) if(missing(centers)) stop("'centers' must be a number or a matrix") if(length(centers) == 1) { k <- centers ## we need to avoid duplicates here if(nstart == 1) centers <- x[sample(1 : m, k), , drop = FALSE] if(nstart >= 2 || any(duplicated(centers))) { cn <- unique(x) mm <- nrow(cn) if(mm < k) stop("more cluster centers than distinct data points.") centers <- cn[sample(1:mm, k), , drop=FALSE] } } else { centers <- as.matrix(centers) if(any(duplicated(centers))) stop("initial centers are not distinct") cn <- NULL k <- nrow(centers) if(m < k) stop("more cluster centers than data points") } if(iter.max < 1) stop("'iter.max' must be positive") if(ncol(x) != ncol(centers)) stop("must have same number of columns in 'x' and 'centers'") Z <- .C(C_kmeans_Lloyd2, as.double(x), as.integer(m), as.integer(ncol(x)), centers = as.double(centers), as.integer(k), c1 = integer(m), iter = as.integer(iter.max), nc = integer(k), wss = double(k), method=as.integer(method), PACKAGE="amap") if(Z$iter > iter.max) warning("did not converge in ", iter.max, " iterations", call.=FALSE) if(any(Z$nc == 0)) warning("empty cluster: try a better set of initial centers", call.=FALSE) if(nstart >= 2 && !is.null(cn)) { best <- sum(Z$wss) for(i in 2:nstart) { centers <- cn[sample(1:mm, k), , drop=FALSE] ZZ <- dokmeans() if((z <- sum(ZZ$wss)) < best) { Z <- ZZ best <- z } } } centers <- matrix(Z$centers, k) dimnames(centers) <- list(1:k, dimnames(x)[[2]]) cluster <- Z$c1 if(!is.null(rn <- rownames(x))) names(cluster) <- rn out <- list(cluster = cluster, centers = centers, withinss = Z$wss, size = Z$nc) class(out) <- "kmeans" out } amap/R/burt.R0000644000176200001440000000211113275576723012504 0ustar liggesusers ## matlogic <- function(x) { n=nrow(x) m=ncol(x) nblev <- apply(x,2,function(u){nlevels(as.factor(u))}) ## Keep names.... rownames <- rownames(x) colnames <- colnames(x) i <- 0 colnamesnew <- c(apply(x,2,function(u){ i<<- i+1;paste(colnames[i],levels(as.factor(u)),sep=".")}),recursive=TRUE) k <- sum(nblev) res <- as.integer(matrix(0,ncol=k,nrow=n)) x <- c(x,recursive=TRUE) result <- .C(C_matind, as.integer(nblev), as.integer(x), res=res, as.integer(n), as.integer(m), as.integer(k), PACKAGE="amap") result <- matrix(result$res,ncol=k) rownames(result) <- rownames colnames(result) <- colnamesnew result } burt <- function(x) { ind <- matlogic(x) t(ind) %*% ind } ## x: table de burt, ou table afc <- function (x) { f <- as.matrix(x/sum(x)) fi <- apply(f,1,sum) fj <- apply(f,2,sum) ## Dr = diag(fi) ## Dc = diag(fj) f <- (1/fi) * t(t(f)/fj) acp(f,wI=fi,wV=fj,center=TRUE,reduce=FALSE) } amap/R/diss.R0000644000176200001440000000057513275577225012504 0ustar liggesusersdiss <- function (x, w=rep(1,ncol(x))) { n <- nrow(x) p <- ncol(x) if(length(w) != p) { warning("Error in dimention on either w or x") return(NULL) } res <- .C(C_diss, as.integer(x), double(n*n), n,p, as.double(w), PACKAGE="amap") matrix(res[[2]],n) } amap/R/hcluster.R0000644000176200001440000000511513574500450013352 0ustar liggesusers## Hierarchical clustering ## ## Created : 18/11/02 ## Last Modified : Time-stamp: <2018-05-12 16:48:19 (antoine)> ## ## This function is a "mix" of function dist and function hclust. ## ## Author : Antoine Lucas ## hclusterpar <- hcluster <- function (x, method = "euclidean", diag = FALSE, upper = FALSE, link = "complete", members = NULL, nbproc = 2, doubleprecision = TRUE) { if(inherits(x, "exprSet")) x <- Biobase::exprs(x) ## take from dist if (!is.na(pmatch(method, "euclidian"))) method <- "euclidean" METHODS <- c("euclidean", "maximum", "manhattan", "canberra", "binary","pearson","correlation","spearman","kendall", "abspearson","abscorrelation") method <- pmatch(method, METHODS) if (is.na(method)) stop("invalid distance method") if (method == -1) stop("ambiguous distance method") N <- nrow(x <- as.matrix(x)) #take from hclust METHODSLINKS <- c("ward", "single", "complete", "average", "mcquitty", "median", "centroid","centroid2") link <- pmatch(link, METHODSLINKS) if (is.na(link)) stop("invalid clustering method") if (link == -1) stop("ambiguous clustering method") if (N < 2) stop("Must have n >= 2 objects to cluster") if (is.null(members)) members <- rep(1, N) if (length(members) != N) stop("Invalid length of members") n <- N precision <- 1 if(doubleprecision) precision <- 2 hcl <- .C(C_hcluster, x = as.double(x), nr = as.integer(n), nc = as.integer(ncol(x)), diag = as.integer(FALSE), method = as.integer(method), iopt = as.integer(link), ia = integer(n), ib = integer(n), order = integer(n), crit = double(n), members = as.double(members), nbprocess = as.integer(nbproc), precision = as.integer(precision), res = as.integer (1), NAOK=TRUE, PACKAGE= "amap") if(hcl$res == 2) stop("Cannot allocate memory") if(hcl$res == 3) stop("Missing values in distance Matrix") if(hcl$res == 1) stop("Error") tree <- list(merge = cbind(hcl$ia[1:(N - 1)], hcl$ib[1:(N - 1)]), height = hcl$crit[1:(N - 1)], order = hcl$order, labels = dimnames(x)[[1]], method = METHODSLINKS[link], call = match.call(), dist.method = METHODS[method] ) class(tree) <- "hclust" tree } amap/R/dist.R0000644000176200001440000000226613574500460012471 0ustar liggesusersDist <- function(x, method="euclidean", nbproc = 2, diag=FALSE, upper=FALSE) { if(inherits(x,"exprSet")) { requireNamespace("Biobase") x <- Biobase::exprs(x) } ## account for possible spellings of euclidean if(!is.na(pmatch(method, "euclidian"))) method <- "euclidean" METHODS <- c("euclidean", "maximum", "manhattan", "canberra", "binary","pearson","correlation","spearman","kendall","abspearson","abscorrelation") method <- pmatch(method, METHODS) if(is.na(method)) stop("invalid distance method") if(method == -1) stop("ambiguous distance method") N <- nrow(x <- as.matrix(x)) d <- .C(C_R_distance, x = as.double(x), nr= N, nc= ncol(x), d = double(N*(N - 1)/2), diag = as.integer(FALSE), method= as.integer(method), nbproc = as.integer(nbproc), ierr=as.integer(0), NAOK=TRUE, PACKAGE="amap" )$d attr(d, "Size") <- N attr(d, "Labels") <- dimnames(x)[[1]] attr(d, "Diag") <- diag attr(d, "Upper") <- upper attr(d, "method") <- METHODS[method] attr(d, "call") <- match.call() class(d) <- "dist" return(d) } amap/R/pop.R0000644000176200001440000000300613275642420012316 0ustar liggesuserspop <- function(x,fmbvr=TRUE,triabs=TRUE,allsol=TRUE) { couts <- as.matrix(x) n <- as.integer(nrow(couts)) ysave <- as.integer(matrix(0,nrow=n,ncol=n)) renum <- y <- ysave bornth <- z0 <- z <- as.double(0) res <- .Fortran(C_pnkfmb, as.integer(fmbvr), as.integer(triabs), as.integer(allsol), n = as.integer(n), couts = as.double(couts), ysave = ysave, y = ysave, renum= renum, bornth = bornth, nbcl0 = as.integer(0), z0 = z0 , nbcl = as.integer(0), z = z, nbemp = as.integer(0), nbdep = as.integer(0), nbsol = as.integer(0), nap = as.integer(0), PACKAGE="amap") class(res) <- "pop" return(res) } print.pop <- function(x,...) { i <- 1:x$n classes <- x$y[i+(i-1)*x$n] cat("Upper bound (half cost) :",x$bornth,'\n') cat("Final partition (half cost) :",x$z,'\n') cat("Number of classes :",x$nbcl,"\n") cat("Forward move count :",x$nbemp,"\n") cat("Backward move count :",x$nbdep,"\n") cat("Constraints evaluations count :",x$nap,"\n") cat("Number of local optima :",x$nbsol,"\n\n") print(data.frame(Individual=i,class=classes)) } amap/MD50000644000176200001440000000615014326676332011516 0ustar liggesusers6425782242cf3e5a5186b98d2d4b5a99 *Changes 0510d64fd90081b76080e59421d85b2e *DESCRIPTION 9b87025f779cbf59c4e611807d010a61 *INDEX da0fdd33fcfc8e9eb6b6989d369a0b9e *NAMESPACE 57c0c20655ec771b183c3d07eeaf7d1d *R/Kmeans.R 0e4a6fb503a0b193302823e0d6cf6039 *R/acp.R cecc24888d4ff760b46111ed6a0a3fa7 *R/acprob.R 96c149c0e68331643ff09c695c7c931e *R/burt.R 840308485d4b9e57ff7807872333f374 *R/diss.R 81e76ff58e0445d57ea446ed81e30284 *R/dist.R 94956050884b1b8c5d0edeacfb45b469 *R/hcluster.R e4aa724df4d3b29253d77c03e293fe97 *R/pop.R abc83c5d83cc5b7845b9928b0a27008b *build/vignette.rds 364a43413a10df0ffe981f35aeddf37f *cleanup 120b6938b77c8c83bc1db2397f25a4b6 *data/lubisch.tab.gz de314ddf28c269b98ad9ff281ed6f860 *demo/00Index ffec123e2067afe88ddc15000edd6b43 *demo/amap.R e0891bc3830d1d85ac186263199e8a55 *exec/amap.php edac769262ab42d201162cc0d6763a7f *inst/doc/amap.R 1f6194916110fe560cbdd55fc1b13ae2 *inst/doc/amap.Rnw af66090dba991e0a2fe6cf89a233f8b6 *inst/doc/amap.pdf 1f6194916110fe560cbdd55fc1b13ae2 *inst/doc/vignettes/amap.Rnw b83d1692381d779844bebf1efe5baa71 *inst/doc/vignettes/amap.bib fd3bdd9a56b153e377e4e5fc174a4e74 *inst/po/fr/LC_MESSAGES/R-amap.mo fd3bdd9a56b153e377e4e5fc174a4e74 *inst/po/po/fr/LC_MESSAGES/R-amap.mo 2bdfe04f448a6e40b56c52b16bad6640 *man/Kmeans.Rd 55be4ea146d4b6c51a24b7ad8ae1d3e1 *man/acp.Rd 8109de851720ec7e7522e0b0bb0a6dd6 *man/acpgen.Rd 2a01ad1055086a3e0e5893ede2fb3ecf *man/acprob.Rd 6ecbc9c9dd34aa56ef036d1c763c3b2c *man/afc.Rd 2b90d07a26ba121b889dcf626c4c8448 *man/burt.Rd 2d9bc5468cedc3cd71e6c58cdb33f2a2 *man/diss.Rd ee59491deb0e22db9ba5ee708c526de0 *man/dist.Rd c11e6b2a4cdb2c73113a471d86087891 *man/hcluster.Rd 30f468cb29bf1a593ff62bae61869b63 *man/lubisch.Rd 92f1f0cb76b1a8f87ef1f8c3df08e9d1 *man/plot.acp.Rd bf8a862477275a5dd74f95a838688400 *man/pop.Rd 56f9bc4e2dafcb8a7034abd91fcab9a1 *man/varrob.Rd 66c5107ea07d7c2b3ab59d157981d765 *po/R-amap.pot 84e38e6af2183dfef78f10fc4a27f4a2 *po/R-fr.po 1d80eada7a6d4ca459e23dd400949c8d *src/Makevars.in 0c5458498382c5874124768037f816cd *src/acprob.cpp 3539435e96dbe34cb6f4ac1166c64c89 *src/acprob.h 3ed81d1457abe794f4fd0990070961b8 *src/burt.c 3089a2ec0f8e806c906f8de689a9886e *src/diss.c 142de036d003824ac4eb1bce747f568f *src/distance.cpp 0bbf14c8b648739a6f53b5c8e0146327 *src/distance.h 53aa5c429e2a24a27a24fc8bb9f6b212 *src/distance_T.h 761948004f0bf73ff126147b54054aa9 *src/distance_T.h.h 37aa2ae8966ad80a389c519d22de0fcb *src/hclust.cpp 2b7cecb079de38b10f21504f64a04fb7 *src/hclust.h b8ddd602381bdc2611e1333559995c15 *src/hclust_T.h 3a86e75052c29598c5cb883afcd41ba7 *src/hclust_T.h.h d1d5ebf1ebaaeff126b32a8a43c4f2a3 *src/init.c d5cb712175f94b8943fe835c9c88547e *src/kmeans.cpp 863538393c686c98fdc9e9c297bf4513 *src/kmeans.h 2143f5b1097f085d61b4f634046a1b04 *src/matrice.cpp f1c9d082d35492fb10068d6c0588a258 *src/matrice.h b826a1a326c5d0c562f4fe6e35f0390f *src/matriceTriangle.h 39a55f456b8b382be81892274b370a90 *src/pop.f 968aadd85e44a2b47a32b1f8bd0bc574 *src/smartPtr.h c4b17a3e05886cd0d0a14d367dad80d2 *tests/amap-test.R 0050303e84ccaecee3999145421334b4 *tests/amap-test.Rout.save 1f6194916110fe560cbdd55fc1b13ae2 *vignettes/amap.Rnw cf3e3391344ea95f1711a432da3f4fe4 *vignettes/amap.bib amap/INDEX0000644000176200001440000000130713573775110011774 0ustar liggesusersacp Principal component analysis acpgen Generalised principal component analysis acprob Robust principal component analysis afc Correspondance factorial analysis. burt Compute burt table from a factor dataframe. diss Compute a dissimilarity matrix Dist Distance Matrix Computation hcluster Hierarchical Clustering Kmeans K-Means Clustering lubisch Dataset Lubischew plot.acp Graphics for Principal component Analysis pop Optimal Partition (classification). varrob Robust variance amap/inst/0000755000176200001440000000000012444343274012154 5ustar liggesusersamap/inst/doc/0000755000176200001440000000000013275070603012715 5ustar liggesusersamap/inst/doc/amap.Rnw0000644000176200001440000000342210677417044014333 0ustar liggesusers% building this document: (in R) Sweave ("ctc.Rnw") \documentclass[a4paper]{article} \title{Amap Package} \author{Antoine Lucas} %\VignetteIndexEntry{Introduction to amap} %\VignettePackage{amap} \SweaveOpts{echo=FALSE} %\usepackage{a4wide} \begin{document} \maketitle \tableofcontents \section{Overview} {\tt Amap} package includes standard hierarchical clustering and k-means. We optimize implementation (with a parallelized hierarchical clustering) and allow the possibility of using different distances like Eulidean or Spearman (rank-based metric). We implement a principal component analysis (with robusts methods). \section{Usage} \subsection{Clustering} The standard way of building a hierarchical clustering: <>= library(amap) data(USArrests) h = hcluster(USArrests) plot(h) @ Or for the ``heatmap'': <>= heatmap(as.matrix(USArrests), hclustfun=hcluster, distfun=function(u){u}) @ On a multiprocessor computer: <>= h = hcluster(USArrests,nbproc=4) @ The K-means clustering: <>= Kmeans(USArrests,centers=3,method="correlation") @ \subsection{Robust tools} A robust variance computation: <>= data(lubisch) lubisch <- lubisch[,-c(1,8)] varrob(scale(lubisch),h=1) @ A robust principal component analysis: <>= p <- acpgen(lubisch,h1=1,h2=1/sqrt(2)) plot(p) @ Another robust pca: <>= p <- acprob(lubisch,h=4) plot(p) @ \section{See Also} Theses examples can be tested with command {\tt demo(amap)}.\\ \noindent All functions has got man pages, try {\tt help.start()}.\\ \noindent Robust tools has been published: \cite{caussinu+ruiz} and \cite{caussinu+ruiz2}. \bibliographystyle{plain} \bibliography{amap} \end{document} amap/inst/doc/amap.pdf0000644000176200001440000021230314326566177014345 0ustar liggesusers%PDF-1.5 % 3 0 obj << /Length 1043 /Filter /FlateDecode >> stream xVMo6W9QJI}n. z{JEX+ "-;Crwvrio.^1Ylnqii*l7rcq!ˉ}1"dGRU1B4Xe!+T/!iF 㲨ǼȜUmm=+ˆ$̼ h4# 9)*{7!HXb1P͝ eS )Gyo2gQ##RN=5" @R@i1$PyIwaV%(KUc~q>őS"'a LMs>K2t7W],#׵)9촥:PYQz3Lzni JZ.YgEhqP88x^HvڈSJNbNElq>ɐ^#wiA~ g NS!ψڍACV#srdɃ2n$Nv8VH]`6D>J Ȁ wsV[)ݺun$I8dnv۽;H[G7[Ŵ!PWNIXhlP?fہ=!}nZŔD ݣV-Ɏ J >`kkW#_=fk|B{;)bn?䰄?E֓h @% xwYu NX#W#4|O떵y(D?e> &G09FnR(i{ K;D-1XX;趂۹_5pdǺä3&kB<BC63j\{jhPBz =xD'>XDwe`Y@տy> stream xڥVMo6WV C_AS6](H|Kre&VWr;CR^+pvɢ3潙^_\H`i _IF/pʣ1n3"O1.JZf<8"fE#d܅$(͈jV[nߏVٺk|H_q!mUI46p82w&~g/W- 8 B%eSF^ل E'궪#Fzd*yNVZZ|2~9 u]C!]cMo:wFUٝΰ*)*4+ZD` ]pZ"&pHil,#t ,Lz6ntT)8 ?Xmvwj$O$VBZnV-eRMQ4p+悂K4>V8N ҫgmeٔ{;)O_#)sa9㦩NoXJI4mA{H"$OzаW",L MTwj4a/Ȉ$MT@z, 3.߫Q cn7V'#>f縒ھkk.zmmF!߂T|'+Rw[Xʼn$hZ&\B"hTY}>K+K,UYm)R@%W\ OC7 Y6{lq 50|{ddW6mqT8 7.N%pŸ 9HX{xTra._85<P|h-Tum<3٠bYdbaSWκnގ_DuN_H&I(f9*a}/47f#l\x&xm s>'"IƐvN>ˣ-rF< v_W] endstream endobj 18 0 obj << /Length 233 /Filter /FlateDecode >> stream x}ϱJ@S^OXW0VbZ * [Y|B)>WF9 wPs=Bg^Ro y﹙kyeQRŝs[\}O/wZ[uKiK22&M\#Iok,?u3[a(s#$C@\FGUR͖U)^X9|X'zw)HWY-+Q#Kx endstream endobj 19 0 obj << /Length 219 /Filter /FlateDecode >> stream xUн@]X"yp7O&Bt),J-x`+ BX3wf>fQ6bG)38Afkbwq f̼)s>/'&t EP>{Z;f,OȞ?B]}t1LU|h!L+^ި=I T̝B?Kk Y +xir endstream endobj 20 0 obj << /Length 275 /Filter /FlateDecode >> stream xڅJ0顐}Ͳ º=ɃxR(y{(3itG&dfd^QAeE-Wt_g5G ZQmj_*Kz}y{Px[Uo @<9uf8g:&hFO^|IN{?,''Oi%_M ?KӴ L z@;u32<ی+٦ JfW-ƽ<%5ߒ uP:N}m endstream endobj 21 0 obj << /Length 249 /Filter /FlateDecode >> stream x]ѱN0ٮfZwnB{G4Q @dNAB^=IݠTd%s]Ksbrh6@^^43{2豹zD!;(d`!mXm ZB$BRm7WKPě_ ׊ endstream endobj 22 0 obj << /Length 261 /Filter /FlateDecode >> stream xMAJ0)]fa/sm+"BЕ quBQpG ihMIyM:dhOsj錎Oi'a?bKE67xK/lﮨfGO8ceID``g&@Y953ؕ#˙ fW<@ Es>(R :$V.bA*3J ʘsJڛ?&JI_B)Jr&| eDX#d? endstream endobj 23 0 obj << /Length 255 /Filter /FlateDecode >> stream xeбJ@?Lqy1;y),J--ɣR\g&w|'[1Ϲ#^<PSL[.V_ʘ^ߟ(__7|=PaH(fTA#{Ľ8=Nݯ#_+Atj֛4H`~AWQ~,@EkflF[b[Ϡ~-(N[NA/V袦?Fj endstream endobj 24 0 obj << /Length 212 /Filter /FlateDecode >> stream xM?@oH1\@ȻNbjະ)+P $`Nog7)SdgFA/}q7`o:Ph>ggiLjaDGIſ|:w/Hxx@@6/cGP!R^!'TH3=,њR;gXK%Hs$h%Ƣug+> stream x]ο POG@] b`955DS5f&>$)5}6+X8!C %jPfJ`Rjן旭Zz FB!‚_C4KhEoM> endstream endobj 26 0 obj << /Length 237 /Filter /FlateDecode >> stream xUαN@PL#0/ H3D+ cH 7Y0@IAXcClbv?;92Id#GdO!g^&^xWUc奼=]Iz/$w\G ~=BO \N nkm``\MdG :5">fg|w3ތT8ڦLH[e"48 6I|k endstream endobj 27 0 obj << /Length 193 /Filter /FlateDecode >> stream xm=@!$ S $&ZY+hfx=%-l,f&LC9QQф)LLs IK^nGՌ9owT p< AZ-@:hM,љTY(P zG߁ؐIavU.R8Uk Z B endstream endobj 28 0 obj << /Length 187 /Filter /FlateDecode >> stream xڅ1 @R,L^@ܹn),J-m5M)Sq793?<~Qq̇.6Ҍ􆣀žIgK]Gj!oCv^a JH˸;%BX[O ԎgU[kM4FF~xϕӁBT hњ~; 9 endstream endobj 29 0 obj << /Length 172 /Filter /FlateDecode >> stream x}1 @bم #BBRPQH!(9eٵ(E!/I )txAM )e8E!Q,LF.vQīI m%;L>?9:^j7N=j AvG ) E endstream endobj 30 0 obj << /Length 266 /Filter /FlateDecode >> stream xUAJ0?dQ^`0v:B[La.]WRU'GQ2xɢt|MUG^dy*W',WOxقt,ErHh,Z}> stream xUϱjP? 9/Pc0$Bj;u(ڎV2HQ#dt`]8x)?DxgDGNx/4/)|8Yb o7/ K7Sd蓺@7=bTEVӊUш?I4M;@AmQSuj#S}7~9`^B 詤tU endstream endobj 32 0 obj << /Length 190 /Filter /FlateDecode >> stream x=ο POG@]A(AAM T EmB/fo#AB߁;ˁ.=t谿6;)#ɭI;~=7~.ɄO.;gJ +92 = Y5"$*GE1_kMAێfb)n! a!"t5}6)G endstream endobj 33 0 obj << /Length 238 /Filter /FlateDecode >> stream x]ϿN0/!Қ?"R)ĀZF@j?y=D $|jr=.YMxzH]lo-_iVSȪNTBᆥ:'zzLfU/2k`&[~6bT~4Ѓ{Νh{FRDJ*+oFt:^Cf\8،&и%FӶt[ӂ~Jl endstream endobj 34 0 obj << /Length 209 /Filter /FlateDecode >> stream xE?N0gy-9 K+" &22`l%G U:mk>i.e{ۆɖs_mhՑybے9??^ɬn! x B`'#"QMU1"Q~9{Hw\fP3] ˃,a!aZW}p{EL~& < xD=/8b endstream endobj 35 0 obj << /Length 200 /Filter /FlateDecode >> stream x=ͱj`27h 6] fԡtҎ*:H|(V;QX\Fje%E)MT̂k1RvO1j}H9S B47Z4^7^;r<ȇ0)z!Be,; e__=FʼW|/Hd endstream endobj 36 0 obj << /Length 178 /Filter /FlateDecode >> stream x]1 @ )tMBą-,J-+GQrBt |(1%2EϨR.#ʒ;baPI(\4 ^nrJ1ʒ61E[4%o!Au4x@u/YqDwk;ppjhWO: m 837ġB endstream endobj 37 0 obj << /Length 216 /Filter /FlateDecode >> stream x51J@o";MBuS,he!Vj)x9a)BpSo\^]s-_Tܴ\ZKӶ5w1S WT##M~!J& zt9Fauޝ"Ya b&91ĐMJ^-}?9:o,Uێ;VF endstream endobj 38 0 obj << /Length 205 /Filter /FlateDecode >> stream xU1j@/L!]Xsx^"W.B*' v+h:aKxl%4ol9dxaa苬2g@˚%t§'3+~3Sb$PTh$&w;.Cչ Yw A HD)Ԁ TC8!#_^P=WDC)k VA endstream endobj 39 0 obj << /Length 243 /Filter /FlateDecode >> stream xUпJ@/l¼HSge!Vj)DN.>Z:_ca;SQ9m~ )T38,>')f(eHzB %m.ALsI7zkv+FQ"q I`{}w3 faB=3 ӍKM;t~='s.C˱ |GewUû%sLrȕ|ob3 endstream endobj 43 0 obj << /Length 199 /Filter /FlateDecode >> stream xڥ=@PL ȟ b&ZY+hxJ d)-bߛy63f%gtx0e5$ jOaj:*yAUlQtєg&̛}Nr 5r^ a2ʮ`i`r_zH&=| z)3WwFHH endstream endobj 44 0 obj << /Length 203 /Filter /FlateDecode >> stream xu1@EPLL 1D+ c&jQ8%gdB-^6gߑ;dO\q~ƨ4 Py*^r; SrPEqbtLR~3&0 > stream xU 0ES:ޢI N&O'8:knh@}7D%YgXnE68])$$ƒ~ܟv1ɂ1GG xos*!~Zo(k B" Pq>.۶{xcA+M;= endstream endobj 46 0 obj << /Length 187 /Filter /FlateDecode >> stream xU @ O Yxw8jotr'utPQ5I-$f2c-Z)+GZv*C@Hx=Π9sT/Ԩ"kF㇠ZFQ"7!\LŮ{kw; #e%(𮈻i^/aTtY!)y@,=l M>k endstream endobj 47 0 obj << /Length 167 /Filter /FlateDecode >> stream x313T0P04S5W05P0PH1*26(Bs<=\ %E\N \. ц \. 30߀JNa!?#I0#;xI#> stream xu1A50]c&k%P)DRAhQA;C_ V:F:i]yYm)5КԸI T:"$a"X B$֞?!#rljtjCsehx. MO {}RmU@#C3zT endstream endobj 49 0 obj << /Length 203 /Filter /FlateDecode >> stream x}Ͽ 0[дtj3:9::(> stream xuн0[xDD'㤎]GQxFB1K~\q4CCM1x "֡ΐJ[1𥎁ޮt=x= W3ƼVTQSc6CC55Q>Rp(s5Mے`_==?ͥGrJ"ZSZ endstream endobj 51 0 obj << /Length 151 /Filter /FlateDecode >> stream x313T0P0W0S01U01QH1*26([%s<͹=\ %E\N \. ц \. | @ v:QAA=N ?@J@#`p`\z> stream x=1 @ER~- g`#8RK EJ4RZ(ޑ'̨i> stream x313T0P04F )\\@$lIr p{IO_T.}g E!'E@!ncr e endstream endobj 54 0 obj << /Length 179 /Filter /FlateDecode >> stream x313T0P0Q5W0P0PH1*21 (Bds<L=\ %E\N \. ц \. @xD2?@,&=`C" ?ƏadjƎa݄lMI$b6LrzrrШA endstream endobj 55 0 obj << /Length 118 /Filter /FlateDecode >> stream x313T0P0S04S01S06QH1*2 (Z@ds<-=\ %E\N \. ц \. c$! b\\\ϊ> endstream endobj 56 0 obj << /Length 102 /Filter /FlateDecode >> stream x313T0P0"3#CCB.#)T&9ɓK?\ȒKCKW4K)YKE!P E >'W $ endstream endobj 57 0 obj << /Length 137 /Filter /FlateDecode >> stream x313T0P04S02W01V05RH1*22(Bs≮=\ %E\N \. ц \. QqC=C=2p\   \\\8 endstream endobj 58 0 obj << /Length 188 /Filter /FlateDecode >> stream xU=@`6$p.?`# b&ZY+h+L9 Gذ nKfQ!!^CUdx[a> stream xUϱN@ PK!~@ZK"" & Z> stream xm1JPYR |s}!` A+ RK Eʗ^a2Œ񟉋6̼yT尒x"p,\@_فs/*g. )&LOPvY`n ,{OěMx[l)zi&$vX?zΏE7 }t endstream endobj 61 0 obj << /Length 207 /Filter /FlateDecode >> stream xm= @irYV ),J--mM8mR,dgbF)MidPaly&T'͞ Zh = vA͒#Kv07}> stream xU; @? ` A+ RK E[7GQr)h1/t)ZEyɗϴOC-*2gd6:%Smx],vKȬqzjHHHC,10\qEqRc,S4EB訵H<,l)o e@)]X!uE{/^q endstream endobj 63 0 obj << /Length 212 /Filter /FlateDecode >> stream xuϱJ@_RG> stream xڕ1 P q(dGx9OA ZN⤎m֣xҘ!$!'3N*Φ|INY>-KNɗ[~>^W݊SSNNT D'Ҡi!4y;쑷Gwp{cjCe s]ؗʞZ."US9©-KI endstream endobj 65 0 obj << /Length 218 /Filter /FlateDecode >> stream xeαJA b > ]vj<-,J--mo||ybCBdy-j /;~2xxD-+j.KtoOԬY:ni0s #VH|ěFo;s+lq΅Ƕd,6ɺY'=alp +%D7p endstream endobj 66 0 obj << /Length 196 /Filter /FlateDecode >> stream xm= @'X#MXXSZYZZ(m#Xo[fa5B&x#/~,+E³N|n-f-nKn!R7 !Hꇨ+U4jdcޑM-孍@l_ "j~' f&74.WHe4A o \s` endstream endobj 67 0 obj << /Length 181 /Filter /FlateDecode >> stream xuα 0+ zO`RL'V08iGE7}4бC1:n83d3dftJFq> stream xmαN02Xŏ{H.X*E"L0"5)oG1o`ŃsaA t7;/%KGvA)N v=4GOYScs W,6+"< .L)'rf;GpaF]1P.;a?2yWL ǹG9^jo.G82TJ="b> stream x}1 @49IH,-,J--mMoL2LvY~ Gc 0G8 q bɁD9쎐y Y|=,9 ܂IѱË_ꪽ^cf8y/>_[;bPsfm]vҨVi.oVڷ[eڏ2t6 endstream endobj 70 0 obj << /Length 156 /Filter /FlateDecode >> stream x313T0P0bcKS#CB.cC I$r9yr+r{E=}JJS. @-\. =2>gg`zp=a&f?qA|.WO@.J endstream endobj 71 0 obj << /Length 154 /Filter /FlateDecode >> stream xuɱ 1 ኃG0O`\op Njh(bl-?崚aUÓ+>$?*_5o3z  H1D>1Cf$t cUIa.<5Ga D"JLKL`` ?:R endstream endobj 72 0 obj << /Length 194 /Filter /FlateDecode >> stream xu @`Ń0yVq :fNSuPY7|;4kuhgd4GO q^ͷ=@X f܂x>] C)C 6h[ }POmwj؊n֬GerۺInOs&y?ͅ_[*o&+jIhiKx endstream endobj 73 0 obj << /Length 180 /Filter /FlateDecode >> stream xm1 @ )xnBVJBBB"^do)BBbFST@F R/r@)Z?K6A}cE- ol}:X}"j&xovV$GC* ~f endstream endobj 74 0 obj << /Length 198 /Filter /FlateDecode >> stream xm1j@Ep!fsZ1d"W.B*'e h{A (&E a-]{^ҙ|Xr8}Rݒ;=K}A~qIג7j$2%32 ]hzdLs_Lä_Yt:wjh^H;FU.o%mZ-/LRz endstream endobj 75 0 obj << /Length 230 /Filter /FlateDecode >> stream xuνN0:D%{:&KmȀbj@y?BFi>@UJO򢸑Lȯ9Y^.wv™/}UI\ |~|]=%g\.7B>@T*ƒvPU> stream xuαJ@ )#d^@7!;N0Xr׺Qro`Y#\q|,Oۜ/Ҷ,7nV2oFOKds9F6۵l6PKF@f*;!ɅY$ rHT 'HqĘ8() p^we  * L1j ~-Sё1qx 0hD^)㫎 Zz endstream endobj 77 0 obj << /Length 179 /Filter /FlateDecode >> stream x}1 @]RVBVb(9BʈqvEy03L8I38Byrj5tكL@N0ހ)PR+IFdޒjIWZE,& *>`۰m$jKaj` U endstream endobj 78 0 obj << /Length 206 /Filter /FlateDecode >> stream xU1j@Eq!fo Rd\ l`W)B$e\vG)U8Mb3KtkZ>iyW]VGmZ[wy|گѧZg7}'8l"M !#T ppP\`~ԅƲꌀEwKr40À0=O%AnRZA endstream endobj 79 0 obj << /Length 176 /Filter /FlateDecode >> stream xuϽ @ nY ֫ 7:9::(>#tPCÑKm8r#:&xAk%5ጙC%k,ƭvd9%hr%HDbfRA#JA;=LVi@ &!`nOYo .n R endstream endobj 80 0 obj << /Length 178 /Filter /FlateDecode >> stream xm̱ 0H-}SV08ͣ7#tP> stream x==@!$x.d@ b&ZY+hq%g+̛@.Wy!5||4gN>0U(N$#;NQ=_;!EFg ꚮ~3 |4ؚ4#\Y]gr1WOL$ǭ#bVO endstream endobj 82 0 obj << /Length 216 /Filter /FlateDecode >> stream xEαn@ PGNO_KH@b!`b@L#nvH0e`'wgFJ)S)gG, 톊!څTVK:V6t՜b%71w%;]ͮ:$δ & nKoW1]ЋputF@uFjM0>ɏ) N6#0˾ j5>[ endstream endobj 83 0 obj << /Length 224 /Filter /FlateDecode >> stream xMα@ )iBy` A++Q);l3j:-(#IorNjNӜNP6hW%OR9Q[Qv$QKRvrM`> stream xe10 PW"y#' MKUJȀC X)GQz U 8eSI< e 15ߗ rKIr5JvDYPT)wK@1c5 0|2 GAw= /t:pZi|m˸иI Pt endstream endobj 85 0 obj << /Length 229 /Filter /FlateDecode >> stream xmбN@CA2 <əXg"WYBh<>%aKK6eg]B}}k{oxⷊ>.6-\WT<*#Syc]nyv@6CG'=D",2dfFz-mə1:;_w1|4t4hn7)xM> stream xUпJ@YR,LGȼnb.r6?` A+ RK E*-GHEq[E}\I)rVɢB+~ziRz>yzu^%k+snv#r69MD^HjO@IGJ3&`MS |08oF xo2("~B9~}B@BTB_Cmc1aH9ԝz xk endstream endobj 87 0 obj << /Length 214 /Filter /FlateDecode >> stream xe1j@[4'JT@!* q"JR n+s.*70‚,̃0ir$CdKyyωf^ˊ$9GlӃlKZhYqb~OC~OxCH7L-VhPjeL hA؀&jΨ\5әcts÷|*f endstream endobj 88 0 obj << /Length 251 /Filter /FlateDecode >> stream xUN0/ɋ @Td H01NͣQ=X1bdoݿꯇNVknӟ/b+C~g7A~u}N7;yq'rTL6lq#T%TӤE jU$T;xؙVpya"Q1|r9@af6Mq@R{ ͊Ie,yZ,[Q?_Wu endstream endobj 92 0 obj << /Length 105 /Filter /FlateDecode >> stream x3634R0Pb#CSCB. m@ $ɥs{IO_T.}gC.}hCX.O!'W ( endstream endobj 93 0 obj << /Length 306 /Filter /FlateDecode >> stream xŒ=N@ M!$)fE"T (AKrSXؓ,=S$_> stream xڭ1n0: w֠4YDH!d̐h9 G`j1RaKd}22yPD zIP"eDݓ̛ ŖdbQQdoiSEN܍WƩuJ3dkYAW fuM<7'Mn݀ASwMR \So'%uvrCh2<>\+#_2ocibBר?i h endstream endobj 95 0 obj << /Length 229 /Filter /FlateDecode >> stream xő; @72M4(SZYZZ( h"8P+q3z ;MVYmcsd4ٟ9ą!8~̸+fܒ^ ke"e, tGd?˄b$U5Ҋfl$*lMgn CJhVʷ3Fip endstream endobj 96 0 obj << /Length 226 /Filter /FlateDecode >> stream xu=n@gbi|eYGH@TDjh> X VyyD%JC80/*v[ dvջ\/_Gvxv+١hJʞ2Ն(W FOFFl@&%`}b zdeL,>2~dgygL[41Ƕ hKyJ BasQ D endstream endobj 97 0 obj << /Length 281 /Filter /FlateDecode >> stream xڕ=N0’!sHE"T ()@`)<؋$'{Iן5-5tA-ukZw75oZOv3RpC/^Rk-=ԣ/qZqg XxqdWjIpnIUi+W%KK"5-CiK #;A58E, k΢SvYlK S^`%*#G4dPɲ1:^.eiiC%>+^ ~ endstream endobj 98 0 obj << /Length 131 /Filter /FlateDecode >> stream x3634R0P0b#KsCB.#1s<L=\ %E\N \. ц \. 5 7?D # P?P1?H{pzrrD endstream endobj 99 0 obj << /Length 107 /Filter /FlateDecode >> stream x3634R0P0bc3KCB.#S I$r9yr+r{E=}JJS ]  b<]0q7c.WO@.S endstream endobj 100 0 obj << /Length 162 /Filter /FlateDecode >> stream x3332Q0Pa3 ebUej 䃹 \.'O.pSS.}(BIQi*S!BA,C}?7T10@ 6P?|'W [ endstream endobj 101 0 obj << /Length 213 /Filter /FlateDecode >> stream xڥ1 P #B[SV N⤎h=JбC1&E\|>?dј>c &tA$GOX4 "4 %]/#d5#MJ[h6%y=\0`..Y尀AK<@\@Q#6-WQwu;Sw ?kBKn&j״1a>7k.sk|]ŏf endstream endobj 102 0 obj << /Length 161 /Filter /FlateDecode >> stream x3137U0P0bcSCB.cK I$r9yr+[r{E=}JJS ]  b<]oH?1"~`? L7?bl'W n endstream endobj 103 0 obj << /Length 223 /Filter /FlateDecode >> stream xE1N@ E?b%790;"E"T (AKq%GH"4o4v]_+^sk{w6[{T^o(=fKdJ~|Q_stgj8UR:EZ ʷcVG@VjU'3rع: Fg u1vM#bj2;4@* endstream endobj 104 0 obj << /Length 173 /Filter /FlateDecode >> stream x3135S0P0R5T0P03VH1*26 (@ds<M=\ %E\N \. ц \. Xv8'=3,X w'C=`?`A<7@ ? r  ,t endstream endobj 105 0 obj << /Length 166 /Filter /FlateDecode >> stream x+@i*6#06&$  (D@@/G[58"e9P!Zj Z)%eʡ^Rv3:N[|LuM+C]MD ! a9PIcУd/-x>o;w*!aVB78\ d endstream endobj 106 0 obj << /Length 126 /Filter /FlateDecode >> stream x3530T0Pb 3SCB.c I$r9yr+[p{E=}JJS ]ry(000```` H0@,0%#zl'W  endstream endobj 107 0 obj << /Length 266 /Filter /FlateDecode >> stream xmбN0|G/qCyfίF0t^ߟlߣO;O$9 1!rHdڈ4f&pBl9{Ð68,ִ/vKqbҷ+tي%+NC7"EB8сVP #RI*h~j:Rᕤ[Il`Φʗ'& endstream endobj 111 0 obj << /Length 192 /Filter /FlateDecode >> stream xڅ1PDPl Ċ1D+ cmq@IA;WL0 v xlagnEt4'g'Ty!n{> stream xڅO; Pl {I*L!he!Vj)h-G,-$q̃T;LNuihuɗV'/2O4Ĭxq7 $$M | ,G\W{F9^ـ"J[|rY"ֱ4nT?pGrjݬc_e*[M* endstream endobj 113 0 obj << /Length 99 /Filter /FlateDecode >> stream x313T0P04F )\\@$lIr p{IO_T.}g E!'EA0XAՓ+ ; endstream endobj 114 0 obj << /Length 184 /Filter /FlateDecode >> stream xm=` .߁1D'㤎]ċ8p n #~$(}L> stream xm= @ x Ղ?` A+ RK E[)S,;h%Xfh< }:ex\T:8^pVQ>EmqF;)C}FE$ sXBט^Hȃ@?|bezYETZ_q-`R!a~K<.Kj/\ endstream endobj 116 0 obj << /Length 193 /Filter /FlateDecode >> stream xڕα@ .<} L &`qRG;[pqᾤ 5)+H+9s<^&|XLפ*L,r0S⺡MNMC $z11wx!"><Zi&N?>cH RaH'c ˁ:ѴmO, YK endstream endobj 117 0 obj << /Length 201 /Filter /FlateDecode >> stream xmPE4K BBrmM>}}V́;ܹiԥS=T'u9&a+NFF⻥OK+ VZ[( f#2;܃J>PDCv@Z }•cC 7'* 4u.7mp b2rcZI_ endstream endobj 118 0 obj << /Length 161 /Filter /FlateDecode >> stream x313T0P0bcSCCB.1s<L =\ %E\N @B4Pe,B @d ?  B~oAd $?HzI8'W z endstream endobj 119 0 obj << /Length 115 /Filter /FlateDecode >> stream x313T0P0b ebUel䃹 \.'O.pc.}(BIQi*Sm`Pz<7,{\W endstream endobj 120 0 obj << /Length 171 /Filter /FlateDecode >> stream xڽ= @[&G\@7!Q1#X^,7[n8ȃW3r9Al&]'-\,cx܎` s0 n ==Cbq1 SeKvI'mr/)T8R`5zf endstream endobj 121 0 obj << /Length 183 /Filter /FlateDecode >> stream x}=@XLvNBLH0XF[٣Q8ab^2}KJ)*%Kw4 +@@)juE]VQzB[_P :9o.A@9(dq%7@'a/=ߵG.^Tyh p A!\\[>P: endstream endobj 122 0 obj << /Length 200 /Filter /FlateDecode >> stream xڥ= @g fI"SZYZZ(ښͣ[.(wS|7q4HRYs_8 LWCNv?$#(%p:lHj&5pGٌs V,S*7;(&A]t, -GT@8=F> $_ȥF<5ޯ endstream endobj 123 0 obj << /Length 158 /Filter /FlateDecode >> stream xڭ1 @ПJuj!Fp A+ RKAEh9JAqc![̃I`4-ØԈmjw쎜{Vky\Y\/|9êe_Hx+5C8#$RC\B"xo<Iw endstream endobj 124 0 obj << /Length 185 /Filter /FlateDecode >> stream xM1 @4!s7q5@T0XErr,,2ԎgDM&rv=pr^ًYMyaoY!RrGB7 }KD#"eZSW!("PB Ca}96A=> stream x313T0P0bc 3CB.cS I$r9yr+r{E=}JJS ]  b<] @AH2`h AA~[@ Lx:B endstream endobj 129 0 obj << /Length 221 /Filter /FlateDecode >> stream xUϱJ@Ypa Z7/{I(E;0XݑˣQRn!93^:LOR -5O3Zc]G3,MFS+}bгT+\QM=`.If `kCt3ܛOZm\01it3(N䤲g7~`O=Nc3\Cpl:\ r u%oG endstream endobj 130 0 obj << /Length 234 /Filter /FlateDecode >> stream xڍ1n@E)<H֋ HJJRFJH. >K( O;g&s7&kYT_|J:`a$@i\WNة>9M%*97'/@d< .*`Ї`nq3mldX j|GDŽ9AAu}v3Kq}_}LkFܠ +Y߈w^sy=7U endstream endobj 131 0 obj << /Length 189 /Filter /FlateDecode >> stream xڝ1 @EL70s @BBZZ( 9Z#XZ:IVt« 3Or#xjBN%7nt8SjImYǤ+]'RzΚT;l@TJ @ hxjze/ ]a;AdD/ak+?iTRS" }G@ endstream endobj 132 0 obj << /Length 188 /Filter /FlateDecode >> stream xڝ1 @EL/ :ͮA"EVbE$Nxg1q߄l">h.!Ǧ^OXRcR 7'e|ޏՌ5ٔs@ th~//iKxO`LГtIVx?>(=Cuڕ/@RriniMoEBs endstream endobj 133 0 obj << /Length 104 /Filter /FlateDecode >> stream x3230W0P0W52T02R03RH1*24(XCs< M=\ %E\N \. ц \. a0C \= h endstream endobj 134 0 obj << /Length 102 /Filter /FlateDecode >> stream x͎;@PggwAxJ!* %>Et300 UjrR豆iqA 5Tv̐ɩ p:_thq_h endstream endobj 135 0 obj << /Length 130 /Filter /FlateDecode >> stream x-ɱ 0 g 2'0-k3:9 TGAEfڢ|7lXU:x@='e; m;P=fpq}kw+*\ǣҟ;ZFy2ddL*R!sBY ,P# endstream endobj 136 0 obj << /Length 131 /Filter /FlateDecode >> stream x-1 @E?^ xЙmV"RP:ٙ&Nwo\%红V\xA=y1:nwՇ Y/ t4M22DT&2+<*B# endstream endobj 137 0 obj << /Length 94 /Filter /FlateDecode >> stream x3230W0PaCsKCB.K &r9yr+Xr{O_T.}gC.}hCX.Oz 0X [\w endstream endobj 138 0 obj << /Length 101 /Filter /FlateDecode >> stream x3230W0PaCsc3CB.K 'r9yr+Xr{=}JJS ]  b<]d7`= 1S'W fp" endstream endobj 139 0 obj << /Length 162 /Filter /FlateDecode >> stream xUA @7 u XJ0fԪEB ,jmAi"=xj1k)%g/ I|<$7}Mlx]I'$K>&ȔGȽm~i\ԅΏG8¢x8M lj0 b+12 endstream endobj 140 0 obj << /Length 94 /Filter /FlateDecode >> stream xM=@PEx$^!R { T߱4J2:*54`ƴ"f@BJJ7"i endstream endobj 141 0 obj << /Length 165 /Filter /FlateDecode >> stream x323P0P5T06V0P0PH1*2(Bs<Áj=\ %E\N \. ц \. 10703H01X010000$E@PPc0n`0\@r ;g0 endstream endobj 142 0 obj << /Length 90 /Filter /FlateDecode >> stream x3135R0B#C##cCB.C D"9ɓK?\ĐKCKW4K)Y(  $'W R endstream endobj 143 0 obj << /Length 175 /Filter /FlateDecode >> stream x331Q0P0bScSKCB.S1s<L =\ %E\N @QhX.O g``~?`g N}`o`F¢0?Q\\\ endstream endobj 144 0 obj << /Length 235 /Filter /FlateDecode >> stream xmj1 ^=;Od-$AhO=Xބͣ{N"Q6>fB&?N'izmf4Z||DJƠz.rM/T%V~rEP@X8 \IU{3bY1Ez$'i=Sː†LBp6Pu 8:R [49޲&&Z'XΝ_%m endstream endobj 145 0 obj << /Length 260 /Filter /FlateDecode >> stream xڭѱJ@? LaZ 4ܪ[-'BBRP̛*y+uvg!B#n;MG4Zly\Ѣ瞚-Sӟ-5#%_v^QdRPDZTRR OԵ@*(AWE],RIR57P&?2oƐ(~#FLg5=dF#zvL;mf&,mXJ[a # }R:%e-vvS=U:霾es endstream endobj 146 0 obj << /Length 181 /Filter /FlateDecode >> stream xuб 0  /0 D4?/iLsqINƪ&v)9 O44FQ5o3j ioKk2 DdFLƤ1(C8^QDɰ|p1۽."byҀ)gk׿R?U~ endstream endobj 147 0 obj << /Length 166 /Filter /FlateDecode >> stream x353R0P0bSCSsCB.s I$r9yr+s{E=}JJS ]  b<]d `6`RAI68؀L2`%Hv0)"G'!P5Ⱥ AJ$ `G@%\=Mx endstream endobj 148 0 obj << /Length 254 /Filter /FlateDecode >> stream xڭѱJ@?l&yM"&`p` A+ :--7`kMg+ & XKf]{t\)pp{ =SuV=UvT]j__Z]>5(6S`-̗oնd IS03aLlB".!1Ox&pcJ&HۅrI)ܔ_,v0{ltT颧 endstream endobj 149 0 obj << /Length 125 /Filter /FlateDecode >> stream x333P0P0bSKSsCB.SS I$r9yr+r{E=}JJS ]  b<]?T b78) s)hb y.WO@.!7 endstream endobj 150 0 obj << /Length 243 /Filter /FlateDecode >> stream x]J@Yr̡@&A[sjsɃxj= Qj(y=HДeDz~,//Ue7~_G8"Ǎ;ΟGΗoKWn6^D8I F"!:+2oa[87`d`+hLMfp&byiguf0~5jRryd* Sk_ N9Lxods-5P endstream endobj 151 0 obj << /Length 244 /Filter /FlateDecode >> stream xu?kP{<0p '% ur(vtـ]G|X#y=8. [~< 8:İ˵W|Ք.1wQ@jH>yo瘣1 ý 8hFx]*18yTB,a PM 2< fep\$I5+zG4VY5D NZ@fW'coQ! endstream endobj 152 0 obj << /Length 239 /Filter /FlateDecode >> stream xڭ08#^@D'D::htGxWm~_LyxJsNgo(I5M7?/&~I#K CԼ*x1F%)dB 񑊅A8EjGU(Nk4, ~j}> stream x3535T0P0bS#SsCB.K I$r9yr+Xr{E=}JJS ]ry( , LS? 0adT Y;PCuP7 .ĵ'W K endstream endobj 154 0 obj << /Length 221 /Filter /FlateDecode >> stream xڕѽ 0𖂁#x/i*U ~I(}JK "&HrtF*8 q0Y Ȁf4  ״ 2o@.08BDu uf,HW lf(ze~ަ_Q@6+L6elZv,XKP~EԺe֩N=v< endstream endobj 155 0 obj << /Length 256 /Filter /FlateDecode >> stream xUϱN0 )K~h{=B @!Z̏F%Psw|J8êt0r^jE>U KWk=?ܻbuyJz_uEk?ƌ!fl#>3Z;@'7x &&ȖNm9R0!G/aEFD+E$ьMX^>a-M=:upǴ-i}GA^{sywָ+=# endstream endobj 156 0 obj << /Length 150 /Filter /FlateDecode >> stream x3Գ4W0P0bSsJ1*2" Fr.'~1PKW4K)YKE!P E?<@0g`A bP>T*L`)`J+F Hʃr Wr endstream endobj 157 0 obj << /Length 307 /Filter /FlateDecode >> stream xu1K0W v8b vtr@?')ΝCMHH^K^Y/PX.8\> stream xm; @ . Vf.1L!he!Vji(X({8Qښ}i<"Ńf{Qj{T3Qes:.{TŘ4 5E&6%/_x/PAP02g0yp&dBw:+0}ATyM6Ӣ5l.5iK|T endstream endobj 159 0 obj << /Length 198 /Filter /FlateDecode >> stream x3134V0P0R5T01V0PH1*21PASKLr.'~PKW4K)YKE!P ETD0S$00|`A; 00* ?8Q"I&PMb`߁q ̍:]'W ckA endstream endobj 160 0 obj << /Length 182 /Filter /FlateDecode >> stream xڍA `'?(   AZDjX.̣y҅Tcu 7f: 5P L % MBb%_/#jƒ&Ύ҄Z{Ue5TƩ-ՇW6j@-OӉ;*`{^[bTd7 wSZ= endstream endobj 161 0 obj << /Length 198 /Filter /FlateDecode >> stream x3134V0P0V5T01Q0PH1*21PASKLr.'~PKW4K)YKE!P ETz !HԱ` |P=iu D)ph<krF=A?0`> stream x]1 @\B/ 8M(+Tr!bI q23;9nvdC)lGUgwIBf6$32d@fr@&m)2ϩ\^sϵ2HQRQO5QJrh MTrL@V@ endstream endobj 163 0 obj << /Length 141 /Filter /FlateDecode >> stream x3236W0P0bcSKCB.# I$r9yr+Yp{E=}JJS ]*c<]70| C`003a`\=&[ endstream endobj 164 0 obj << /Length 237 /Filter /FlateDecode >> stream xڍJ1ƿ00 v^@9Å+T[}> stream x3134V0P0bS CB.C I$r9yr+r{E=}JJS. @-\. ?&iNa`D~700n?D䇁$7 \\\y endstream endobj 166 0 obj << /Length 122 /Filter /FlateDecode >> stream x3230W0P0aCS3CB.C I$r9yr+Zp{E=}JJS ]  b<]0@A@8~? q0\=(CE` endstream endobj 167 0 obj << /Length 150 /Filter /FlateDecode >> stream x3236W0P5Q54W0P05SH1*22 (s< =\ %E\N @QhX.O  P?`E6?gc?P~.WO@.W endstream endobj 168 0 obj << /Length 196 /Filter /FlateDecode >> stream xڵ1 @Еir3'p.#BBRPQr0E:? d37u.{ʧHrCqJzƁGz$15x2`ts [R?L3؂rkm;x3HKv@%.oԐ nn**ɍ@ÔDr endstream endobj 169 0 obj << /Length 108 /Filter /FlateDecode >> stream x3230W0P0aCS CB.C I$r9yr+Zp{E=}JJS ]  b<]?0! ̃`qzrrƂQ. endstream endobj 170 0 obj << /Length 177 /Filter /FlateDecode >> stream x33R0Pa3scsCB.3 I$r9yr+p{E=}JJS ]  b<]?`@=:773n? Da`N``` O7Nszrr#߈ endstream endobj 171 0 obj << /Length 147 /Filter /FlateDecode >> stream x3134V0P0bcsCB.C I$r9yr+r{E=}JJS. @-\. ?00`D~70n?D䇁$0I.WO@.e% endstream endobj 172 0 obj << /Length 188 /Filter /FlateDecode >> stream xڍ1@E #0e6 &naRK v9GTd)HN^f̦ǚ95(EqߜR{cRkI ? ldM*H&g8^WSQdHVR!J*- i~ nN/ookg$AH> wlzZIK endstream endobj 173 0 obj << /Length 196 /Filter /FlateDecode >> stream xڝα @ HByuj;:9::(>Zp"]qQ |CB?2ܓ1G!#I:Ramd$V$fO"tٓH$R^K6ʯ\UW0/%>T5*4hy~> stream x31ֳ0R0P0V54S01Q06WH1*21PAScTr.'~PKW4K)YKE!P E0a<|?`0?> stream x3635R0PacCcsCB.# I$r9yr+Yp{E=}JJS ]  b<]3P?n3 ~o0ah`?PszrrjF endstream endobj 176 0 obj << /Length 195 /Filter /FlateDecode >> stream x=αJ@Xf x{`TSwZ * W6`"8%Gf|q~K.4pR^j<> stream x363T0P0T5T0P05TH1*22 (Ads≮=\ %E\N \. ц \.   W  @ @,?(fQ 0pC sC3=;?f.WO@.uH endstream endobj 178 0 obj << /Length 153 /Filter /FlateDecode >> stream x3134V0P0R5T01Q06WH1*21 ([@ds<L =\ %E\N @QhX.O `J`pB`왏I@.WO@.1c endstream endobj 179 0 obj << /Length 183 /Filter /FlateDecode >> stream xU̱ P#k[WJ' rjj Ɔh>`Phj @ B\Q#HEldȗ$"Sg3:.{|LVkRj_ ..X ,g0i) <p&A=j|c(vk]b=(ԿOI |F? endstream endobj 180 0 obj << /Length 233 /Filter /FlateDecode >> stream xU=KPs Xxv(zb`A' Q|A7|~Lx`7UN?8g!Aj"z$r~nhdHڙdrO/$GcHN* WUP6Aߴ45q " bx%tq_cGŲh;L t5<fOk2|+ZlECd(IBY_ endstream endobj 181 0 obj << /Length 210 /Filter /FlateDecode >> stream xMν @ )(> stream xUj@Yi nZ$sSEGQ|x I;=F(N8^D!qiIs ǔB3I-1QYAg//74gZv* 0ÿ+]SCE@QsϰF,IqSn/'gCb^mmjg`1'>ڟK endstream endobj 183 0 obj << /Length 183 /Filter /FlateDecode >> stream x%1 @@$|'0+AA),DQI:IUuO)Fh~!;:c̐ېዬQ֑)HpIH]RY#H[m(l2Oe-?uC endstream endobj 184 0 obj << /Length 188 /Filter /FlateDecode >> stream xڵ1 @EH!L#d.ͺB` A+ RK EBbGRRl6Pt+ǬƬ5$Ii;Xf$#aI,Dv$f,I(K~ |[jWopG!SE /zO6x+ӸY~uд` endstream endobj 185 0 obj << /Length 121 /Filter /FlateDecode >> stream x3135R0P0bc3SSCB.# I$r9yr+Yp{E=}JJS ]  b<]0001; aX*6T?0'W N endstream endobj 186 0 obj << /Length 228 /Filter /FlateDecode >> stream xmαJ@o"0M^ป'pWSZY `eh>J+5E~;Yct_^iC-/+9u'Zst }{} ,, %s'l"aAZқMY'W Tc| endstream endobj 187 0 obj << /Length 235 /Filter /FlateDecode >> stream xu1N0ЉRX`3',ZiY$R AE GQr[0"OʌǓ/^ҟ+Vɾݭ%+yxb>F:iy-29Q EPE6fLV&b&e6fՎY (y/ifU _ cBԨM>y2_ |Ǜjh endstream endobj 188 0 obj << /Length 188 /Filter /FlateDecode >> stream xڕν @ + At-('𮶵kotrP?Q_ I+F!=ړ,o)$G$'KROt8oH&{$S^zVSBĢ iAf1h.p;`Z \2oߛy544` endstream endobj 189 0 obj << /Length 226 /Filter /FlateDecode >> stream xڕϿjAna s=b!j WJ!`R nGG8̜EH:_1;dySpnyΟ9)_6[d?9oR&[}";YL9#;e銊Һ„pQ*+j .+xs7xĕ\ }rR /:tKuNTc'ې'jiT2Dׂ+X endstream endobj 190 0 obj << /Length 197 /Filter /FlateDecode >> stream xڕα @ HB}Ѽ]`A'u(GQ|TZ?$w#3ihdȎhC!s8cТZp*Yz?WS2f5wHPQY 4a:B@ 8 1n -SQR-8 d_Ѯ+J_> stream x}бN0[#[w7kѮ)5ڂ,HY1FuE1$̝`ڳ$] ciiǒM6jT%0`t)ߚڣ0R7 A\tdC@f;w75>/G% endstream endobj 195 0 obj << /Length 249 /Filter /FlateDecode >> stream xڵ1N@EQ M#\* $\D*J(SAG\2 "J˻]>{m,|Dr!B~zóӥdȜ t$Pϊ˹vdW3V-pu/ Ɨ=:`Nzw8r,Vpڞݥxdn&8둉;b9޳0rEӪUXЂyjA^:'?ƿI endstream endobj 196 0 obj << /Length 263 /Filter /FlateDecode >> stream xeϱN@ ?y/iJ"JȀD' X{hy^cꊙD5=:駓|_.(_ I4BCjz8nZ:76 endstream endobj 197 0 obj << /Length 196 /Filter /FlateDecode >> stream x1P .^@?'ILtr0NG(сP[C_۴ˏ0$y4h CmJ9&#&5!d 4rJ>6>y[Rb\ [Bgpq Db 7 %Xz’+pC7 M=$qY+|T endstream endobj 198 0 obj << /Length 199 /Filter /FlateDecode >> stream xuν 0+['0~I훙G#t =猪!ARG4!3vYW}؟pRP>@}vD?YM)C?mFAh0Wp(Ԇ&R_GWRM1|w5F ]5IW'C{p:V# \ 8.y endstream endobj 199 0 obj << /Length 191 /Filter /FlateDecode >> stream x]ν 0S:w#>mб N(Q3 \'3ʇE)rF2:Rߥ}ה$S2{Z|)/&QR:tCuňC:DvG|iFyV;tPo07{KxN. P5 ҂5-Qle endstream endobj 200 0 obj << /Length 264 /Filter /FlateDecode >> stream xڅN0 ]1Drop @ZUt`b81# xlB$7bBb"~??;㺧j|ƶoE]p3A{)~=\SvK;rJxP0w4{\ .c9N]"Yp&Zmm1B`XX 212sP)HrL51UW[$tUݒYņ'r endstream endobj 201 0 obj << /Length 122 /Filter /FlateDecode >> stream x3235V0Pa#SSKCB.#C I$r9yr+r{E=}JJS. @-\. 0!("3#! F#.WO@.Nq endstream endobj 202 0 obj << /Length 105 /Filter /FlateDecode >> stream x3235V0Pa#3S CB.## I$r9yr+q{E=}JJS ]  b<]3GBqzrrW endstream endobj 203 0 obj << /Length 176 /Filter /FlateDecode >> stream x3137U0P0bScsCB.C I$r9yr+r{E=}JJS. @-\. 000$700cA2 \ i$ ?l 4b>.d!p!dr~$_\\\-in endstream endobj 204 0 obj << /Length 144 /Filter /FlateDecode >> stream x336V0P0bcsJ1*26" \.'O.pc.}(BIQi*S!BA,? DM}?`@8P$` 4'Apzrr8W endstream endobj 205 0 obj << /Length 187 /Filter /FlateDecode >> stream x%= P7.BBBQy[Hθb2+$+]n: 2/*NrN7rZmx]9]bJV9q*> stream xe̱@7&`8ɚ( BX+ RK EBɧ"8qaZ=y$/$I+w良`=,g+b*qz;D$K.&Q~8-x)؇% Vd.hUAmP[0+|D0|D] zy^֐}bUc\6??#Zh endstream endobj 207 0 obj << /Length 236 /Filter /FlateDecode >> stream xuαJ@9R,Lop'p=pSZY՝pE h({]#ZFcf˳朻Em%a⹐QWthMB{[ݝx|A6%ڭy*M\K&#d!#POI* MD // R2h``R̓m\Ջz=@>6m8}F}:1Μ> ,Ef]O sSq0iTxj endstream endobj 208 0 obj << /Length 122 /Filter /FlateDecode >> stream x3137U0P0bCSCB.cc I$r9yr+s{E=}JJS ]  b<]DbvQ$G%AÈB\ endstream endobj 209 0 obj << /Length 231 /Filter /FlateDecode >> stream xmJ0,%Z%c7!02I|zGƭVx|,͝Gif4ۛ IodyA# ՌJ&E8]&Rj Ф KX"9߰C"N +oq @F2h.pFmLF IA.gOլ endstream endobj 210 0 obj << /Length 237 /Filter /FlateDecode >> stream x}J@ba> stream xڕӿj0q%C `*B]WC:Nm-vG#dt&?RiD ~i]_\V;WzG*I꒚M dߑ%)YRtZ@m^HwYmVaܶbN4RbXMΔ\uNnnb| mbީLE捴]$ⱱ7!3ilz.2Ob'z>уt!򸴏97 טC.k&) 7Lʬ k ͹!!KkK!#ܥm<Fk(4J@?mG/c endstream endobj 215 0 obj << /Length 338 /Filter /FlateDecode >> stream x͓?N@gC6QڸHaRK vF8%^0 Z-;;3|qvrXЧhsJL6~Em*iS^o*\R[}OT@WdR;Ȉ,QG9Ci 7rXK0A@$s;:>GOÔ11PVGG { r(ܑ  J}1*7S($;SheIL>oC^fi0ӤIΧ C4qHGnJ谬cC +{7Z۶> ࿢*E!en/ endstream endobj 216 0 obj << /Length 325 /Filter /FlateDecode >> stream x͓N0 @PK?h Hכ*D$02`~J?c&rNldH^؎{U.+,p'%ΰ:ޠ%On _ K,!C#44~d32DCĚZAO3%,Fb= _&g2dFLdt^c;ȓhMZE=p8}ډݴ1Mt=[liq<3Mu;oϚ0qfUȱ:ؠqZwѻ$D#BHI!ihD W xkD endstream endobj 217 0 obj << /Length 290 /Filter /FlateDecode >> stream xڵӱN `H&GJkNM3NIM{4"Rȍ%) ~ٜoK<+>Lcuz^aہxĦqkAtwb{%>X> stream x}ѱJ@?lv_@p] !p` A+ RK E;!hM7HqfwO`vv23)Vf0WI%X8=Uk3UqaUASSbmn*Sުvm| 82"7@б, }8$tHIR2>JJ =MT;4[6R׳ā~D}~k.:6ʃHϐDJwk81ۇ=Isz6WBJI7l:ahJ7Cަ85,φkVq< /XYd|vRJJ}I endstream endobj 219 0 obj << /Length 233 /Filter /FlateDecode >> stream x퓱 @ S:Y|]I(>BGLZD''|r7Ѧ;M CA> 0Ym՜՘eTфU8A5!hHpɾe PVr{y%رW Kp,+&uaJNEIM4y0犉%ޭ^ AlH4ȗ6eOE8`| endstream endobj 220 0 obj << /Length 270 /Filter /FlateDecode >> stream xڕJ@'LsL 'BB> stream xڵN0/`?BdS` Heꀘh XI-#d`stgۿ~Iy)x 5_XQ&oG\7vWEF<z{O5 Tb!ȣO!2J`@;PP<;Gg3E9c̈*l09t / inm';)),bߘ^Jq݂zlgF endstream endobj 222 0 obj << /Length 244 /Filter /FlateDecode >> stream xڅJ1g"0M!`Dy[ZYZZ(ںy}<•aǙP1|?IO :1H=>cTPc;Ocw!^_[^ʙ;V8?dmgPj\Rq :dĄ* |Vbn;gE d1o( ؁ahDBc!D[o1En %in6N:\Z` æ]H_I<?y뭜 endstream endobj 223 0 obj << /Length 175 /Filter /FlateDecode >> stream xн 0>B L*)j3:9vtPtnG#8f:M|~3z> stream xڥ?J@'X&G\@HBL!he!RK E֛L2ɮ9o[,Ƴw565>UU7v1.tqoYKtq ˣ|QђCDF"RcB|&;J e%wpU3B?O|G(^'f ]THد|X9/O8E.> stream x3635Q0Pacc CB.# I$r9yr+Yp{E=}JJS ]  b<]``0f+ɃԂ 0a@\\\٥; endstream endobj 226 0 obj << /Length 107 /Filter /FlateDecode >> stream x3635Q0Pac cCB.#K I$r9yr+Yr{E=}JJS ]  b<]0a\= endstream endobj 227 0 obj << /Length 184 /Filter /FlateDecode >> stream xѱ@ & &]xHLtr0NUy{ጃ zw6d4JBGqlfiG{1+P)QEz@-ibc|!Pi ౮!`{.TV6ߡA_y48+po endstream endobj 228 0 obj << /Length 231 /Filter /FlateDecode >> stream xڵ0kHnЂ0 &2`A3<#02^KL%!_s{I!.qa@CT9 +@P% 7 v+@x0> stream x;0 t#' VbTD$02`nQzT dj20XY陞c+4xRps?aq@iA W<ix=   E^6ɱC:_:Wѫ}O_ /h m Ij^ endstream endobj 230 0 obj << /Length 259 /Filter /FlateDecode >> stream x]1N@4;ۊB$\ Q%ڬ\vY)yTk.拊57 UIJ/Kn6O\k*ybx[~|nXp8HDF#々~7'QȔ^;LKZ+45qj@.dtv!"ieh֔j]dV絳Su ?hgcfKxhGZ endstream endobj 231 0 obj << /Length 186 /Filter /FlateDecode >> stream x3534S0P0R5T01Q07SH1*21 (Cds<L =\ %E\N @QhX.OON2bH$;&=A$3?8HAN7PJ`$H `( E` qzrr:p endstream endobj 232 0 obj << /Length 252 /Filter /FlateDecode >> stream xڅбJ@YR#d^@7l 'BB+RgvE8X>Y؟/Η%YJyN^RaaB> stream xڕ1j@7Xx6l6@RXR%)S$$fB.2Ni!7.V?u~f*U+uW9o(fKUn*< ݖIu>?_dRLjG/zV!C؃@p` 'h'đv3k"t{O<8 F evb883MmH Є̎io“z>Ba"0i5s?hb8T0c00c*Cٻ1 i<8^gvJpi\DXו!) endstream endobj 234 0 obj << /Length 137 /Filter /FlateDecode >> stream x3337W0P04  )\\&f  ,ɥ`bƥU()*Mw pV0wQ6T0tQ```c;0D0I~0Y"I ?&D(I"\=VI endstream endobj 235 0 obj << /Length 301 /Filter /FlateDecode >> stream x}MJ0)YؖG_]x>.]W҅h=Je? گiftߟ ChÞ6 s/\knCs%ux^ߟ\s>k o@B,D'DdZ"-,-B/63"x甙k p7q|$pF暿 dL@AvZHFӬYM5k|,ZdIeb4j`Mg!@Tt`[Bͻ.A8Ew̕bԊW'bt7}t endstream endobj 236 0 obj << /Length 305 /Filter /FlateDecode >> stream xڍN@LJlA gEr&ZY+h=> @IA烋 |gf.K xQz!eY^#[E{_o8_c#>UX>)EৣNGG#"qhfH8fEAEI=-Β%$#쵂H\Wfä hgcgݺi8iZG`s+,25\i`2[[E3)D/bZ1.8G IUuuR:X&oݴ]֯"Mߴo endstream endobj 240 0 obj << /Length 136 /Filter /FlateDecode >> stream x323P0PP5T02P04PH1*24(YBs< =\ %E\N @QhX.O9   fv6> $'W  ' endstream endobj 241 0 obj << /Length 257 /Filter /FlateDecode >> stream xuбj0d=A-pHRB;u(@19G#d`d |' 󟖋;}O5\RQ`ȻO}c~[zIc%a,D!Q$mbG2bWh*^jL/.i AjS]3}`qd;<z<ĠuH> stream x33г4R0P0bSs3 CB.S HrW05r{*r;8+r(D*ry(*P 2C@,dBPBՃ)A0@\=R endstream endobj 243 0 obj << /Length 280 /Filter /FlateDecode >> stream xڽn@ Ǎ2 y/D%dCJS کC!Q&<#02\M90qwYSL)ݭ(K(3SR7n oN>f3?_h/{B@J lF3@.!-@A> Aވݜ*PB QAo"|s Fà \Ji oץ%Ocj{:T~LpaE `M5(QlWq2 endstream endobj 244 0 obj << /Length 229 /Filter /FlateDecode >> stream xuϱJAba yh+RPK E;1 tƽpS|?;?xžjs3TC=-r+SrgkkrKyrM͒a{ծlB-`a:`u)xuwGW2&e˯ɦnh huaǨk} [ bԪob"EzONoɌla endstream endobj 245 0 obj << /Length 213 /Filter /FlateDecode >> stream xѱ 0; 4X-P vtr'uTt7)7&/“ h4"rMӘzd endstream endobj 246 0 obj << /Length 203 /Filter /FlateDecode >> stream xڝ 0OKдv vtrAPGAEA0G#8:ANȹ-Lp;"dJ Z_V[UglJ#IWc>NҽIs-0pu@܀_x vZհu/{#ҡ^EA^UzN4 E A2;Wa V4'VhLr endstream endobj 247 0 obj << /Length 210 /Filter /FlateDecode >> stream xu1j0g<7 41'z(S$ MHXGQ|JW\(T 7uN3uki1}.Gq%Cf&u#U])Yϧz\R׹fi WOp_PI! I@*#f%#~,K{ǏT#,ΰq`(nYsLޖF^V2 endstream endobj 248 0 obj << /Length 125 /Filter /FlateDecode >> stream x323P0P0b#S3sCB.#C I$r9yr+r{E=}JJS. @-\. ? :  .WO@.P endstream endobj 249 0 obj << /Length 159 /Filter /FlateDecode >> stream x3534W0P0bSCCB. HrW01r{*r;8+r(D*ry(0a@R` `$@z ɀ a/ m?C&\=?qjS endstream endobj 250 0 obj << /Length 209 /Filter /FlateDecode >> stream xڝ= @GR2MtbSZYZZ(ډr2EH|((v̛ݝGa_ endstream endobj 251 0 obj << /Length 144 /Filter /FlateDecode >> stream x36׳4R0P0a3CB.c HrW06r{*r;8+r(D*ry(0`?l(g?6g u@lC{ pP endstream endobj 252 0 obj << /Length 213 /Filter /FlateDecode >> stream xMͱN@б\DTd""R.HE) h!kfg:[\ꗺXS)Ks"Z;׌oY2=7Ro0ͬ&a8YZi4 %:1X[z83L̺E[y!8}?+O2dWtm8 \\ղuY endstream endobj 253 0 obj << /Length 160 /Filter /FlateDecode >> stream x36׳4R0P0R5T06V03TH1*26PA3#Lr.'~PKW4K)YKE!P Ea9$luPفX$N#Ccagc{  00?r Jm endstream endobj 254 0 obj << /Length 162 /Filter /FlateDecode >> stream x1 @ᷤL fqC@Vb--+'Gˑ<@Ⱥ!X l3pjZ>DŽm:L#c^[z?.6 6KNJV- -reByDz 7U}`(D,uxI0nҷWR hhKob endstream endobj 255 0 obj << /Length 207 /Filter /FlateDecode >> stream xڽ P FҡмVn?`A'qRGE7f}>BŚނ*3$|9VuQۀ}+5͞1%kTڤ|18Ux*%V738 \A&rOP deyܿ>X ?c\%#'q(IfNĴ) endstream endobj 256 0 obj << /Length 259 /Filter /FlateDecode >> stream x]J@Of!"." E0pA.Z v |˝gH0??pNNmnҮwYUϹ勧7wk"nssa q[{_AꭅBaD4%;>#p{%*édlW]HO˷df 3ÂױtK҇FoMfl=o,"E"pLΉ~WhFF*4& !3DWZnvj endstream endobj 257 0 obj << /Length 219 /Filter /FlateDecode >> stream xڥJ@ Ci X/b ͡PB,M$G#xP .C3;&z8YQ> stream xڍMJ0,YL/0؜ BЕ q.Qܵ7^7G,1_R-ORZxyq\}q&x^ܜzxJdr1٥YYu%^ߟD>zwEČwv4Uo'7Ohp> stream xڳ437R0PaSK CB.s3 I$r9yr+q{E=}JJS ]  b<]>@?7@Y - DBX`,v8bƪ@3nfd_b?̰⇇<`,x> stream xڕѽN0> stream xڵJ@%4y˼nn p` A+ J--PB\_SE;%_tB=ܵlkouLn}{ ?T\n0`Bh§"( v3,rV (R0(Z1̾?^3A RW^SML j3)0}1F3f liX6e*yX i}lM󣫖 S-zY endstream endobj 265 0 obj << /Length 267 /Filter /FlateDecode >> stream xڝJ1'lq0޼fpVb]hy}-86L /;q5%QwFO-kHfr;r +ZoyaC 2i寙5z>%k<&r,`vd+q3ߒ1^+ \oxE<@G*q/|Aoٸ=,8U(`ش fA-pڟڤPj"{mI倷YR endstream endobj 266 0 obj << /Length 351 /Filter /FlateDecode >> stream xڭJ0ǧȥº=z =umr!4LRuDg^W4;(M}h-ԣKCQ\jժԥ*NѮ̼<ޫbu~lX)U6_GzahB t ]2G6Da)hrcfEA1-?pλճ I}҈6ĥPgOn ܘ'+tc036u! 蒡AM"9%} |H=X9ZHv]ϽmE=LQVgq)ϜRT7D]n cƒ|M'b<%NZu>v endstream endobj 267 0 obj << /Length 279 /Filter /FlateDecode >> stream x=J@ )2'p2Dl +BB\K E;qy^a2E33EdȼҥOumYꭥA +]Ȝc2͹~z|#8іF_[]PI%ae,*=c<<6F< ӉY+ _ ^Lubފq,?vMectJAqO8:G}- ȘKH~cD='0t[g7׏iC endstream endobj 268 0 obj << /Length 252 /Filter /FlateDecode >> stream xұJ1;|Iej`]),APKAEn"v[ |]\k܄[vGXN n2rב)MZ/W4mɟ˟1cɷ'E37.\P;s0 ]*\T3&03vrHM%.,^{aK u`m)4`BO5䀳"mDV_—B.fY/ë/AG-!A B endstream endobj 269 0 obj << /Length 288 /Filter /FlateDecode >> stream xѱN0Ы2DHmNJȀS22`%4*1Cg[!uBbbt:Ftr6IF9s|bli%cLl^_0\tSv PiYY0٣-$Fi nQC$lrڢWF$\Ea}!~"bǠ?qQu{3}>t^ uCaΟ jeG)AmJIeŐ[W.翢j؄7,?ne endstream endobj 274 0 obj << /Producer (pdfTeX-1.40.20) /Creator (TeX) /CreationDate (D:20221027223927+02'00') /ModDate (D:20221027223927+02'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) kpathsea version 6.3.1) >> endobj 12 0 obj << /Type /ObjStm /N 42 /First 349 /Length 3001 /Filter /FlateDecode >> stream xZn}U>Abw<zزW@V ,}Ndh4$fRԩXC$C0C8ΆoM!C8ِKHC2sΛb6Sprsl6.,KA-{NG}`Ĉ¼&sP\MRĘ$F`hdbJ`d@>G&*vD)\ DMY8<<(oq0@+fu9( $e s>l^lnݧqX6۟n|~-?|ݽ\Y&N2rޠh=ׯ|l,[`͖ %m(-+jϒ@?߿\a.߿3_n~4׍x0K5g\dF2fwqkԔE4%?4Lѿh ,:|ˬ]xy+9Gc4>ʫ&ME8lOz?m{_NOW'{Ncۏo$rpbD1n7(lPzi>GK J%%xq$B D4$%<#Is%I@HРXZ16v3L|wٶE*, wd /8Ki1Q [\dBqa%@RNu LS)F0A0^1 YK!yaġCX.{V>`JajO|};GGZI/ow9X A},3pJ hr\P!zWԍ.!B&`(n3dNA8}e̢ѲxE%0NJ@Ni7'k$. Yz00x5BahKcsz[m"/y蹡:̭-:̍tAi~]P6Z[lthš 1hl'ۼ "z%+bP"!MCpx)*HJ$DJJDJ,R%e%_RQ%[%_r46SC{TСJcGb ,Z>+G*hxIS겝ZM!> u+ 4Ѩj· 4(g`{hF=G~O8+[\3Hn̳P7kb/D PȦu74b %*,(Z,Z,Eq`y8[et:xW-c9%j!? <PFVw6|pgSwr SyKke4sxu:ѡ%.G@?K2aţLel4q`CŁVnA'Cj C Lm90="mI \b֬N"{͊R[gDeHF~0bq)kȨtw'ri _':n:t[S=vkyUP-L{TS+S\j}J[ow&jZk"Bk+gX3ZUer7k2*\kj ?:;9޳ ;f fxgPQA]H{m,`j}V0 bCZN1< #%3$sB4!Ik<0,2q@b_/_ԖD˦ lIʰ%jR{'$'!D(.Lpz b73CFANK^RB;%5NGGgq56`88k"@xt8cGjZ%L9 m$ʶ0e{ p((‘[>Z7rZh] )ZtDJG#NݓPKUU)o6P@I\.q$튦}є3F*V-ʯZc(ς #*w)]/ֹ:\@&LY0kQLZӁ#yS5UDK< %NW4*;"yX(u gkyL=5mq,w#"AQX9kY7Z  QAvˆ\ KVF]`eVT]nrkr/L. 㟈Kp؏Kp8KpbpT~ץZCPw-nb܍P /9A1WWf||>ޥ|Hy`)ՇT~޼r׹/q:i\٫tp, /n.CvZtE_t z>G3OYlb_E"WwȸYV'^Y8VS4KaX\}_ _n?`%+!f{7Sw[1 endstream endobj 275 0 obj << /Type /XRef /Index [0 276] /Size 276 /W [1 3 1] /Root 273 0 R /Info 274 0 R /ID [ ] /Length 808 /Filter /FlateDecode >> stream xuPUA]y"bcb7vwwc`cc95:c:**vw{{v9c3m} yE%Efk㜇 7aod>B> "k͇l+?^BOA1<BC rCvE&k$-zu %AGP} [PBKFV_5(uAP.AP TLJjԀ-щPUzK} Faи94iM'CSS"iY@K5u?hsjW5SݡK AУ&t9}DVkMz>oW}a4!e 2 mjNf?M[3"8%OØQ0Ve36WzcB1&ހId1Li0= h3u^fZcG &&,]*ղpX^V`[U V{4Ht֜`~XS)$*Q7zd.تm`gUإy=1w:[ /8M.EkԒڑd8^p8sޅs7I tG:k"Ě \R]*Z'H^׿ D%R4pg:?nԓBOcEk) б}kިidzw ޫ~?iu,&|#S (2I[@nAJ0>= endstream endobj startxref 69788 %%EOF amap/inst/doc/amap.R0000644000176200001440000000265514326566177014004 0ustar liggesusers### R code from vignette source 'amap.Rnw' ################################################### ### code chunk number 1: amap.Rnw:32-36 ################################################### library(amap) data(USArrests) h = hcluster(USArrests) plot(h) ################################################### ### code chunk number 2: amap.Rnw:39-42 ################################################### heatmap(as.matrix(USArrests), hclustfun=hcluster, distfun=function(u){u}) ################################################### ### code chunk number 3: amap.Rnw:45-46 ################################################### h = hcluster(USArrests,nbproc=4) ################################################### ### code chunk number 4: amap.Rnw:49-50 ################################################### Kmeans(USArrests,centers=3,method="correlation") ################################################### ### code chunk number 5: amap.Rnw:56-59 ################################################### data(lubisch) lubisch <- lubisch[,-c(1,8)] varrob(scale(lubisch),h=1) ################################################### ### code chunk number 6: amap.Rnw:62-64 ################################################### p <- acpgen(lubisch,h1=1,h2=1/sqrt(2)) plot(p) ################################################### ### code chunk number 7: amap.Rnw:67-69 ################################################### p <- acprob(lubisch,h=4) plot(p) amap/inst/doc/vignettes/0000755000176200001440000000000013573775227014744 5ustar liggesusersamap/inst/doc/vignettes/amap.Rnw0000644000176200001440000000342213573775227016353 0ustar liggesusers% building this document: (in R) Sweave ("ctc.Rnw") \documentclass[a4paper]{article} \title{Amap Package} \author{Antoine Lucas} %\VignetteIndexEntry{Introduction to amap} %\VignettePackage{amap} \SweaveOpts{echo=FALSE} %\usepackage{a4wide} \begin{document} \maketitle \tableofcontents \section{Overview} {\tt Amap} package includes standard hierarchical clustering and k-means. We optimize implementation (with a parallelized hierarchical clustering) and allow the possibility of using different distances like Eulidean or Spearman (rank-based metric). We implement a principal component analysis (with robusts methods). \section{Usage} \subsection{Clustering} The standard way of building a hierarchical clustering: <>= library(amap) data(USArrests) h = hcluster(USArrests) plot(h) @ Or for the ``heatmap'': <>= heatmap(as.matrix(USArrests), hclustfun=hcluster, distfun=function(u){u}) @ On a multiprocessor computer: <>= h = hcluster(USArrests,nbproc=4) @ The K-means clustering: <>= Kmeans(USArrests,centers=3,method="correlation") @ \subsection{Robust tools} A robust variance computation: <>= data(lubisch) lubisch <- lubisch[,-c(1,8)] varrob(scale(lubisch),h=1) @ A robust principal component analysis: <>= p <- acpgen(lubisch,h1=1,h2=1/sqrt(2)) plot(p) @ Another robust pca: <>= p <- acprob(lubisch,h=4) plot(p) @ \section{See Also} Theses examples can be tested with command {\tt demo(amap)}.\\ \noindent All functions has got man pages, try {\tt help.start()}.\\ \noindent Robust tools has been published: \cite{caussinu+ruiz} and \cite{caussinu+ruiz2}. \bibliographystyle{plain} \bibliography{amap} \end{document} amap/inst/doc/vignettes/amap.bib0000644000176200001440000000175113573775227016344 0ustar liggesusers@ARTICLE{caussinu+ruiz, author = "H. Caussinus and S. Hakam and A. Ruiz-Gazen", title= "Projections rvlatrices contrles. Recherche d'individus atypiques", journal = "Revue de Statistique Applique", year = 2002, volume = 50, number=4, } @ARTICLE{caussinu+ruiz2, author = "H. Caussinus and M. Fekri and S. Hakam and A. Ruiz-Gazen", title = "A monitoring display of multivariate outliers", journal = "Computational Statistics and Data Analysis", year = 2003, volume = 44, month = "October", pages = "237-252", } @ARTICLE{mpetitjean, author = "M. Petitjean", title = "Agr\'egation des similarit\'es: une solution oubli\'ee.", journal = "RAIRO Oper. Res.", year = 2002, volume = 36, number=1, pages = "101-108", } @BOOK{R:writtingRExt, author = {R core}, title = {Writing R Extensions}, publisher = {Unknown}, year = 2007, address = {Unknown}, abstract = {covers how to create your own packages, write R help files, and the foreign language (C, C++, Fortran, ...) interfaces.} }amap/inst/po/0000755000176200001440000000000013275070562012572 5ustar liggesusersamap/inst/po/fr/0000755000176200001440000000000012444343274013201 5ustar liggesusersamap/inst/po/fr/LC_MESSAGES/0000755000176200001440000000000012444343274014766 5ustar liggesusersamap/inst/po/fr/LC_MESSAGES/R-amap.mo0000644000176200001440000000373110336326153016437 0ustar liggesusers<& !+6M2 "<%T/z5S-4b+ .A'Fn>!(+#F,jA   'centers' must be a number or a matrix'iter.max' must be positiveCannot allocate memoryErrorInvalid length of membersMissing values in distance MatrixYou need to install Biobase package to use this objectambiguous clustering methodambiguous distance methoddid not converge inempty cluster: try a better set of initial centersinitial centers are not distinctinvalid clustering methodinvalid distance methodmore cluster centers than data pointsmore cluster centers than distinct data points.must have same number of columns in 'x' and 'centers'Project-Id-Version: amap 0.6 Report-Msgid-Bugs-To: antoinelucas@libertysurf.fr POT-Creation-Date: 2005-11-12 11:50 PO-Revision-Date: 2005-11-12 12:50+2 Last-Translator: Antoine Lucas Language-Team: francais MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'centers' doit être un nombre ou une matrice'iter.max' doit être positiveProblème lors de l'allocation de m'emoire Erreurmembers a une longueure invalideValeurs manquantes dans la matrice de distanceVous devriez installer le package BioBase pour utiliser cet objetchoix du lien de classification ambiguechoix de distance ambigüePas de convergence enCluster vide: trouvez une meilleure initialisation des centresles centres ne sont pas distinctschoix du lien de classification invalidechoix de distance invalidetrop de centres: plus que de pointstrop de centres: plus que de points distinctil doit y avoir le même nombre de colonnes dans 'x' et 'centers'amap/inst/po/po/0000755000176200001440000000000013573775227013223 5ustar liggesusersamap/inst/po/po/fr/0000755000176200001440000000000013573775227013632 5ustar liggesusersamap/inst/po/po/fr/LC_MESSAGES/0000755000176200001440000000000013573775227015417 5ustar liggesusersamap/inst/po/po/fr/LC_MESSAGES/R-amap.mo0000644000176200001440000000373113573775227017075 0ustar liggesusers<& !+6M2 "<%T/z5S-4b+ .A'Fn>!(+#F,jA   'centers' must be a number or a matrix'iter.max' must be positiveCannot allocate memoryErrorInvalid length of membersMissing values in distance MatrixYou need to install Biobase package to use this objectambiguous clustering methodambiguous distance methoddid not converge inempty cluster: try a better set of initial centersinitial centers are not distinctinvalid clustering methodinvalid distance methodmore cluster centers than data pointsmore cluster centers than distinct data points.must have same number of columns in 'x' and 'centers'Project-Id-Version: amap 0.6 Report-Msgid-Bugs-To: antoinelucas@libertysurf.fr POT-Creation-Date: 2005-11-12 11:50 PO-Revision-Date: 2005-11-12 12:50+2 Last-Translator: Antoine Lucas Language-Team: francais MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'centers' doit être un nombre ou une matrice'iter.max' doit être positiveProblème lors de l'allocation de m'emoire Erreurmembers a une longueure invalideValeurs manquantes dans la matrice de distanceVous devriez installer le package BioBase pour utiliser cet objetchoix du lien de classification ambiguechoix de distance ambigüePas de convergence enCluster vide: trouvez une meilleure initialisation des centresles centres ne sont pas distinctschoix du lien de classification invalidechoix de distance invalidetrop de centres: plus que de pointstrop de centres: plus que de points distinctil doit y avoir le même nombre de colonnes dans 'x' et 'centers'amap/po/0000755000176200001440000000000012444343274011615 5ustar liggesusersamap/po/R-amap.pot0000644000176200001440000000252210336326041013446 0ustar liggesusersmsgid "" msgstr "" "Project-Id-Version: amap 0.6\n" "Report-Msgid-Bugs-To: antoinelucas@libertysurf.fr\n" "POT-Creation-Date: 2005-11-12 11:50\n" "PO-Revision-Date: 2005-11-12 12:50+2\n" "Last-Translator: Antoine Lucas \n" "Language-Team: francais \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" msgid "did not converge in" msgstr "" msgid "iterations" msgstr "" msgid "empty cluster: try a better set of initial centers" msgstr "" msgid "invalid distance method" msgstr "" msgid "ambiguous distance method" msgstr "" msgid "'centers' must be a number or a matrix" msgstr "" msgid "more cluster centers than distinct data points." msgstr "" msgid "initial centers are not distinct" msgstr "" msgid "more cluster centers than data points" msgstr "" msgid "'iter.max' must be positive" msgstr "" msgid "must have same number of columns in 'x' and 'centers'" msgstr "" msgid "Cannot allocate memory" msgstr "" msgid "Error" msgstr "" msgid "invalid clustering method" msgstr "" msgid "ambiguous clustering method" msgstr "" msgid "Must have n >= 2 objects to cluster" msgstr "" msgid "Invalid length of members" msgstr "" msgid "Missing values in distance Matrix" msgstr "" msgid "You need to install Biobase package to use this object" msgstr "" amap/po/R-fr.po0000644000176200001440000000430210336326041012751 0ustar liggesusers## Generer le .pot: library(tools); xgettext2pot("amap") ## msgfmt amap/po/R-fr.po -o amap/inst/po/fr/LC_MESSAGES/R-amap.mo ## [emacs] mettre en utf-8: C-x f ## ou `M-x prefer-coding-system' puis reouverture du fichier. ## ou encore `C-x c CODING-SYSTEM M-x revert-buffer ' msgid "" msgstr "" "Project-Id-Version: amap 0.6\n" "Report-Msgid-Bugs-To: antoinelucas@libertysurf.fr\n" "POT-Creation-Date: 2005-11-12 11:50\n" "PO-Revision-Date: 2005-11-12 12:50+2\n" "Last-Translator: Antoine Lucas \n" "Language-Team: francais \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" msgid "did not converge in" msgstr "Pas de convergence en" msgid "empty cluster: try a better set of initial centers" msgstr "Cluster vide: trouvez une meilleure initialisation des centres" msgid "invalid distance method" msgstr "choix de distance invalide" msgid "ambiguous distance method" msgstr "choix de distance ambigüe" msgid "'centers' must be a number or a matrix" msgstr "'centers' doit être un nombre ou une matrice" msgid "more cluster centers than distinct data points." msgstr "trop de centres: plus que de points distinct" msgid "initial centers are not distinct" msgstr "les centres ne sont pas distincts" msgid "more cluster centers than data points" msgstr "trop de centres: plus que de points" msgid "must have same number of columns in 'x' and 'centers'" msgstr "il doit y avoir le même nombre de colonnes dans 'x' et 'centers'" msgid "Cannot allocate memory" msgstr "Problème lors de l'allocation de mémoire " msgid "Error" msgstr "Erreur" msgid "invalid clustering method" msgstr "choix du lien de classification invalide" msgid "ambiguous clustering method" msgstr "choix du lien de classification ambigüe" msgid "'iter.max' must be positive" msgstr "'iter.max' doit être positive" msgid "Invalid length of members" msgstr "members a une longueure invalide" msgid "Missing values in distance Matrix" msgstr "Valeurs manquantes dans la matrice de distance" msgid "You need to install Biobase package to use this object" msgstr "Vous devriez installer le package BioBase pour utiliser cet objet" amap/cleanup0000755000176200001440000000011614326566177012564 0ustar liggesusers#!/bin/sh rm -f ./config.* rm -f src/Makevars rm -f src/*.o rm -f src/*.so