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?
Flexible case-control matching commandHello, First, thanks in advance for anyone who can help me with this. I haven't had much luck recen…
synth_runner automatically generated predictorvarsI am using synth_runner in STATA 17. I got the exact same results when I run two specifications. dep…
CI Decmposition Results not Showing percentage contributionHi All, I am using Stata 16 and trying to decompose the concentration index but the results show no…
Extract country names from affiliationsHi, I have a dataset of about 1000 articles with variables such as id, title, abstract and affiliat…
What miss option means in gunique ?Deat Stata user, I found this gunique function, and using the same variable list I got different tot…
Subscribe to:
Post Comments (Atom)
0 Response to How to drop specific observations from dataset in Stata?
Post a Comment