Hey stata community,
I'm very new in using stata and have a question concerning the use of keeping same values.
My dataset looks like this:
Date | Molecule
01.01.1995 | Molecule 1
01.01.1995 | Molecule 1
10.05.1995 | Molecule 1
03.04.1998 | Molecule 2
03.04.1998 | Molecule 2
03.04.1998 | Molecule 2
05.07.1999 | Molecule 2
...
I only want to keep the first same values (date) per molecule, like this:
Date | Molecule
01.01.1995 | Molecule 1
01.01.1995 | Molecule 1
03.04.1998 | Molecule 2
03.04.1998 | Molecule 2
03.04.1998 | Molecule 2
...
How do I get there? The command sortby id: keep if _n==1 did not work as that only took the first of the observations.
Best regards,
Milena
0 Response to Stata keep first same data by molecule
Post a Comment