duplicate_tally function

Count duplicates at each observation