Here is my data set. Data in
I'd like to check if the gender with "Potential Original" matched the gender with "Potential Duplicate'. There is no specified group but 1 duplicate + 1 or more original acted like a group.
Here is the output I want (for duplicate it's NA because it's comparing to itself). Data out
Appreciate your help. Thanks.