I am trying to conduct difference in difference analysis. I want to look at whether bank holding company's (bhc) providing a certain type of loan can reduce overall credit enhancements, proposing that lending this type of loan has a greater impact on credit enhancements of small BHCs compared to large BHCs. I am looking at a period between 2019Q1 and 2020Q3 and have set up panel data in this way. I have created a loan dummy (PPP) which takes the value of 1 if a BHC has a balance of these loans outstanding greater than 0 (therefore providing the loans) and 0 otherwise. I have also created a treated group in which the dummy variable takes the value 1 if the BHC falls in the bottom 75% of my sample (qualifying as small). Finally I have created my DiD estimator by using the command:

gen PPPBHC = PPP*BHC

I am extremely new to Stata and do not know where to go from here. I want to create a vector 'X' (for example) which is a vector of all explanatory factors at BHC level. I have collected these and are shown in my data sample such as ROA, UC etc.

I have read through the guides and have managed to set up my panel data using:

xtset bhcid quarter

But I need some guidance as to how to create this explanatory vector in which the majority of my variables are included - I would like to lag all these by one quarter to mitigate reverse causality issues. I would also like to control for BHC and time fixed effects. I know I need to create quarterly dummies as my dependent variable is the quarterly change which I believe I can do by using the command:

i.quarter

Other than this I am unsure of how to execute my desired regression, any help on this would be appreciated.

input int bhcid double assets long uc float(leverage roa risk dr sa) long(ce pppbal) float(quarter logassets BHC PPP)
135 10059165 1595813 .1934232 .008206502 .911175 .019205164 133.4364 0 0 241 16.123995 1 0
146 10084886 1323122 .1400699 .001810943 .8175479 .003649191 4.6193156 0 . 240 16.126549 1 0
132 10144014 34193 .0964483 .001811249 .8403483 .00238113 13.172705 0 . 236 16.132395 1 0
135 10168560 125654 .19831324 .008832491 .8679075 .004936665 53.69326 0 0 242 16.134811 1 0
144 10170960 598833 .04209426 .00600147 .6255334 .006011625 10.706806 0 . 238 16.135048 1 0
131 10214189 2250303 .14253192 .004747283 .8005214 .003098738 5.274777 0 . 236 16.139288 1 0
136 10335774 432854 .10949872 .005860043 .7154263 .004595784 11.001625 0 125773 241 16.151121 1 1
140 10339817 1736538 .1530442 .01677197 .5230162 .000723009 1.8082997 0 703117 241 16.151512 1 1
130 10415970 2203730 .12637095 .003086504 .7789994 .008919548 4.1620674 0 . 236 16.158852 1 0
142 10470261 1350219 .11341389 .010235881 .918959 .001527983 5.141767 0 . 238 16.16405 1 0
145 10499696 970167 .1342738 .002088878 .7538101 .006503489 12.3569 321828 . 240 16.166857 1 0
146 10513539 692292 .13415168 .003473649 .8007044 .001537909 3.956913 0 400316 241 16.168175 1 1
139 10539628 1294185 .1191413 .00976769 .6993737 .000930493 2.777986 0 746431 242 16.170652 1 1
140 10567652 1157496 .1532508 .02543294 .53413665 .000674176 1.8284714 0 703731 242 16.173307 1 1
130 10633873 642428 .12540944 .00618653 .7817224 .003138513 4.0622888 0 . 237 16.179556 1 0
130 10638226 867203 .12720965 .013334362 .7784908 .007181913 4.930581 -809019 . 239 16.179964 1 0
136 10669451 1949744 .1077182 .007398844 .7159722 .0000315485 10.53928 0 . 242 16.182896 1 0
130 10736134 825527 .12590845 .010155145 .7781742 .003161542 4.335874 256247 . 238 16.189125 1 0
131 10737857 1744259 .13984504 .009406575 .7907712 .001942605 5.55529 0 . 237 16.189285 1 0
128 10745388 801280 .16839875 .014313055 .56465137 .004814412 2.656112 0 . 237 16.189987 1 0
130 10798603 615752 .12425607 .000946759 .7765314 .008276191 4.649884 552772 . 240 16.194927 1 0
139 10835965 984700 .11407235 .005568228 .6823329 .000704087 2.6541524 0 749429 241 16.198381 1 1
143 10847184 574232 .1053409 .004556143 .7098354 .002690297 2.4598775 0 524654 241 16.199415 1 1
143 10850212 1218804 .10747357 .009086992 .7119371 .002241861 2.390374 0 525833 242 16.199696 1 1
129 10875561 1126089 .0955799 .004949365 .7212164 .002763359 5.209956 -1793222 . 236 16.202028 1 0
128 10916467 464271 .16096124 .006974394 .55017525 .004919053 2.6686196 0 . 236 16.205784 1 0
136 10998320 1712900 .09827874 .002850076 .7137742 .000466044 13.211247 0 119944 240 16.213253 1 1
148 11012195 99753000 .0830067 .009608653 .7109377 .000657153 3.1094434 0 1045356 241 16.214514 1 1
125 11171583 1241489 .17335744 .012273373 .773982 .000044057 1.4353052 0 . 237 16.228884 1 0
132 11182548 2402269 .08865645 .002588602 .8544877 .001012514 22.897346 0 . 237 16.229864 1 0
129 11220238 287793 .09563523 .009735245 .7273983 .002997382 6.572628 1832127 . 237 16.23323 1 0
126 11278499 0 .10778996 .004064806 .7808282 .009578915 8.444398 0 . 236 16.238409 1 0
125 11282450 1169545 .17674334 .023900155 .7707222 .000218518 1.4421033 0 . 239 16.238758 1 0
125 11304957 1054715 .1672653 .005941855 .7687977 .000157095 1.4918864 0 . 236 16.240751 1 0
124 11312495 1232268 .12129084 .003680407 .7565105 .004724736 2.3524816 0 . 236 16.241419 1 0
123 11332739 1815459 .13192733 .003316723 .877019 .003529479 23.95806 0 . 236 16.243206 1 0
125 11332762 1122097 .17355813 .018178932 .7598674 .000190408 1.3917003 0 . 238 16.243208 1 0
145 11356793 534157 .13000448 .004444153 .6968511 .001717616 13.68709 0 479101 241 16.245327 1 1
148 11394874 2075458 .08329087 .014548317 .7153498 .000515473 3.087441 0 1053016 242 16.248674 1 1
141 11402982 1608835 .1497979 .018118957 .7994525 .000634785 3.309753 0 . 239 16.249386 1 0
128 11410295 526581 .1625929 .025335895 .5840257 .005928151 2.7944434 0 . 239 16.250027 1 0
123 11508089 1762001 .13886519 .010335237 .8732219 .002798078 22.960016 0 . 238 16.25856 1 0
132 11520717 2239355 .09138276 .007706449 .893485 .003370088 25.23601 0 . 239 16.259657 1 0
123 11521429 1969698 .13467592 .006707262 .8801816 .003495518 27.63793 0 . 237 16.25972 1 0
141 11540121 1704311 .14578044 .0129758 .7860037 .000781989 3.227599 0 . 238 16.261341 1 0