Hi all,
I'm currently writing my master's thesis and i'm a little bit stuck at the moment.
This is a simplified view of my sample:
DA roa
0.1 1.2
0.5 1.5
0.7 1.6
0.2 1.9
0.1 2.8
0.6 3.6
0.4 2.0
0.2 0.5
I would like to create a new variable that is based on the absolute difference between DA of a value of a certain roa, and DA of the value of roa that is closest to the value of this roa.
So for example, the closest value of the first roa (1.2) is 1.5. So I would like to create a new variable with the value (0.5-0.1)= 0.4 for the first line, and (0.7-0.5)= 0.2 for the second line, because 1.5 is closest to 1.6.
Is there someone who can help me out?
Thank you in advance!
I'm currently writing my master's thesis and i'm a little bit stuck at the moment.
This is a simplified view of my sample:
DA roa
0.1 1.2
0.5 1.5
0.7 1.6
0.2 1.9
0.1 2.8
0.6 3.6
0.4 2.0
0.2 0.5
I would like to create a new variable that is based on the absolute difference between DA of a value of a certain roa, and DA of the value of roa that is closest to the value of this roa.
So for example, the closest value of the first roa (1.2) is 1.5. So I would like to create a new variable with the value (0.5-0.1)= 0.4 for the first line, and (0.7-0.5)= 0.2 for the second line, because 1.5 is closest to 1.6.
Is there someone who can help me out?
Thank you in advance!
Comment