Hi all,
I have a simple question and data in the following form:
clear
input str9 team float action float time
"R" . 1
"R" . 2
"R" . 3
"R" . 4
"R" . 7
"R" 0 8
"R" . 9
"R" . 13
"R" . 25
"Z" . 2
"Z" . 3
"Z" . 4
"Z" . 6
"Z" . 7
"Z" 0 9
"Z" . 12
"Z" . 14
"Z" . 15
end
What I want to do is to replace the missing values with ascending and descending values from the zero for each team that then should like look like this:
clear
input str9 team float action float time
"R" -5 1
"R" -4 2
"R" -3 3
"R" -2 4
"R" -1 7
"R" 0 8
"R" 1 9
"R" 2 13
"R" 3 25
"Z" -5 2
"Z" -4 3
"Z" -3 4
"Z" -2 6
"Z" -1 7
"Z" 0 9
"Z" 1 12
"Z" 2 14
"Z" 3 15
end
Many thanks for you help!
Philip
Comment