Gurus,
I have a set of data with a portion of them with ID having more than 1 occurrences. 2nd column is value. I want to get rid of the outliers by comparing the values for IDs appearing more than 2 times. Could someone give me any suggestions? Thanks!
Criteria 1: Any values with same ID that are less than 20% different from each other(always smaller value divided by bigger value) can be grouped together to form the majority group. For example, for all values associated with C, 110/112/111 are not outliers but if there is value 88 it will be considered outlier because 88/110 = 80%, 88/112 <80%.
Criteria 2: The majority group just need to have 1 more value than minority like ID "D"
Criteria 3: if there are no majority group and the values are significantly different than others, ID will be flagged.
I have a set of data with a portion of them with ID having more than 1 occurrences. 2nd column is value. I want to get rid of the outliers by comparing the values for IDs appearing more than 2 times. Could someone give me any suggestions? Thanks!
Criteria 1: Any values with same ID that are less than 20% different from each other(always smaller value divided by bigger value) can be grouped together to form the majority group. For example, for all values associated with C, 110/112/111 are not outliers but if there is value 88 it will be considered outlier because 88/110 = 80%, 88/112 <80%.
Criteria 2: The majority group just need to have 1 more value than minority like ID "D"
Criteria 3: if there are no majority group and the values are significantly different than others, ID will be flagged.
A | 10 | |
B | 120 | no majority group ID is flagged |
B | 1 | no majority group ID is flagged |
C | 110 | |
C | 112 | |
C | 111 | |
C | 10 | outlier |
C | 20 | outlier |
D | 50 | |
D | 51 | |
D | 10 | outlier |
E | 10 | No majority group, ID is flagged |
E | 20 | No majority group, ID is flagged |
E | 30 | No majority group, ID is flagged |
F | 20 | No majority group, ID is flagged |
F | 21 | No majority group, ID is flagged |
F | 1 | No majority group, ID is flagged |
F | 1.1 | No majority group, ID is flagged |
G | 21 | |
G | 20 | |
G | 5 | |
G | 1 |
Last edited: