Hi
I am trying delete rows in my dataset where the patid and obsid are the same. I have attempted to group them using this syntax
by patid: egen group1 = group(patid obsdate)
but get error message
egen ... group() may not be combined with by
r(190);
if I use this syntax
egen group1 = group(patid obsdate)
it just numbers all of the obsdate but doesnt group them by patid.
what i would like is the numbering to restart with a new patid.
patid obsdate
7320018 19may2018
7320018 19may2018
7320018 04jun2018
7320018 04jun2018
16220018 01jan1984
16220018 01jan1984
16220018 16may2001
16220018 16may2001
16220018 21dec2001
16220018 21dec2001
16220018 14feb2003
16220018 14feb2003
thanks
Jennifer
I am trying delete rows in my dataset where the patid and obsid are the same. I have attempted to group them using this syntax
by patid: egen group1 = group(patid obsdate)
but get error message
egen ... group() may not be combined with by
r(190);
if I use this syntax
egen group1 = group(patid obsdate)
it just numbers all of the obsdate but doesnt group them by patid.
what i would like is the numbering to restart with a new patid.
patid obsdate
7320018 19may2018
7320018 19may2018
7320018 04jun2018
7320018 04jun2018
16220018 01jan1984
16220018 01jan1984
16220018 16may2001
16220018 16may2001
16220018 21dec2001
16220018 21dec2001
16220018 14feb2003
16220018 14feb2003
thanks
Jennifer
Comment