Hi everyone,
I have a quick question, probably easy for most of you. I want to separate a dataset into two chunks, based on dates, and then produce some summary statistics related to it, but I don't know how to do that in the best way.
Basically, I want to divide my sample into contracts than began before 01jun2021, and those than began on 01jun2021 onwards, and then produce some tables with descriptive statistics about it.
At the end, I want to retrieve my original sample, if possible please
Here is a dataex:
Your help is really appreciated.
Thanks!
Best,
Michael
I have a quick question, probably easy for most of you. I want to separate a dataset into two chunks, based on dates, and then produce some summary statistics related to it, but I don't know how to do that in the best way.
Basically, I want to divide my sample into contracts than began before 01jun2021, and those than began on 01jun2021 onwards, and then produce some tables with descriptive statistics about it.
At the end, I want to retrieve my original sample, if possible please
Here is a dataex:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long id double(date_contract_start date_contract_end) long idcontrato 1001 18887 21700 1001 1001 21701 22431 451697 1001 22432 22645 1236132 1001 22646 22676 1730454 1001 22677 22735 2082075 1001 22736 23010 2172904 1001 23011 23069 2872183 1001 23070 . 3107888 end format %td date_contract_start format %td date_contract_end
Thanks!
Best,
Michael
Comment