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.
Mediation moderation commandHello, I was wondering if there is mediation moderation command all in one. Please see the model th…
Repeated Time values ErrorI am trying to set up a panel structure for my data on houses and schools across a 10 year period. T…
How can I count the rows with specific description of a variable per firm and put 0 otherwise?I am new with stata and I would like to know how I can create two new columns that count how many me…
Separating a bar graph by two groups. …
Stationarity in Macroeconomic Panel DataDear Statalist, I am working on my dissertation which includes an analysis of macroeconomic data su…
Subscribe to:
Post Comments (Atom)
0 Response to Link Individuals to daily dates.
Post a Comment