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.
Cluster standard errors by firm and yearHello all, I am running a FE regression using the LSDV approach (industry and year FE) and i want t…
Margins options with probitHello I am regressing math proficiency (binary) on private tutoring expenditure and school type (pr…
Group based on unordered stringsHere comes an easy one... I have two variables with country names and want to create an identifier f…
How to generate group idHi, I am importing a household data from excel, and data set does not have a proper id variable, and…
Combining 2 coefplots (based on margins from linear regression models) to have a panel graphHi All I've produced the below two graphs using coefplot (graphs are based on margins produced afte…
Subscribe to:
Post Comments (Atom)
0 Response to Link Individuals to daily dates.
Post a Comment