I want to create the column Counter
Name Counter
John 0
John 1
John 1
Kate 0
Kate 1
Kate 2
Kate 3
If I used SAS I would write:
if FIRST.Smoking_Status
Count = 0;
Count + 1;
run;
If every name is supposed to be a group, I have 3000 groups.