Hi fellows, I have a paneldataset of 56.000 rows and I am trying to implement a DiD regression including fixed effects.
My problem is that I have daily output data for 20 banks over a time period of 10 years. I am struggling with connecting the individual banks to their timeperiods.
The image displays the Bankid (no. 12) the DealAmount and the daily dates.
I have 20 banks and examine the daily output for 10 years as seen in the example.
I tried the following code, but honestly I do not really know how this works and where this leads me to.
egen id = seq()
replace id=id-1
gen id_temp=id/7
drop id_temp
egen id2=anymatch(id_temp), values(0(1)999)
gen id3 =id_temp if id2==1
replace id3=id3[_n-1] if missing(id3)
egen year=seq(), by (id3)
rename id3 persod
drop id_temp
drop id2
xtset persod year
xtreg DealAm TotalA i.year, fe cluster(persid)
Much appreaciate your help guys and girls.
Array
0 Response to Link Individuals to daily dates.
Post a Comment