Hello,
I am replicating a stufy that uses a penalized regression model (LASSO regression).
I am imposing that certain controls must always be kept as the independent variables of the model (Size Lev Delta_Lev Cfo Roa Loss Ret Newfin GDP_CAP INF) and the remaining fixed effects as part of the pool of covariates from which the LASSO regression has to select from and include in a potential extended model (Accounting_Firm Office Partner). The result of this selection is reported. By this, I can report % of the fixed effects kept by a LASSO regression:
I started with the below command but need guidance on how to correct the below code so that am able generate the results
dsregress ABWC Size Lev Delta_Lev Cfo Roa Loss Ret Newfin GDP_CAP INF , controls (country_dummy Accounting_Firm Office Partner).
Appreciate any suggestions.
A sample of the dataset is the following:
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
I am replicating a stufy that uses a penalized regression model (LASSO regression).
I am imposing that certain controls must always be kept as the independent variables of the model (Size Lev Delta_Lev Cfo Roa Loss Ret Newfin GDP_CAP INF) and the remaining fixed effects as part of the pool of covariates from which the LASSO regression has to select from and include in a potential extended model (Accounting_Firm Office Partner). The result of this selection is reported. By this, I can report % of the fixed effects kept by a LASSO regression:
Dependent Variable | ABWC |
Accounting Firm | ____% |
Office | ____% |
Partner | ____% |
dsregress ABWC Size Lev Delta_Lev Cfo Roa Loss Ret Newfin GDP_CAP INF , controls (country_dummy Accounting_Firm Office Partner).
Appreciate any suggestions.
A sample of the dataset is the following:
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double(Cfo Lev Roa Delta_Lev Size Ret) byte(Loss Newfin) double(ABWC GDP_CAP INF industry_dummy) byte(year_dummy country_dummy Accounting_Firm) int(Office Partner) -3.477778 .2094573 .0754258 -.09415 -.0008361 9.154087 3 1 -.0062237 .7780994 .0081418 1.031054 9 7 34 13 138 .1040425 .1049256 .0326545 -.0206519 11.586 1.157811 0 0 .1194803 .065416 1.363458 9 2 36 60 1553 7702 -.087153 .1190798 .1037854 .0141542 11.3527 .16859 0 0 .1497268 .009505 -1.282878 9 3 36 60 1553 7702 .1222233 .0097934 .0772463 -.1092864 11.28918 .407766 0 0 .0862383 .0240593 -.2815681 9 4 36 60 1553 7702 -.0446237 0 .2412466 -.0097934 11.20173 .933549 0 0 .2243766 .093184 -.8405466 9 5 36 60 1553 7702 .1533767 0 .2517686 0 11.41429 .361059 0 0 .0223794 -.0498601 -1.083073 9 6 36 60 1553 4394 .1442986 0 .2596487 0 11.5267 .324885 0 1 .0192443 -.0860048 .6403705 9 7 36 60 1553 4394 .2260931 0 .2911997 0 11.46387 .444906 0 0 .0969913 -.0154652 1.549338 9 8 36 60 1553 4394 .2214201 0 .3161339 0 11.65726 .211318 0 0 .0591757 .0682661 -.2649158 9 9 36 60 1553 4394 .2776603 .0152092 .3288799 .0152092 11.78626 .036404 0 0 .1235574 -.0132072 -.5547354 9 10 36 26 511 1973 .0167937 .1018657 .0251702 .0866565 11.71478 .774666 0 0 .1834904 -.0457952 -.7486179 9 11 36 26 511 1973 .0490982 .072737 .1342733 -.0291287 12.04191 -.250751 0 0 .1384186 .1517413 1.528884 9 12 36 26 511 1973 .0180668 .1427854 .0701989 .0199332 11.09371 .984375 0 1 .2341167 .065416 1.363458 4 2 36 41 972 2401 -.0733553 .25629 -.4132345 .1135045 10.85493 -.393701 1 1 .2955648 .009505 -1.282878 4 3 36 41 972 2401 -.0341954 .1545238 .0956642 -.1017661 11.08452 -.207792 0 0 .4568069 .0240593 -.2815681 4 4 36 41 972 2401 .0180656 .157395 .0453432 .0028711 11.11212 .131148 0 1 .0324053 .093184 -.8405466 4 5 36 41 972 2401 -.0023287 .1725964 .0343995 .0152014 11.54723 -.130435 0 1 .0316653 -.0498601 -1.083073 4 6 36 41 972 2401 .0001691 .1994024 .0157203 .026806 11.57518 -.125 0 1 .0017837 -.0860048 .6403705 4 7 36 41 972 7737 -.0070548 .1714446 .0240142 -.0279578 11.58077 -.047619 0 0 .0217772 -.0154652 1.549338 4 8 36 41 972 7737 .0034216 .1689215 .0374011 -.0025231 11.52697 .32 0 0 .0176633 .0682661 -.2649158 4 9 36 13 99 6897 .0272316 .2900377 .0582109 .1211162 10.87993 -.06878 0 0 .0082211 -.0132072 -.5547354 4 10 36 13 111 3495 .1029514 .4499124 -.0057540000000000004 .1598747 11.07406 -.003469 1 1 .1383573 -.0457952 -.7486179 4 11 36 13 111 3495 .0144273 .3808011 -.0447544 -.0691113 11.00942 -.352837 1 0 .0206633 .1517413 1.528884 4 12 36 13 111 3495 -.0009282 .0626052 .0585836 .0017908 12.97368 -.017017 0 0 .047575 .065416 1.363458 4 2 36 26 511 9647 -.0559099 .0743905 .0299352 .0117853 12.80239 -.346782 0 0 .0576036 .009505 -1.282878 4 3 36 26 511 9647 .0220422 .0711337 .0034478 -.0032568 12.81442 -.033513 0 0 .0104019 .0240593 -.2815681 4 4 36 26 511 9647 .0314588 .0663933 .0004195 -.0047404 12.87643 1.129031 0 0 .0055396 .093184 -.8405466 4 5 36 26 511 7831 .0784274 .2272722 -.0224015 -.0685942 11.40352 1.629629 1 0 .0477303 .065416 1.363458 4 2 36 26 598 2063 .0816125 .2221261 .0804171 -.0051462 11.48292 1.28169 0 1 .0501518 .009505 -1.282878 4 3 36 26 598 2063 .0716288 .1403622 .0935748 -.0817639 11.49007 .407408 0 0 .0028002 .0240593 -.2815681 4 4 36 26 598 2063 .0695176 .1290386 .083451 -.0113236 11.58 .301121 0 0 .0140677 .093184 -.8405466 4 5 36 26 598 2063 -.2037108 .1999522 .0160174 -.011341 11.22914 -.599419 0 1 .5461316 .065416 1.363458 7 2 36 60 1543 357 .1058622 .0755439 0 .0753033 9.203115 .106383 0 0 .2358375 .065416 1.363458 4 2 36 31 772 10464 .0021949 .0962467 -.1135865 .0207028 9.117348 -.129955 1 1 .1511675 .009505 -1.282878 4 3 36 31 772 7727 -.0274902 .0117322 -.0164481 -.0845145 9.070389 .181818 1 0 .0393171 .0240593 -.2815681 4 4 36 31 772 7727 -.0519889 .04679 -.0195865 .0350578 9.020511 .038462 1 0 .0055606 .093184 -.8405466 4 5 36 31 772 7727 -.0135428 .0356176 -.0315547 -.0111724 8.907071 -.111111 1 0 .0534905 -.0498601 -1.083073 4 6 36 31 772 7727 -.1593174 .0263558 -.1496875 -.0092617 8.685923 -.416667 1 0 .0281793 -.0860048 .6403705 4 7 36 47 1148 2350 -.2441652 .02693 -.3072583 .0005742 8.268476 -.357143 1 1 .012032 -.0154652 1.549338 4 8 36 47 1148 2350 -.0361531 .0115784 -.1377599 -.0153515 8.35043 -.111111 1 0 .0013711 .0682661 -.2649158 4 9 36 47 1148 2350 -.0580165 .005096 -.878479 -.0064824 7.844241 -.5 1 0 .4911667 -.0132072 -.5547354 4 10 36 47 1148 2350 .040482 .1608872 .0536001 .035721 16.60234 .188052 0 1 .0241792 .065416 1.363458 4 2 36 41 982 9938 .0726044 .1444221 .0550506 -.0164651 16.58061 .18456 0 1 .0009202 .009505 -1.282878 4 3 36 41 982 9124 .0750417 .11509 .0590204 -.029332 16.57918 .521389 0 0 .0039438 .0240593 -.2815681 4 4 36 41 982 9124 .0824106 .0934763 .0741401 -.0216138 16.64013 .583241 0 0 .00257 .093184 -.8405466 4 5 36 41 982 9124 .0755755 .0891987 .0529358 -.0042775 16.54569 .044353 0 1 .0317544 -.0498601 -1.083073 4 6 36 41 982 9124 .07801 .0781828 .0721367 -.0110159 16.61251 .061834 0 0 .0037428 -.0860048 .6403705 4 7 36 26 587 695 .1047134 .0688946 .0943723 -.0092882 16.57825 -.16184 0 0 .0162176 -.0154652 1.549338 4 8 36 26 587 695 .0747752 .0564993 .0726011 -.0123953 16.76785 .050392 0 0 .0095634 .0682661 -.2649158 4 9 36 26 587 695 .0863731 .0428093 .0638241 -.01369 16.69507 -.118368 0 0 .0321936 -.0132072 -.5547354 4 10 36 26 587 695 .0795188 .2481998 .0274566 .2053905 16.87966 .203361 0 0 .0467483 -.0457952 -.7486179 4 11 36 26 587 695 .0601606 .2223872 .0290823 -.0258126 16.94033 -.165605 0 0 .007566 .1517413 1.528884 4 12 36 26 511 9651 .1393578 .1446457 .1268685 -.0706592 11.48456 .317887 0 0 .0219816 .009505 -1.282878 4 3 36 60 1461 6875 .1078048 .1569065 .1356748 .0122608 11.62963 .427057 0 0 .0408072 .0240593 -.2815681 4 4 36 60 1461 6875 .1858309 0 .1512184 -.1569065 11.67199 .559942 0 0 .0434563 .093184 -.8405466 4 5 36 60 1461 6875 .1088858 .1310574 .1326734 .1310574 11.96517 .183625 0 0 .0300305 -.0498601 -1.083073 4 6 36 60 1461 2062 .1696394 .0202404 .1477719 -.110817 12.0943 .010257 0 0 .0046208 -.0860048 .6403705 4 7 36 60 1461 2062 .1869385 .0128844 .1543421 -.0073561 12.06597 .323256 0 0 .0433062 -.0154652 1.549338 4 8 36 60 1461 2062 .1407958 .0006233 .125676 -.0122611 12.31501 .201047 0 0 .0385503 .0682661 -.2649158 4 9 36 60 1461 2062 .0748606 .0006159 .0877006 -7.330e-06 12.25989 .08658 0 0 .0077245 -.0132072 -.5547354 4 10 36 41 905 645 .0034562 .1602834 .0208433 .1596675 12.9808 1.117153 0 0 .0636488 -.0457952 -.7486179 4 11 36 41 905 646 .0094554 .196409 -.097648 .0361256 12.80207 .16299 1 0 .0369612 .1517413 1.528884 4 12 36 41 905 646 .0452765 .1503631 .0844552 -.0134607 19.53283 -.142912 0 1 .2714709 .065416 1.363458 4 2 36 26 587 381 .0440307 .1629803 .039383 .0126172 19.48831 .061436 0 1 .0074612 .009505 -1.282878 4 3 36 26 587 381 .0464796 .1572354 .0818088 -.005745 19.48458 -.034097 0 0 .0756328 .0240593 -.2815681 4 4 36 26 587 5254 .0673044 .187365 .0127376 .0301297 19.50478 .134903 0 1 .1319394 .093184 -.8405466 4 5 36 26 587 5254 .0259891 .2238208 .0004042 .0174794 19.53899 -.214606 0 1 .0229357 -.0860048 .6403705 4 7 36 26 587 5254 .0577456 .231281 .0161719 .0074602 19.34412 .459539 0 1 .1114901 -.0154652 1.549338 4 8 36 26 587 5254 .0557517 .2326657 .0311701 .0013847 19.54676 .103778 0 1 .2551058 .0682661 -.2649158 4 9 36 21 373 2626 .0702161 .2638471 .0141992 .0311813 19.4747 .22336 0 0 .0984277 -.0132072 -.5547354 4 10 36 21 373 2626 .0380592 .3131867 -.082118 .0493397 19.32591 -.099222 1 0 .3327343 -.0457952 -.7486179 4 11 36 21 373 2626 .060665 .2499402 .0269096 -.0632465 19.4617 -.39228 0 0 .0231089 .1517413 1.528884 4 12 36 21 373 2625 .0054647 .1189953 .0328632 .0389881 16.02923 .416289 0 1 .0369945 .065416 1.363458 3 2 36 21 373 5243 -.0216361 .170348 .0077298 .0513526 16.00901 -.16095 0 1 .0329327 .009505 -1.282878 3 3 36 21 373 5243 -.0198837 .1988313 -.0062978 .0284834 15.9904 .019129 1 1 .0118631 .0240593 -.2815681 3 4 36 21 373 5243 -.0397426 .2027437 -.0116037 .0039124 15.95317 .19418 1 1 .0415984 .093184 -.8405466 3 5 36 21 373 5243 -.0104864 .2147943 -.0457826 .0120506 15.7421 -.187423 1 1 .0121005 -.0498601 -1.083073 3 6 36 21 373 9636 .0447099 .1663797 .0270627 .0042062 15.64294 .063877 0 0 .0182575 -.0132072 -.5547354 3 10 36 41 982 8338 .0512289 .1408926 .0064695 -.0254871 15.60606 .053501 0 0 .0409223 -.0457952 -.7486179 3 11 36 41 982 8338 .0615635 .1308989 .0300576 -.0099937 15.67938 -.079073 0 0 .0156092 .1517413 1.528884 3 12 36 41 982 8338 .0338472 .1512438 .054128 -.060711 13.206 1.035274 0 1 .0119451 .065416 1.363458 4 2 36 60 1553 7008 .0567888 .1895941 .0654804 .0214229 13.2757 .116226 0 1 .0073896 .0240593 -.2815681 4 4 36 60 1553 7008 -.0013383 .2104207 .0252399 .0208266 13.52407 .388829 0 1 .0161145 .093184 -.8405466 4 5 36 60 1553 7008 .0111742 .2529373 .021599 .0425167 13.41681 -.196662 0 1 .0162538 -.0498601 -1.083073 4 6 36 60 1553 7008 .0940756 .3817084 .1151161 .0150387 17.58207 .166564 0 0 .0275201 .065416 1.363458 4 2 36 60 1543 8294 .0922879 .3968869 .141827 .0151784 17.56877 .371976 0 0 .0166164 .009505 -1.282878 4 3 36 60 1543 8294 .0939132 .4365883 .1474416 .0397014 17.55157 .106125 0 0 .0282214 .0240593 -.2815681 4 4 36 60 1543 8294 .0759685 .4739275 .1209691 .0373393 17.55859 -.0518 0 0 .0362539 .093184 -.8405466 4 5 36 60 1543 8294 .0888465 .5506321 .1388772 .0767046 17.66858 .230947 0 1 .0216522 -.0498601 -1.083073 4 6 36 41 982 6864 .0702331 .4919721 .1170895 -.05866 17.86546 .075376 0 0 .0178217 -.0860048 .6403705 4 7 36 41 982 6864 .0245218 .3465299 .1981699 -.1454422 18.98603 .378253 0 1 .4800966 -.0154652 1.549338 4 8 36 41 982 6864 .0426173 .3172508 .0399196 -.0292791 19.14439 -.059762 0 0 .1042308 .0682661 -.2649158 4 9 36 41 982 6864 .0404373 .3161856 .0397822 -.0010652 19.03079 -.325657 0 0 .0246414 -.0132072 -.5547354 4 10 36 41 982 6864 .0452187 .3148977 .0453765 -.0012879 19.00003 .268243 0 0 .0193907 -.0457952 -.7486179 4 11 36 41 982 5091 .0441692 .3007166 .0492883 -.0141811 19.04448 -.126161 0 0 .0159099 .1517413 1.528884 4 12 36 41 982 8606 .0644749 .2717847 .0451924 -.0342497 15.29821 .282534 0 0 .0315533 .065416 1.363458 5 2 36 41 982 7497 .0506407 .2827068 .0663779 .0109221 15.34906 .200768 0 1 .0120028 .009505 -1.282878 5 3 36 41 982 7325 .0604229 .2921199 .0657423 .009413 15.42125 .334261 0 1 .0080631 .0240593 -.2815681 5 4 36 41 982 7325 .0533808 .2973641 .0644012 .0052442 15.49545 .255953 0 0 .003606 .093184 -.8405466 5 5 36 60 1543 8294 .0529964 .3371745 .0649134 .0398104 15.51482 .321218 0 1 .0066574 -.0498601 -1.083073 5 6 36 60 1543 8294 end