I have the following dataset that tells me if there is a connection between two people:
pos_1 pos_2
2 4
2 5
1 2
3 9
4 2
9 3
The above is read as person_2 is connected to person_4,...,person_4 is connected to person_2, and person_9 is connected to person_3
And I want to create a third dichotomous variable recip that lets me know if the connection is reciprocated, in other words if person_X is connected to person_Y is person_Y connected to person_X leaving me with:
pos_1 pos_2 recip
2 4 1
2 5 0
1 2 0
3 9 1
4 2 1
9 3 1