I have about one hundred groups of chemical testing results data. Within each group there are between 1 and 200 chemical testing results. Each set of results contains testing data for 5 chemicals. Within each group the testing results may be from the same original sample or they may have come from a completely different sample. My task is to try and determine which testing results could have come from the same sample.
So an example from one group looks something like this:
| Test | Chem1 | Chem2 | Chem3 | Chem4 | Chem5 |
| A | 0.01 | 0.01 | 0.51 | 0.09 | 0.42 |
| B | 0.09 | 0.01 | 0.51 | 0.09 | 0.42 |
| C | 2.66 | 0.01 | 0.51 | 0.09 | 0.42 |
| D | 2.56 | 0.01 | 0.51 | 0.09 | 0.42 |
The first approach I took is not working. I tried taking the Euclidean distance. This does not work because in the above example A and B are closer together than C and D. But A and B can not be from the same sample as B is 9x A and this should not be possible given the precision of the test. I tried scaling the data but it does not address this problem.
What I think I am looking for is a distance/similarity metric that measures the ratio between the two rows of data. Is there a standard metric I can apply in this case?
Or is there an entirely different approach I should consider?