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
Related Posts with Stata keep first same data by molecule
Should I make inferences on the Pseudo R-square given by fracreg?Hi all, I have a dependent variable which varies between 0 and 1 so I decided to use fracreg. Howev…
xtrc + outreg2Dear All, I ran the following regression: Code: webuse grunfeld, clear xtset company year xtrc i…
Multilevel data: melogit vs logit with clustered standard errorsHello, I have some questions regarding (dis)advantages of using melogit vs logit, vce(cluster) vs x…
excel file too big.Dear All, I tried to import many excel files but encountered the following error message. Any sugges…
Not able to get inverted parabola for data (though theory says so)Hi all, can someone please help me understand the nature of the data and the unexpected results I ha…
Subscribe to:
Post Comments (Atom)
0 Response to Stata keep first same data by molecule
Post a Comment