Hi everyone,

As I am quite new to Stata hope you can help me out with the next question.

Currently I have a dataset containing single 'event' observations in time.
From these observations I want to expand it to time series by groupID.
In the starting dataset for some groupID there are multiple EV==1, which all need to be in the expanded dataset.
The event variable (EV) needs to be replaced by 0 when there was no observation in the starting dataset.
So it looks like the following
Quarter groupID EV Fim
2006q1 126 1 TY
2006q1 127 1 VLK
2006q3 127 1 VLK
2006q3 128 1 HYN
I want to expanding it to the following (using groupID 127 as example)
quarter groupID EV Firm
... ... ... ...
2005q1 127 0 VLK
2005q2 127 0 VLK
2005q3 127 0 VLK
2005q4 127 0 VLK
2006q1 127 1 VLK
2006q2 127 0 VLK
2006q3 127 1 VLK
2006q4 127 0 VLK
2007q1 127 0 VLK
... ... ... ...
I already tried some with fill down, expand etc. But can't see where my coding goes wrong.
Hope I explained it well enough.
Thank you in advance and looking forward to any replies.

Best, Chiel