Hello,
I have a large dataset but I do not need all observations. The dataset contains data for every day within the period from 1989 to 2019. How can I delete all observations in Stata except for the last day of each year and for each company? (the variable name and format is attached with the image)
Example:
Permno Data n Ret alpha ....
1001 31dec1989
1001 31dec1990
1001 31dec1991
...
1001 31dec2019
1002 31dec1989
1002 31dec1990
...
Thank you very much!
Best regards
Sven
Array
Related Posts with How to drop specific observations from dataset in Stata?
Coding 1/0 between timestampsI am trying to code if a listing existed in a certain month between the start date of the listing an…
ignore this! …
ignore this also! …
Testing code blocks Code: This is a test with 10 spaces between here> <and here. …
testing code blocks Code: This is a test with 10 spaces between here> <and here. If you copy the code …
Subscribe to:
Post Comments (Atom)
0 Response to How to drop specific observations from dataset in Stata?
Post a Comment