Dear Statalisters,
I have unbalanced panel data in which I ran the following regression:
xtreg return1 sales bmv size, fe robust
I want to estimate the effect of the sales variable using the control firm approach. I am looking to match all firms (gvkey) based on size, bmv and sector for which I want to use the following criteria:
1. An exact match on sector
2. A match on size in which the companies do not deviate more than 20%. That is; the bigger company should not exceed the size of the smaller one with more than 20%.
3. A match on bmv with a maximal difference in bmv of 1.
Ideally, I want to match on all of the criteria above. If this leaves too few cases I want to match for example only on size and sector, or only size.
I am aware of the program vmatch, but I cant figure out how to implement the above. Furthermore, I would like to know how to run a regression after the firms have been matched.
Data:
I have unbalanced panel data in which I ran the following regression:
xtreg return1 sales bmv size, fe robust
I want to estimate the effect of the sales variable using the control firm approach. I am looking to match all firms (gvkey) based on size, bmv and sector for which I want to use the following criteria:
1. An exact match on sector
2. A match on size in which the companies do not deviate more than 20%. That is; the bigger company should not exceed the size of the smaller one with more than 20%.
3. A match on bmv with a maximal difference in bmv of 1.
Ideally, I want to match on all of the criteria above. If this leaves too few cases I want to match for example only on size and sector, or only size.
I am aware of the program vmatch, but I cant figure out how to implement the above. Furthermore, I would like to know how to run a regression after the firms have been matched.
Data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long gvkey double(year sector) float(return1 size sales bmv) 1010 1978 600 6.345826 280.32 6.781209 .8813903 1010 1976 600 -6.699375 299.7015 8.808118 1.0953922 1010 1979 600 53.6258 283.33688 5.879218 .813289 1010 1981 600 2.1186163 313.072 6.537877 .7747696 1010 1982 600 50.55416 263.76563 8.582885 .7027547 1010 1977 600 11.55988 265.26486 7.374261 .9017768 1034 1990 905 29.85151 291.04175 20.55946 2.6216435 1034 1993 905 36.55426 344.96 40.02413 1.8663535 1036 1996 925 29.658934 1104.5775 11.46314 1.3449283 1036 1995 925 1.4802907 1095.906 14.481897 1.7737268 1036 1999 925 16.87666 711.5314 8.134807 .7740389 1040 1982 976 -13.743507 381.3062 30.71273 .9000438 1040 1977 976 6.278054 322.8062 7.531488 .9499554 1040 1980 976 -31.605017 590.03314 10.405457 1.3220668 1040 1979 976 81.03148 252.5861 4.786434 .6126553 1075 2001 700 -26.151974 3845.9976 12.320755 1.5388157 1075 1997 700 -17.095808 3768.613 16.097134 1.8588073 1075 1974 700 30.650696 231.625 6.599003 .7669473 1075 1972 700 -6.13595 216.5625 9.00655 1.0318102 1075 1985 700 12.18468 2279.43 7.901998 1.2089298 1075 2006 700 -26.751545 4830.549 14.68854 1.401737 1075 1999 700 52.29184 2388.3833 14.220503 1.0828071 1075 1976 700 16.97484 424.9895 7.647134 .915117 1075 2002 700 21.73949 3033.283 18.886158 1.1292294 1075 1983 700 37.957085 1214.64 5.262281 .7655273 1075 1986 700 -2.9878926 2571.548 10.563104 1.242687 1075 1981 700 27.329445 1201.8815 6.395172 .9421918 1075 2007 700 -21.53413 3525.049 11.464052 .9981419 1075 1982 700 -19.257174 1541.67 7.427938 1.0686457 1075 1998 700 -21.78406 3085.4365 12.673917 1.4262302 1075 1980 700 35.081047 797.9834 6.068846 .7595133 1075 1979 700 20.62846 645.4715 5.829506 .7430674 1075 2004 700 -3.845828 4180.8584 17.12278 1.417146 1075 1987 700 -52.68477 2363.229 8.07476 1.0313256 1075 2005 700 25.58473 3878.603 21.39632 1.1324507 1075 1977 700 9.67778 542.0769 6.754051 .9343415 1075 1973 700 -19.913095 228.125 6.939164 .8799455 1075 2003 700 12.215794 3594.9766 14.916895 1.270409 1075 1978 700 -19.900465 669.3187 6.48266 .9052812 1075 2000 700 2.4303315 3886.703 12.834804 1.6312082 1075 1984 700 37.643986 1616.9423 7.072704 .9534296 1076 2003 976 20.556307 823.1372 22.42392 2.5708096 1076 2007 976 21.12721 1146.8973 14.455772 1.703195 1076 2004 976 32.44091 995.46 18.872475 2.6533005 1076 2005 976 -1.7322134 1371.7046 23.637316 3.1571834 1076 2002 976 52.77767 442.5517 15.557252 1.5774714 1076 2006 976 -23.15816 1432.3606 17.638062 2.359679 1078 1976 905 26.339006 1283.337 13.35397 2.2327292 1078 2004 905 -6.905262 72292.56 22.3868 5.046325 1078 1984 905 51.11526 6367.579 15.856254 3.9730325 end
Comment