Dear all,
I have a problem to calculate the smallest difference between observations in each group in one variable. Could you please help me to calculate the distance between observation and its closest value observation? Thanks!
For example, my data sample looks like:
Group Var1
1 1
1 3
1 5
1 2
2 3
2 5
2 6
2 9
I have a problem to calculate the smallest difference between observations in each group in one variable. Could you please help me to calculate the distance between observation and its closest value observation? Thanks!
For example, my data sample looks like:
Group Var1
1 1
1 3
1 5
1 2
2 3
2 5
2 6
2 9