I would like to remove the rows containing ratees not in the rater list. For example, in the dataset below, team 1 has three raters - A, B, C, D. I would like to delete these rows whose ratees are "E" and "G". Also, team 2 have two raters - M and N. I would like to delete the row whose ratee is "F".

Can anyone help me?


Code:
cls
clear all
input team str1 rater str1 ratee
1    "A"    "B"
1    "A"    "C"
1    "A"    "E"
1    "B"    "A"
1    "B"    "C"
1    "B"    "D"
1    "C"    "A"
1    "C"    "B"
1    "C"    "D"
1    "D"    "A"
1    "D"    "B"
1    "D"    "G"
2    "M"    "N"
2    "N"    "M"
2    "N"    "F"
end