# R: How to find the rows in the input files that correlate to the 2 “populations” in the plot

I am completely new to clustering analysis.

Let's say I have a file of the format:

1   -0.123  -0.306  inf 1.043   0.000   0.010   0.000   0.653   0.000   0.091   0.000   0.009   0.000   3.097   0.000   0.137   0.002
2   -0.142  -0.170  inf 1.035   0.000   0.064   0.000   0.538   0.000   0.560   0.000   0.289   0.000   3.168   0.000   6.182   0.000
3   -0.160  -0.143  inf 1.027   0.000   0.086   0.000   0.401   0.000   0.631   0.000   0.400   0.000   3.348   0.000   0.130   0.000
4   -0.176  -0.117  inf 1.020   0.000   0.107   0.000   0.249   0.000   0.592   0.000   0.435   0.000   3.526   0.000   0.402   0.001
5   -0.191  -0.110  inf 1.014   0.000   0.133   0.000   0.091   0.000   0.514   0.000   0.425   0.000   3.644   0.001   0.598   0.001
6   -0.206  -0.099  inf 1.008   0.000   0.162   0.000   6.247   0.000   0.435   0.001   0.392   0.001   3.675   0.001   0.707   0.002
7   -0.220  -0.093  0.976   1.003   0.000   0.194   0.000   6.168   0.001   0.377   0.001   0.352   0.001   3.602   0.003   0.740   0.003
8   -0.233  -0.092  inf 0.999   0.000   0.226   0.000   6.137   0.001   0.353   0.001   0.302   0.001   3.445   0.004   0.712   0.005
9   -0.246  -0.124  inf 0.996   0.000   0.258   0.000   6.145   0.001   0.363   0.001   0.252   0.001   3.242   0.004   0.620   0.006
10  -0.259  -0.119  inf 0.994   0.000   0.289   0.000   6.172   0.001   0.393   0.001   0.206   0.001   3.028   0.005   0.456   0.008



If I plot the 2nd and 7th columns of the file, I get something like this. Now, as you can see, there appears to be 2 populations in this graph, no? One population is wide and to the right, and the other is narrow and in the middle stretching to the left. I would like to find out which rows in the file correlate to the different populations. What would be the best way to do this?

If you would like to reproduce this yourself here is the input file.

• Welcome to DataScienceSE. This is an interesting question imho: I agree that there's quite clearly a specific pattern for the smaller group, but I'm not sure which clustering method can capture this kind of pattern: standard distance-based methods like k-means would get confused with the overlapping points. There seems to be small groups of point, can you get the group a point belongs to in your data? If yes it would be much easier to separate these groups I think. – Erwan Mar 28 at 23:31
• @Erwan I am not sure what you mean by "can you get the group a point belongs to in your data". However, there is a second data file that describes six additional properties for each of these ~7000 points. I edited my post to include it. – Woj Mar 28 at 23:40
• I mean that the data points appear to be grouped by series of around 10 points (sometimes less), is there a kind of id in the data which says which point belongs to which group? – Erwan Mar 29 at 0:01
• @Erwan I see. Unfortunately, there is no id. My bigger picture task is to actually find out how variable changes in the second input file correlate to the changes in those 10 point sequences you mention. – Woj Mar 29 at 0:05
• Ok, too bad. I would imagine that some clustering methods can deal with this kind of data but I know only the standard ones. Maybe even some images techniques could be used on the graph itself, I don't know. Hopefully somebody will be able to help, good luck! – Erwan Mar 29 at 0:15