Hello, everyone. I am doing my master's thesis, and I am experiencing some problems and doubts on how to apply diff methodology to the panel data I have.
The purpose of the analysis is to observe whether or not the semiconductor shortage in 2020 had an economic impact on importing companies.
The data panel covers five consecutive years from 2018 to 2022. I therefore created a dummy for the time period (0 before 2020 and 1 after 2020), a dummy treated and in turn the interaction dummy. The variables on which I have to observe the effect are budget indices. In the final analysis, I added control variables (dummy on the origin north-west north east centre and south) ( dummy number of employees) and two indices that have values between 0 and 1. I am not sure whether the control variables especially the two indices that have values varying from 0 and 1 are set correctly and whether the interaction time period dummy x treated is correct. I don't know how to share my panel data
The purpose of the analysis is to observe whether or not the semiconductor shortage in 2020 had an economic impact on importing companies.
The data panel covers five consecutive years from 2018 to 2022. I therefore created a dummy for the time period (0 before 2020 and 1 after 2020), a dummy treated and in turn the interaction dummy. The variables on which I have to observe the effect are budget indices. In the final analysis, I added control variables (dummy on the origin north-west north east centre and south) ( dummy number of employees) and two indices that have values between 0 and 1. I am not sure whether the control variables especially the two indices that have values varying from 0 and 1 are set correctly and whether the interaction time period dummy x treated is correct. I don't know how to share my panel data
Code:
**Rename some variables rename Employess employee rename ReturnonequityROE roe rename ReturnonsalesROS ros rename ReturnonassetsROA roa rename ReturnoninvestementsROI roi rename DummyTreatednoTretaed treat rename Year year rename Dummynordwest north_west rename Dummynordeast north_east rename Dummycenter center rename DummysouthIsland south_island rename Dummysmallbigcompany small_big rename VerticalIntegration vertical rename Financialindependenceindex financ_index gen year_only_estb = year(year_estb) gen overall_sales = other_revenue+ sales_revenue **clean the datastset drop if vertical > 1 drop if financ_index > 1 destring, replace **o set the data to panel xtset vat gen post = 1 if year >= 2021 replace post = 0 if post !=1 ***Differnce in difference estimation anaysis **First regression Table est clear eststo:xtreg roe post treat c.post#c.treat c.post#c.treat#c.north_west c.post#c.treat#c.north_east c.post#c.treat#c.south_island small_big vertical financ_index , vce(robust) eststo:xtreg ros post treat c.post#c.treat c.post#c.treat#c.north_west c.post#c.treat#c.north_east c.post#c.treat#c.south_island small_big vertical financ_index , vce(robust) eststo:xtreg roa post treat c.post#c.treat c.post#c.treat#c.north_west c.post#c.treat#c.north_east c.post#c.treat#c.south_island small_big vertical financ_index , vce(robust) eststo:xtreg roi post treat c.post#c.treat c.post#c.treat#c.north_west c.post#c.treat#c.north_east c.post#c.treat#c.south_island small_big vertical financ_index , vce(robust) esttab using "regression1.tex", booktabs mtitle("\shortstack{\textbf{ROE}}" "\shortstack{\textbf{ROS}}" "\shortstack{\textbf{ROA}}" "\shortstack{\textbf{ROI}}") replace /// b(3) se(3)r2 label star(* 0.10 ** 0.05 *** 0.01) /// coeflabel(date "year dummy" post "Post" treat "Treat" c.post#c.treat "Treatment Effect" c.post#c.treat#c.north_west "Treat North West" c.post#c.treat#c.north_east "Treat North East" c.post#c.treat#c.south_island "South Island" Small_Big "small_big" vertical "Vertical Integration" financ_index "Financial Index" ) /// title(Difference in difference analysis) sfmt(3)
Comment