I need some sas code for the following urgently.
I have 2 variables id and C that might look like
id C
1 1
2 2
3 3.2
4 4.6
5 5.8
6 6.9
7 8.4
. .
. .
n 546.4
First, I need to generate a random start R, between O and l.
I then need to select case ids from the list where C is R, R+l, R+2l,....
Usually C will not equal exactly R, R+l, R+2l, ... in which case choose the case id whose value of C is slightly greater than R, R+l, R+2l,...
For example, if l=3.2 and R=0.2:
then select case ids where C=0.2, 3.4, 6.6,...
therefore choose case ids where C=1, 4.6, 6.9,...
ie where id=1,4,6,..
Can you help?
I have 2 variables id and C that might look like
id C
1 1
2 2
3 3.2
4 4.6
5 5.8
6 6.9
7 8.4
. .
. .
n 546.4
First, I need to generate a random start R, between O and l.
I then need to select case ids from the list where C is R, R+l, R+2l,....
Usually C will not equal exactly R, R+l, R+2l, ... in which case choose the case id whose value of C is slightly greater than R, R+l, R+2l,...
For example, if l=3.2 and R=0.2:
then select case ids where C=0.2, 3.4, 6.6,...
therefore choose case ids where C=1, 4.6, 6.9,...
ie where id=1,4,6,..
Can you help?