Hello,
I have Data like this
input double id str6 V1 long V2 long V3
1 "A" 20180103 20180830
2 "B" 20160409 20161218
end
where V2(aaaammdd) is the starting date and V3(aaaammdd) is the end date.
Using these two variables I want to construct a data like this
input double id str6 V1 long V2 long V3 long V4
1 "A" 20180103 20180830 201801
1 "A" 20180103 20180830 201802
1 "A" 20180103 20180830 201803
1 "A" 20180103 20180830 201804
1 "A" 20180103 20180830 201805
1 "A" 20180103 20180830 201806
1 "A" 20180103 20180830 201807
1 "A" 20180103 20180830 201808
2 "B" 20160409 20161218 201604
2 "B" 20160409 20161218 201605
2 "B" 20160409 20161218 201606
2 "B" 20160409 20161218 201607
2 "B" 20160409 20161218 201608
2 "B" 20160409 20161218 201609
2 "B" 20160409 20161218 201610
2 "B" 20160409 20161218 201611
2 "B" 20160409 20161218 201612
end
where V4(aaaamm) is extract from V2 and V3.
Thank you for your patience and I am looking forward to your feedback.
Related Posts with Data management
DateHi, How do I get to date in dd/mm/yyyy format? For example: 03/01/2011 Thanks! Code: * Example gen…
generate a line include several variablesHi, I am thinking how to generate ESG_Disclosure which include all years of ESG_disclosure score? so…
Query about merge files in different formatHi, I am wondering how to merge two databases which are in different format? Thank you so much for y…
Running a univariate logistic regression after psmatch 2Hello Statalist, Let me preface with the fact that I am new to statistical coding, but as the headi…
Creating loops with conditionsGoodmorning everyone, I'm here again to ask you for help. My starting code is this: Code: gen pROE…
Subscribe to:
Post Comments (Atom)
0 Response to Data management
Post a Comment