1
$\begingroup$

I have 3 covariates for 100 observations. How can I separate each of my 100 observations into groups as determined by the data. I was thinking clustering. However, apparently, I need more than 3 dimensions to do hierarchical clustering. Would some other clustering method work? How about PCA?

I've attached the data as R output below.

dput output

structure(c(3.87, 0.672, 0.7392, 6.471, 0.12294, 1.0857, 16.701, 
0.2754, 0.17328, 8.076, 0.12222, 1.1796, 8.625, 1.3998, 0.07233, 
3.933, 0.017484, 0.9189, 4.134, 0.7338, 2.9517, 5.091, 0.017136, 
0.6318, 6.672, 3.012, 0.08214, 15.834, 0.7968, 0.27768, 3.954, 
0.02046, 0.705, 9.465, 0.15444, 1.2702, 15.012, 0.4263, 2.262, 
21.438, 0.9291, 0.3399, 20.076, 1.023, 8.289, 5.601, 0.007992, 
0.984, 12.396, 0.4869, 2.343, 11.697, 0.4296, 0.4932, 8.247, 
0.27063, 0.3408, 3.273, 0.03954, 0.16446, 4.59, 0.0011037, 0.8937, 
11.196, 0.17538, 0.9594, 14.688, 0.13527, 0.3672, 2.8554, 0.0027594, 
0.5943, 0.26472, 0.0004233, 0.3315, 1.5633, 0.0363, 0.5232, 5.766, 
0.005901, 0.342, 10.578, 2.4477, 0.28872, 10.803, 1.0185, 1.3935, 
5.352, 1.1967, 0.5316, 4.8, 0.00672, 2.6418, 3.081, 0.15525, 
0.6873, 13.899, 0.19149, 0.4674, 11.439, 1.6521, 0.3867, 4.005, 
0.008328, 0.3675, 5.7, 0.027999, 0.3486, 13.035, 0.21639, 0.7293, 
8.706, 1.0833, 0.198, 5.871, 0.5655, 2.0367, 4.218, 0.011547, 
0.24234, 2.1603, 0.0011748, 0.4569, 5.385, 0.005091, 0.666, 9.651, 
0.4392, 1.101, 11.178, 0.4179, 0.7005, 8.151, 0.00516, 0.27696, 
6.864, 0.018753, 0.303, 3.792, 0.01449, 1.8345, 6.834, 0.03339, 
0.28896, 5.073, 0.012951, 0.5013, 3.132, 0.008892, 0.3207, 1.1841, 
5.292e-05, 0.006795, 9.432, 0.324, 0.5916, 8.55, 2.4642, 0.9576, 
3.588, 0.006912, 1.089, 6.396, 0.04818, 1.4448, 20.604, 0.363, 
0.7401, 11.712, 0.03897, 1.9491, 11.682, 1.149, 2.217, 3.882, 
0.15963, 5.916, 6.702, 0.3174, 1.6392, 7.188, 0.03582, 0.2646, 
8.853, 0.7761, 2.2446, 18.915, 0.3993, 0.002736, 9.699, 0.16638, 
0.6855, 9.423, 0.011793, 0.7986, 14.667, 2.5146, 0.28512, 5.919, 
0.06705, 0.25305, 8.184, 0.005262, 0.6492, 1.4604, 0.0138, 0.1872, 
8.604, 0.3057, 0.8052, 8.142, 0.017808, 0.9564, 2.2824, 0.000243, 
0.2565, 6.012, 0.16425, 0.3969, 12.633, 0.9408, 1.7154, 9.396, 
0.21945, 2.73, 13.479, 0.16236, 14.433, 9.612, 0.24222, 1.3275, 
12.486, 2.1543, 0.08652, 0.0003612, 5.364e-07, 0.3144, 9.942, 
1.3674, 1.326, 2.4621, 0.00019425, 0.6684, 1.6341, 0.0006165, 
0.5124, 11.796, 0.9798, 3.243, 11.73, 0.4716, 1.0248, 5.133, 
0.04527, 0.3078, 11.886, 2.6718, 1.158, 5.421, 0.06027, 1.7655, 
6.69, 0.00783, 5.907, 11.832, 0.9534, 3.228, 1.0323, 0.0016356, 
0.861, 6.774, 1.1001, 1.1811, 8.856, 0.4185, 1.3521, 11.877, 
0.2754, 2.5563, 0.0024852, 1.4796e-05, 0.6741, 6.774, 0.336, 
2.5017, 1.6425, 2.478e-05, 0.09243, 8.973, 0.25473, 0.9942, 13.245, 
0.3234, 0.6711, 10.35, 0.5148, 1.0578, 14.556, 0.774, 0.9225), .Dim = c(3L, 
100L), .Dimnames = list(c("A", "B", "C"), c("000162434", "000151547", 
"000133688", "000123954", "000184599", "000122987", "000117559", 
"000121528", "000192459", "000196759", "000172539", "000155583", 
"000185889", "000143968", "000128617", "000185423", "000158324", 
"000114797", "000126134", "000185624", "000123385", "000188299", 
"000195142", "000194666", "000113189", "000182457", "000173324", 
"000162459", "000141996", "000155516", "000148231", "000176159", 
"000135131", "000186287", "000187355", "000199513", "000125251", 
"000116237", "000188675", "000147224", "000198156", "000119366", 
"000132841", "000123791", "000138154", "000149758", "000157127", 
"000167763", "000113718", "000128418", "000148221", "000139836", 
"000194814", "000199972", "000168968", "000198853", "000128498", 
"000149484", "000196219", "000184178", "000144155", "000114251", 
"000114264", "000131697", "000154146", "000163257", "000112289", 
"000114416", "000195761", "000128348", "000144337", "000167126", 
"000159175", "000172296", "000182932", "000198134", "000127718", 
"000166651", "000196877", "000174415", "000131167", "000165476", 
"000195958", "000189229", "000119255", "000165984", "000119118", 
"000164273", "000199986", "000136544", "000124271", "000191248", 
"000126459", "000143728", "000182847", "000162785", "000193387", 
"000119516", "000199516", "000145424")))
$\endgroup$
  • $\begingroup$ wow... Seriously man, remove the data points from the question... $\endgroup$ – Bitwise Oct 12 '12 at 17:12
  • $\begingroup$ I would start with a 3d plot of your 3 covariates to make sure visually that there are clusters $\endgroup$ – JCWong Oct 12 '12 at 18:12
  • 2
    $\begingroup$ @Bitwise: why? For once that someone gives a dput he should rather be congratulated! $\endgroup$ – nico Oct 12 '12 at 21:22
  • $\begingroup$ @nico well it looks better now after editing, it was a mess before... $\endgroup$ – Bitwise Oct 12 '12 at 21:22
1
$\begingroup$

As @Bitwise mentions, clustering should be fine. Given your data matrix, you will need to transpose first:

data <- t(data)
hc <- hclust(dist(data))
plot(hc)
$\endgroup$
1
$\begingroup$

Yes you want clustering. The simplest ones to start with are kmeans or hierarchical clustering. There shouldn't be any limit on dimensionality - you can even cluster 1D data.

$\endgroup$
0
$\begingroup$

Why should it not work fewer dimensions. Actually a common use case for clustering is geo/map data, which is typically 2d data. You can cluster 1d, but there are better algorithms from statistics for 1d data (which, in contrast to 2d, is completely ordered).

Just try it!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.