【发布时间】:2013-11-29 00:37:33
【问题描述】:
我正在根据数据“college”进行聚类分析,该数据由 3 个名义变量和 20 个数值变量组成。
# select the columns based on the clustering results
cluster_1 <- mat[which(groups==1),]
#"cluster_1" is a data set which is made by cluster analysis consisting of 125 observations.
rbind(cluster_1[, -(1:3)], colMeans(cluster_1[, -(1:3)]))
#This is process of calculating each column's mean and attach the means to the bottom of the data set, "cluster_1".
现在我想知道的是如何计算每一列的样本方差和样本偏差,以及如何将它们附加到数据集“cluster_1”的底部。
请告诉我。
【问题讨论】:
-
从设计的角度来看,在 data.frame 的底部添加汇总统计信息是非常糟糕的。这意味着您将无法对包含苹果和橙子的数据进行更多分析。您最好将它们保存在单独的数据结构中。
标签: r cluster-analysis deviation