Hi,
I have a dataset where I have multiple observations per individual. I am looking for a specific observation, per each individual, among the many.
Specifically, I am looking for the observation in which the value of a variable is closest to 1.
How would I get about doing so? I have provided sample data in this post.
Much appreciated,
Kevin
I have a dataset where I have multiple observations per individual. I am looking for a specific observation, per each individual, among the many.
Specifically, I am looking for the observation in which the value of a variable is closest to 1.
How would I get about doing so? I have provided sample data in this post.
Much appreciated,
Kevin
id | value | indicator |
1 | 0.85 | Not this one |
1 | 0.99 | This one! |
1 | 1.20 | Not this one |
2 | 0.87 | Not this one |
2 | 0.88 | Not this one |
2 | 1.01 | This one! |
Comment