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
Related Posts with Link Individuals to daily dates.
Kakwani indexDear all, I am trying to calculate the Kakawni index (K) , which is the difference between the conc…
Panel Data - mean/median by specific variableHi, I have panel data with several stocks and dates. I have variable X which is defined for each da…
Changing the display of a date variableHi all, I have a year-month variable which I have formatted with %tm. Is there a way to change the …
Kakwani indexDear all, I am trying to calculate the Kakawni index (K) , which is the difference between the conc…
Codes for Randomly selecting from a particular cluster but a certain percentageHi everyone, wondering if anyone can help as I seem stuck. I have a dataset with 105 hospitals and …
Subscribe to:
Post Comments (Atom)
0 Response to Link Individuals to daily dates.
Post a Comment