Hi all,

For my master thesis I have to calculate the effect of CSR investment on various performance measures. The first measure I am considering is Operating Return on Assets (in %). I am following the model that Lins, Servaes and Tamayo (2017) use and reestimate this with a different CSR index and a different time frame. Therefore, I need to estimate a difference-in-difference model with continuous treatment levels. I use quarterly data and estimate the following regression model over the period 2013-2018 (until the second quarter of 2018):

Performancemeasurei,t = bo + b1CSRi,2016*Crisist + b2CSRi,2016*Pre-Crisist + b3′ Xi,t−1+ Time Dummies + Firm Fixed Effects + ei,t.

where CSRi,2016 is the measure of CSR computed as of year-end 2016, Crisist is a dummy variable set equal to one for quarters 2017-4, 2018-1 & 2018-2, Pre-Crisist is a dummy variable set to one for quarters in 2013-2016 and 2017-1, 2017-2 & 2017-3, and Xi,t–1 is a vector of control variables. In the models of performance/Operating Return on Assets, I only control for the log of total assets.In the model I include quarter and firm fixed effects and standard errors need to be clustered at firm level. Below I provide an example of my dataset.

I need to generate an output that looks similar to the one presented in the paper I'm following:

[ATTACH=CONFIG]temp_13419_1549893320689_832[/ATTACH]
https://onlinelibrary.wiley.com/doi/...111/jofi.12505

If I use xtreg opreturnonassets c.csr_negative_3_16##i.crisis CSRcrisis CSRprecrisis lnassets i.fiscal_numeric, fe cluster(id), important variables are omitted because of collinearity
Could anyone help me with the coding of a difference-in-difference model with continuous treatment levels that results in a similar looking table of outcomes?


Thank you!

Julia van Haren



* Example generated by -dataex-. To install: ssc install dataex
clear
input str16 TickerSymbol float id int fiscal_numeric float(opreturnonassets opreturnonassets_perc csr_negative_3_16 crisis precrisis CSRcrisis CSRprecrisis lnassets)
"A" 1 20131 .02159016 2.1590161 .6727601 0 1 0 .6727601 9.273597
"A" 1 20132 .02625862 2.625862 .6727601 0 1 0 .6727601 9.267382
"A" 1 20133 .024421094 2.442109 .6727601 0 1 0 .6727601 9.237761
"A" 1 20134 .028261276 2.8261275 .6727601 0 1 0 .6727601 9.27669
"A" 1 20141 .01250235 1.250235 .6727601 0 1 0 .6727601 9.272188
"A" 1 20142 .00943225 .9432251 .6727601 0 1 0 .6727601 9.308011
"A" 1 20143 .013487476 1.3487476 .6727601 0 1 0 .6727601 9.247636
"A" 1 20144 .013941464 1.3941464 .6727601 0 1 0 .6727601 9.290168
"A" 1 20151 .017555526 1.7555525 .6727601 0 1 0 .6727601 8.925188
"A" 1 20152 .018078791 1.807879 .6727601 0 1 0 .6727601 8.910855
"A" 1 20153 .02206592 2.2065923 .6727601 0 1 0 .6727601 8.888895
"A" 1 20154 .02393368 2.393368 .6727601 0 1 0 .6727601 8.919854
"A" 1 20161 .024102986 2.4102986 .6727601 0 1 0 .6727601 8.895904
"A" 1 20162 .02015707 2.015707 .6727601 0 1 0 .6727601 8.941153
"A" 1 20163 .02236876 2.236876 .6727601 0 1 0 .6727601 8.953382
"A" 1 20164 .02730069 2.730069 .6727601 0 1 0 .6727601 8.962135
"A" 1 20171 .02820122 2.820122 .6727601 0 1 0 .6727601 8.971067
"A" 1 20172 .025948104 2.59481 .6727601 0 1 0 .6727601 8.989195
"A" 1 20173 .02517855 2.517855 .6727601 0 1 0 .6727601 9.0193
"A" 1 20174 .028839307 2.883931 .6727601 1 0 .6727601 0 9.039078
"A" 1 20181 .028397333 2.8397334 .6727601 1 0 .6727601 0 9.070848
"A" 1 20182 .026639344 2.6639345 .6727601 1 0 .6727601 0 9.0806875
"AA" 2 20131 . . .2994024 . . . . .
"AA" 2 20141 . . .2994024 0 1 0 .2994024 .
"AA" 2 20142 . . .2994024 0 1 0 .2994024 .
"AA" 2 20143 . . .2994024 0 1 0 .2994024 .
"AA" 2 20144 .06247323 6.247324 .2994024 0 1 0 .2994024 9.835209
"AA" 2 20151 . . .2994024 0 1 0 .2994024 .
"AA" 2 20152 . . .2994024 0 1 0 .2994024 .
"AA" 2 20153 . . .2994024 0 1 0 .2994024 .
"AA" 2 20154 .0004264912 .04264912 .2994024 0 1 0 .2994024 9.705829
"AA" 2 20161 -.00006096446 -.006096446 .2994024 0 1 0 .2994024 9.705219
"AA" 2 20162 .007878344 .7878343 .2994024 0 1 0 .2994024 9.70345
"AA" 2 20163 .005952037 .5952037 .2994024 0 1 0 .2994024 9.758751
"AA" 2 20164 .00949764 .9497641 .2994024 0 1 0 .2994024 9.725616
"AA" 2 20171 .021960646 2.1960645 .2994024 0 1 0 .2994024 9.745429
"AA" 2 20172 .01783921 1.783921 .2994024 0 1 0 .2994024 9.736783
"AA" 2 20173 .021907963 2.1907964 .2994024 0 1 0 .2994024 9.755799
"AA" 2 20174 .03433255 3.433255 .2994024 1 0 .2994024 0 9.766923
"AA" 2 20181 .025737014 2.5737014 .2994024 1 0 .2994024 0 9.7466
"AA" 2 20182 .04286233 4.2862334 .2994024 1 0 .2994024 0 9.712206
"AAC" 3 20131 . . . 0 1 . . .
"AAC" 3 20132 . . . 0 1 . . .
"AAC" 3 20133 . . . 0 1 . . .
"AAC" 3 20134 -.03357505 -3.357505 . 0 1 . . 4.4022946
"AAC" 3 20141 . . . 0 1 . . .
"AAC" 3 20142 .021044884 2.1044884 . 0 1 . . 4.540653
"AAC" 3 20143 .04468333 4.468333 . 0 1 . . 4.626354
"AAC" 3 20144 .033017706 3.301771 . 0 1 . . 4.983278
"AAC" 3 20151 .0275792 2.75792 . 0 1 . . 5.241657
"AAC" 3 20152 .05252895 5.252895 . 0 1 . . 5.348369
"AAC" 3 20153 .01862769 1.862769 . 0 1 . . 5.673018
"AAC" 3 20154 -.005277663 -.5277662 . 0 1 . . 5.755897
"AAC" 3 20161 .007231861 .7231861 . 0 1 . . 5.752557
"AAC" 3 20162 .0087189395 .8718939 . 0 1 . . 5.892197
"AAC" 3 20163 -.0034284934 -.3428493 . 0 1 . . 5.941071
"AAC" 3 20164 -.0020448884 -.20448884 . 0 1 . . 5.95034
"AAC" 3 20171 .001870799 .1870799 . 0 1 . . 5.982984
"AAC" 3 20172 .014707943 1.4707943 . 0 1 . . 6.007956
"AAC" 3 20173 .012192084 1.2192085 . 0 1 . . 6.034442
"AAC" 3 20174 .01216975 1.216975 . 1 0 . . 6.059765
"AAC" 3 20181 .01198466 1.198466 . 1 0 . . 6.252701
"AAC" 3 20182 .00575717 .5757169 . 1 0 . . 6.239792
"AAL" 4 20131 .00603723 .603723 .27791917 0 1 0 .27791917 10.079623
"AAL" 4 20132 .02002594 2.002594 .27791917 0 1 0 .27791917 10.174125
"AAL" 4 20133 .02673637 2.673637 .27791917 0 1 0 .27791917 10.19541
"AAL" 4 20134 .01300913 1.300913 .27791917 0 1 0 .27791917 10.652022
"AAL" 4 20141 .01364977 1.364977 .27791917 0 1 0 .27791917 10.68595
"AAL" 4 20142 .036799 3.6799 .27791917 0 1 0 .27791917 10.71021
"AAL" 4 20143 .03361782 3.361782 .27791917 0 1 0 .27791917 10.69587
"AAL" 4 20144 .03065957 3.065957 .27791917 0 1 0 .27791917 10.686727
"AAL" 4 20151 .032660306 3.2660306 .27791917 0 1 0 .27791917 10.752655
"AAL" 4 20152 .04334838 4.3348374 .27791917 0 1 0 .27791917 10.776202
"AAL" 4 20153 .04442164 4.4421635 .27791917 0 1 0 .27791917 10.793742
"AAL" 4 20154 .03135392 3.135392 .27791917 0 1 0 .27791917 10.787565
"AAL" 4 20161 .028832475 2.8832474 .27791917 0 1 0 .27791917 10.817957
"AAL" 4 20162 .03559186 3.559186 .27791917 0 1 0 .27791917 10.84058
"AAL" 4 20163 .03373249 3.373249 .27791917 0 1 0 .27791917 10.841697
"AAL" 4 20164 .020029645 2.0029645 .27791917 0 1 0 .27791917 10.84494
"AAL" 4 20171 .016303418 1.6303418 .27791917 0 1 0 .27791917 10.870985
"AAL" 4 20172 .033785813 3.378581 .27791917 0 1 0 .27791917 10.884367
"AAL" 4 20173 .026010955 2.6010954 .27791917 0 1 0 .27791917 10.86668
"AAL" 4 20174 .01932057 1.932057 .27791917 1 0 .27791917 0 10.847316
"AAL" 4 20181 .01174925 1.1749249 .27791917 1 0 .27791917 0 10.883316
"AAL" 4 20182 .02242408 2.242408 .27791917 1 0 .27791917 0 10.87089
"AAN" 5 20131 .04570513 4.5705132 -.1381169 0 1 0 -.1381169 7.529313
"AAN" 5 20132 .03309759 3.309759 -.1381169 0 1 0 -.1381169 7.536477
"AAN" 5 20133 .021146493 2.1146493 -.1381169 0 1 0 -.1381169 7.558768
"AAN" 5 20134 .01874532 1.874532 -.1381169 0 1 0 -.1381169 7.510527
"AAN" 5 20141 .03379056 3.379056 -.1381169 0 1 0 -.1381169 7.528993
"AAN" 5 20142 .01559578 1.559578 -.1381169 0 1 0 -.1381169 7.770429
"AAN" 5 20143 .015576976 1.5576977 -.1381169 0 1 0 -.1381169 7.735402
"AAN" 5 20144 .016490668 1.6490668 -.1381169 0 1 0 -.1381169 7.806633
"AAN" 5 20151 .034662697 3.46627 -.1381169 0 1 0 -.1381169 7.785164
"AAN" 5 20152 .028801885 2.8801885 -.1381169 0 1 0 -.1381169 7.764172
"AAN" 5 20153 .01972364 1.9723643 -.1381169 0 1 0 -.1381169 7.756056
"AAN" 5 20154 .017630389 1.763039 -.1381169 0 1 0 -.1381169 7.885658
"AAN" 5 20161 .032538872 3.253887 -.1381169 0 1 0 -.1381169 7.843365
"AAN" 5 20162 .027113294 2.7113295 -.1381169 0 1 0 -.1381169 7.840489
"AAN" 5 20163 .0217407 2.1740696 -.1381169 0 1 0 -.1381169 7.844394
end
[/CODE]
------------------ copy up to and including the previous line ------------------

Listed 100 out of 49277 observations
Use the count() option to list more