Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Propensity Score Matching (PSM) to match firms in a specific year

    Dear Statalist,

    I have a panel dataset of firms going from 2008 to 2018. The dataset is made up of: firms supported by a Venture Capitalist (VC), unsupported firms. I would like to use the nearest-neighbour propensity score matching (PSM) method to match each VC-financed firm to 10 non-VC-financed firms at the time of getting VC funding based on some firms characteristics.
    Unfortunately, I am not sure about how to proceed.

    STATA commands "teffects" and "psmatch2" require an outcome variable, but I don't want to compare outcomes, I just want to perform the matching according to the year each VC-financed firm received support by a Venture Capitalist.
    I would be extremely grateful if you could give me some advice on how to proceed.

    Thanks in advance

  • #2
    One option is as so:

    Code:
    ssc install kmatch, replace
    gen newid = _n
    kmatch ps (treatvar) var1 var2 var3, generate replace nn(10) wor idgenerate
    list newid _KM_nc _ID_*
    Stata will create 10 new variables, telling you for each observation the ID of the matched case from the other treatment group.
    Best wishes

    (Stata 16.1 MP)

    Comment


    • #3
      Dear Felix Bittmann
      I have a similar question. For a canonical type DiD analysis, I have a treated and control group. I would like to make them comparable based on some covariates like size, leverage, profitability etc. My intention is to make the treatment group and control group otherwise equal atleast in these parameters. Following are the additional details.
      I have an unbalanced panel data set of firms. Time dummy equals 0 for 2012-16 ( no treatment) and 1 for 2017-19 ( treatment continued thereafter). Control firms have value 0 during the entire period while treated firms have value 1 in 2017-19. Matching should be done on the basis of Size, Profitability etc. It will be better if matching variables are chosen based on the values prior to treatment period.
      How to Code it via Kmatch

      Comment


      • #4
        Dear Stata Members



        Code:
        * Example generated by -dataex-. For more info, type help dataex
        clear
        input long code byte indu int year byte ff48 float(nppe_ta_w size_w lever_w roa_w)
           11  8 2011 28   .3451234  7.692159    .5504084     .10090822
           11  8 2012 28  .29354736  7.931967    .5697871     .11795756
           11  8 2013 28   .4899267  8.025386    .5391156      .1133896
           11  8 2014 28   .4550365  8.138857   .51597077    .063941605
           11  8 2015 28  .42844895  8.160204    .4759782    .068335764
           11  8 2016 28   .4218914  8.169874    .4625662     .10710748
           11  8 2017 28   .4503756  8.268808   .39045715     .12117016
           11  8 2018 28  .45255655  8.310906   .33070305     .12551622
           11  8 2019 28   .4434838  8.385649    .2839154     .13766909
          289 52 2011 40   .3158847  7.413488   .54094803      .0958268
          289 52 2012 40    .425365  7.465369    .5555683       .114572
          289 52 2013 40   .4299606  7.327781   .51333773      .1304862
          289 52 2014 40   .3889136  7.207416   .48577145     .06862309
          363 77 2011 34   .6755958  9.358657    .4761355     .03834879
          363 77 2012 34   .6276743  9.282261    .4731195      .0378477
          363 77 2013 34   .5426359  9.338382   .53195494    -.01265177
          363 77 2014 34   .4036047  9.323365    .4994195   -.025775684
          363 77 2015 34    .349384   9.20133   .51551414   .0042178337
          363 77 2016 34     .47962   9.21132    .5284721   .0019181203
          363 77 2017 34   .4654458  9.158089    .5849603    -.01886017
          363 77 2018 34   .2198459  9.171402    .4416465   -.010085152
          363 77 2019 34  .20597345   9.14435     .689352   -.010190783
          414 46 2016 41  .03726708  6.180017    .4542443     .02836439
          414 46 2017 41   .0480226  5.964607  .006420134    .030559836
          414 46 2018 41  .05113108  5.776723  .005577936   .0021691972
          415 62 2018 34   .2330087  7.591811           .      .0970281
          415 62 2019 34  .24387904  7.536204           .     .11815224
          771 71 2013 34  .29406333  6.630683    .4651715     .15976253
          771 71 2014 34  .24340977  6.897806    .5203515     .15937784
          771 71 2015 34   .2141985  7.113387     .461695      .1453228
          771 71 2016 34  .15930188  7.495042    .5473848     .11772554
          771 71 2017 34  .12169435  7.675732    .5459776     .10090934
          771 71 2018 34  .11059617  7.772121    .4951338     .09138403
          771 71 2019 34  .10220815  7.871731    .4645513      .0856184
          783 10 2011  2  .25982013  7.452112   .19831736     .10310414
          783 10 2012  2  .24346343  7.504777    .2092255    .073980294
          783 10 2013  2   .1896934  7.699978   .19775394     .11094507
          783 10 2014  2  .18619993  7.688272   .13007422     .04769541
          783 10 2015  2  .24750434  7.688822   .08677534     .06154409
          783 10 2016  2  .22629647  7.686621  .033318035     .05603488
          783 10 2017  2  .22433777  7.672339  .025697127     .08342256
          783 10 2018  2   .2284505  7.673084  .014560171      .1543471
          783 10 2019  2   .2313115  7.622028 .0009790963      .1930778
         1120 24 2011 19   .2067098   9.46848  .016338103      .1937861
         1120 24 2012 19  .22745897   9.61161  .032134537     .21221513
         1120 24 2013 19   .1946061  9.826855   .08688986     .20303813
         1120 24 2014 19   .1633293 10.014935   .05394961     .24262565
         1120 24 2015 19   .2076624  10.14689   .03865692     .23954985
         1120 24 2016 19  .23243997 10.239388   .06567325      .2324757
         1120 24 2017 19  .20205106  10.37602     .043705     .20899287
         1120 24 2018 19  .18189026 10.482662   .03458266     .17053455
         1120 24 2019 19   .2030323 10.609154  .031668555      .1783137
         2248 13 2017 16   .4664207  7.934478    .1482503       .091658
         2248 13 2018 16   .4828343   8.00933   .15626974     .07388082
         2717 61 2011 32   .5158676 10.212482    .3987688   -.014169766
         2717 61 2012 32   .5372157 10.179546    .5396248     .02432991
         2717 61 2013 32   .4523312 10.359493     .521483     .01978121
         2717 61 2014 32   .4870189 10.229534    .5139446   -.008953576
         2717 61 2015 32   .4551124  10.36415    .4747386      .0576516
         2717 61 2016 32   .4537038 10.589538   .31001255     .12544973
         2717 61 2017 32   .4684093 10.676764   .26234335     .07815935
         2717 61 2018 32   .2361021  11.94411    .2209677     .01950191
         2717 61 2019 32  .22883637 11.893708   .19191967    -.06257286
         2842 62 2011 34  .09140518  6.491785   .24950735     .15749583
         2842 62 2012 34  .08590434  6.770675    .3842184      .2050694
         2842 62 2013 34   .0832793  6.984253    .3622974      .1699861
         2842 62 2014 34   .0765293  7.066552    .3780394     .13710435
         2842 62 2015 34  .07563667  7.071573    .3651952     .12173174
         2842 62 2016 34  .08096717  6.804171   .19154836     .18334074
         2842 62 2017 34  .09775044  6.426327  .012137886     .09062955
         2842 62 2018 34  .07905366  6.541318   .11468551     .04327755
         2842 62 2019 34   .0624494  6.762383    .1701168     .11229328
         3335 23 2011 17   .2621498  7.243656    .3992996      .1570183
         3335 23 2012 17   .1961064  7.581821    .1974824       .368398
         3335 23 2013 17   .1971979  7.733684   .15542907      .3556042
         3335 23 2014 17   .2117583  7.778254   .02286336       .304803
         3335 23 2015 17  .22432104  7.775822  .028543843     .19338454
         3335 23 2016 17  .23201247  7.826403   .03890818     .13767509
         3335 23 2017 17   .2071913  7.927613   .05525101     .14440277
         3335 23 2018 17  .16878895  8.108293   .10858244      .1155062
         3335 23 2019 17  .25074002 8.2735405    .2077677      .0957691
         3990 21 2011 13   .4358847  8.563141    .5109358       .096044
         3990 21 2015 13   .4448767  9.215437    .4456229     .14279035
         3990 21 2016 13    .441005  9.308274   .43831205     .12991323
         3990 21 2017 13   .4827797  9.385167    .4056455     .13271594
         3990 21 2018 13   .4300584   9.53976    .3955588     .11716638
         3990 21 2019 13    .427183  9.585972    .3502277     .12061872
         3998 20 2011 14  .28901437  9.546169   .37776425     .10875563
         3998 20 2012 14   .2645878  9.717851    .3780212      .1191524
         3998 20 2013 14  .30952805  9.987824   .39086115     .12962835
         3998 20 2014 14   .3094044 10.192468    .3920296       .121657
         3998 20 2015 14   .3290353  10.28826     .409129     .13420519
         3998 20 2016 14   .4198247 10.297828    .4354037      .1545195
         3998 20 2017 14   .4841216 10.463384    .4468606     .15216595
         3998 20 2018 14   .4545583     10.69    .4743695     .12766854
         3998 20 2019 14  .36622944 10.978138    .4099103     .13768663
         4024 13 2018 16    .393684  9.126492    .4125189     .05419924
         4024 13 2019 16   .4029671  9.173573    .4504824     .05360515
         4030 78 2016 34  .14157945   6.26435   .17944816     .08163654
         4030 78 2017 34    .085012  6.726233    .1738609     .10695443
         4030 78 2018 34  .06227568  6.938188   .03812203     .10873993
         4030 78 2019 34  .11335882  6.977934   .07597651     .10729934
         4253 43 2011 18   .5575733 11.989892    .8300624     .08966845
         4253 43 2012 18  .57819426 12.068917     .794663      .0825592
         4253 43 2013 18  .56922567 12.117258     .762911     .08882914
         4253 43 2014 18  .55584306 12.218475    .7336145     .08826692
         4253 43 2015 18  .53919816 12.267224     .674849     .08823538
         4253 43 2016 18   .7835729  12.23711    .7137975     .04958387
         4253 43 2017 18   .7873657 12.140344    .7916883    .012857425
         4253 43 2018 18   .7873657 12.039883    .9276171    -.07298748
         4253 43 2019 18   .7873657  11.82667    1.276667     -.2981199
         4671 11 2016  4  .26672852 10.181612    .3638019     .07683717
         4671 11 2017  4  .27678385 10.113408     .324754     .07682113
         4671 11 2018  4  .28023773  10.07854   .24909975      .1073944
         4671 11 2019  4   .3019211 10.048293    .1459749     .13984504
         4709 13 2012 16   .6243214  10.44225    .6662203     .05153205
         4709 13 2013 16   .5741598 10.439264    .6553847      .1098477
         4709 13 2014 16  .53494626 10.418832    .5561621     .14490971
         4709 13 2015 16   .6034432  10.76657   .54422885     .08565022
         4709 13 2016 16   .6715156  11.14619    .5054402     .06218253
         4709 13 2017 16   .6700959 11.071162    .4432106     .09006816
         4709 13 2018 16   .6121173  11.04983    .4445682      .0831024
         4709 13 2019 16   .5926768 11.034452    .3930347     .12078344
         5003 62 2011 34 .033950724  7.997966   .10918014    .067161925
         5003 62 2012 34  .06476504  8.149081   .29134154     .07467777
         5003 62 2013 34  .06723971  8.190493    .3004852     .06651878
         5003 62 2014 34  .06458065   8.24273    .4097476     .08250217
         5003 62 2015 34  .05246822  8.456126    .4219355     .05078873
         5003 62 2016 34  .04491449  8.210152    .5785052    -.29749054
         5003 62 2017 34  .03372275  8.331225    .6178731    .034686256
         5003 62 2018 34 .022257343  8.018691    .6006519     .14720796
         5003 62 2019 34  .01299266  8.271267    .4547431     .05805775
         5284 62 2011 34  .17273796  5.136974  .018213866     .02467685
         5284 62 2012 34  .16281755  5.154447  .009815243     .03117783
         5284 62 2013 34   .1646517   5.15733   .01208981    .025906736
         5284 62 2014 34   .1553238  5.205105  .002744237     .04610318
         5284 62 2015 34  .12738526  5.267343           .     .02784941
         5284 62 2016 34   .2207538   5.31959  .002447381      .0597161
         5284 62 2017 34   .1927176  5.416989           .     .05550622
         5284 62 2018 34   .1716542  5.483136           .      .0482128
         5284 62 2019 34   .3334598  5.574433  .013277693   -.004172989
         5574 23 2011 17  .34627405   6.41001    .3480836     .13916762
         5574 23 2012 17   .4456995  6.429235    .3784089      .0771341
         5574 23 2013 17   .4030058  6.674309   .39252335     .12717858
         5574 23 2014 17   .3521859  6.888878    .3991644     .15459085
         5574 23 2015 17  .27024108  7.300406    .4926058     .14126544
         5574 23 2016 17  .22484528  7.602701   .33564585     .13390896
         5574 23 2017 17   .3098954   7.78705    .3323925     .09812386
         5574 23 2018 17   .3253619  7.893721    .3418147     .09282197
         5574 23 2019 17  .31440115  8.004666    .3234833     .11886875
         5747 46 2011 41  .26642716   13.3713    .5204021      .0609258
         5747 46 2012 41   .3298945  13.58085    .6293864     .04147627
         5747 46 2013 41   .4137909  13.58085    .6302891     .05309255
         5747 46 2014 41  .56066585  13.58085    .5998325       .066799
         5747 46 2015 41   .6034054  13.58085    .6428508     .07951077
         5747 46 2016 41   .1681758  12.94253    .4589231     .06242315
         5747 46 2017 41   .2149724  13.07622     .436603     .05068887
         5747 46 2018 41  .12631397  13.24635    .3116025    .032485515
         5747 46 2019 41  .13326196 12.974212   .26978314      .0590857
         5757 34 2011 49   .2480412 12.773135    .6948834     .03051762
         5757 34 2012 49   .3074789 13.149864    .7510648    .019892944
         5757 34 2013 49   .5316219 13.212224    .7640706 -.00012796817
         5757 34 2014 49   .7447475  13.34137    .7093325      .0448672
         5757 34 2015 49   .7033976 13.370268    .6998872     .06378083
         5757 34 2016 49   .6821414  13.58085    .6356643      .0761938
         5757 34 2017 49    .685263  13.58085    .6636555  -.0045335456
         5757 34 2018 49   .6905315  13.53073    .7051849      .0479481
         5757 34 2019 49   .6737728 13.521702    .6302482      .0691269
         5838 46 2017 41          . 4.4485164    .1730994     .03976608
         5838 46 2018 41          . 4.5053496   .12154696      .1005525
         5838 46 2019 41          .  4.670021   .29709467    .025304593
         6584 27 2014 22  .17262547   7.09465           .      .1630029
         6584 27 2015 22  .16551033  7.167964           .     .15402406
         6584 27 2016 22   .1776915  7.199977  .006420786     .11841123
         6584 27 2017 22   .1644127  7.182504   .01701869     .08053488
         6584 27 2018 22  .15523933  7.180907    .0165893     .08477285
         6584 27 2019 22  .13423495  7.237131   .02165312     .12344436
         6585 20 2016 14      .1744  4.241327       .3712        -.1568
         6585 20 2017 14   .5141463  4.629863    .2507317     .08390244
         6585 20 2018 14  .20352563  4.241327    .0801282    -.11698718
         6585 20 2019 14  .25114155  4.472781    .0673516    -.14726028
         6819 20 2011 14  .33186385   7.34116    .4224311     .13970827
         6819 20 2013 14  .29120478 8.2886095    .4634391       .218435
         6819 20 2014 14  .28286982  8.309677   .41481665     .10354418
         6819 20 2015 14   .2663119 8.3361025    .2757323     .20197517
         6819 20 2016 14  .25299764  8.416311   .22421573       .280961
         6819 20 2017 14  .26018798  8.670841   .09270376      .2431051
         6819 20 2018 14   .2271315  8.900767   .09099706     .20189163
         6819 20 2019 14   .1990771  9.002886   .04310589     .20712483
         6923 27 2013 22   .3040631  7.890882  .036216702     .09514367
         6923 27 2014 22  .24103117  8.055095   .05898787    .020540986
         6923 27 2015 22   .3023336  8.065862  .001538993     .15568957
         6923 27 2016 22  .26598364  8.226359 .0007068081      .0892943
         6923 27 2017 22   .2221029  8.340551   .08505154     .07252291
         6923 27 2018 22   .2017585  8.449856   .17396885    .072929144
         6923 27 2019 22  .22542557  8.458992   .13776949      .0976406
         7068 52 2011 40   .4061304  8.614955    .2255373     .13631994
         7068 52 2012 40  .07452057 10.295435    .7127093     .04838296
         7068 52 2013 40   .2761831  9.219914    .3287078     .11260673
         7068 52 2014 40   .4603901  9.095569     .270276     .10822482
         7068 52 2015 40  .46644855  9.149942   .23166804     .17148046
         7068 52 2016 40   .5058107  9.109823    .2082776      .1925871
         7068 52 2017 40   .3665709  9.921451   .14068018     .09104481
         7068 52 2018 40  .57788414 10.005457    .1372827     .10914797
         7068 52 2019 40   .5419554  10.10545    .0975527     .13422127
         7077 13 2011 16   .3433261  6.925005   .10389227     .24218595
         7077 13 2012 16  .41385415  6.742173  .017583195      .1191881
         7077 13 2013 16   .3831972  6.861292     .084119     .15252464
         7077 13 2014 16   .3787669  6.916517    .0899088     .07266059
         7077 13 2015 16  .25454545  7.098376    .1970248   -.017272728
         7077 13 2016 16  .20603964  7.148031    .3171595     .09334696
         7077 13 2017 16   .5800278  7.804007   .18523507     .05301175
         7077 13 2018 16   .5597058   7.86722   .24368845    .027468106
         7633 32 2013  9  .27874687  8.865015   .09921045     .05271261
         7633 32 2014  9  .22930136  8.982875   .15525705     .05777415
         7633 32 2015  9  .17021276  9.233266    .1780412      .0749714
         7633 32 2016  9  .16778368  9.240899   .22957626     .07213175
         7633 32 2017  9  .14916554  9.313348    .5346775     .05778078
         7633 32 2018  9   .1963312  8.995661    .4951785     .06358453
         7633 32 2019  9  .15390864 9.1949625   .58521026     .06571277
         8183 10 2011  2    .123459  7.942611           .     .16897005
         8183 10 2012  2  .15354125   7.96419           .     .17822744
         8183 10 2013  2  .14628233  8.113966           .     .18256107
         8183 10 2014  2  .23652928  8.256556   .03893272      .1538102
         8183 10 2015  2  .27865493  8.376735   .05951943      .1090269
         8183 10 2016  2  .28920108 8.5515175    .1848452     .07919452
         8183 10 2017  2   .3979338   8.35679   .04137121     .11242075
         8183 10 2018  2    .375936  8.411943           .      .1092323
         8183 10 2019  2   .3279054 8.4857645           .     .10783646
         8312 42 2011 18  .17171596   9.35725    .1763868      .1143881
         8312 42 2012 18  .16444176  9.371251   .21140324   -.014805292
         8312 42 2013 18  .14606898  9.286829   .25428674    -.03164457
         8312 42 2014 18   .1267885  9.262895    .2266215     .05734563
         8312 42 2015 18  .11423653  9.254884   .16589355     .10020563
         8312 42 2016 18  .09990086  9.358717    .1230484     .13222983
         8312 42 2017 18   .0845092   9.42563  .072696775     .12721936
         8312 42 2018 18  .07656267  9.444258   .02358453     .15811925
         8312 42 2019 18 .066213675  9.614592   .04078949     .13307479
         8523 20 2014  9 .069193006  6.479738  .024087144     .07732434
         8523 20 2015  9  .08976526  6.277583  .025539907     .09577465
         8523 20 2016  9 .066438355  6.369901 .0007068081      .0943493
         8523 20 2017  9  .11340863  6.443654  .012088436      .1894385
         8523 20 2018  9  .18780713  6.623932  .017797846     .11316243
         8523 20 2019  9   .1493418  7.004428  .007172038     .10649115
         8628 63 2017 34          .  6.227327   .25019747     .08767773
         8628 63 2018 34  .56679064  6.902642    .1524776     .09367775
         8628 63 2019 34   .5686779  6.878532   .11357084     .06960461
         8893 21 2011 13   .4024749  8.575688    .3596167     .14142081
         8893 21 2012 13   .3564017  8.780373   .30688825     .17897716
         8893 21 2013 13   .3648074  8.880307    .1736542     .27249965
         8893 21 2014 13  .29155213  9.158489   .13743457      .3571782
         8893 21 2015 13  .24718437  9.348405   .06304603       .368398
         8893 21 2016 13   .2980761  9.615505   .06197859       .368398
         8893 21 2017 13   .3127501  9.833398  .003652219      .3549624
         8893 21 2018 13   .4222405 10.116738  .001664384     .25282884
         8893 21 2019 13   .3906587 10.300138   .01824345     .17557766
         9395 46 2011 41  .05111475  8.238959   .11527894     .09433115
         9395 46 2012 41   .2571288 8.6090975    .3116961     .10501158
         9395 46 2013 41  .19746792  8.834031    .3572313     .11172949
         9395 46 2014 41  .26023173  9.077061     .457702     .13031009
         9395 46 2015 41  .21505913  9.127795   .36436895     .09032658
         9395 46 2016 41  .25837252  8.816601    .3786785     .07894386
         9395 46 2017 41  .17021357  9.264687    .3189563     .05346403
         9395 46 2018 41  .05690428  9.218665    .3941053      .0534928
         9395 46 2019 41  .04001473  9.069848    .3029013    -.01445456
         9505 42 2016 18          .  6.552936     .152146     .09168687
         9505 42 2017 18  .12531224  6.867766   .06109492     .08024563
         9505 42 2018 18  .10190892  7.193385    .1964527     .04268751
         9505 42 2019 18  .07547297  7.303372     .163536     .03447115
         9793 27 2011 22  .25910693   8.50427   .21299487    -.04080392
         9793 27 2012 22   .2187088   8.57731    .2090286      .0490979
         9793 27 2013 22  .17818294  8.608714   .16243246     .05391298
         9793 27 2014 22   .1556313  8.667095   .22626795     .04951279
         9793 27 2015 22  .17787054 8.7782955    .2123294      .0562864
         9793 27 2016 22   .1507736  8.815014   .15408486       .069774
         9793 27 2017 22   .1498146   8.94361    .1957748     .04270904
         9793 27 2018 22  .25802383  9.160341    .2839797      .0553599
         9793 27 2019 22  .23870453  9.225455    .3059011     .05852861
        10714 27 2011 22   .3999125  6.124902    .3242179    .037190985
        10714 27 2012 22   .4100446  6.104793    .3694196     .01361607
        10714 27 2013 22   .4615182  5.938591    .3186611    -.02978387
        10714 27 2014 22   .4776339  5.828357   .22189525     .06121248
        10714 27 2015 22  .42298645  5.829534    .1945914    .020870075
        10714 27 2016 22   .3957268  5.806038   .27926573     .03551008
        10714 27 2017 22   .5967621  6.275139    .1778991    -.01618976
        10714 27 2018 22   .4623206  6.505485   .11722489   -.012260766
        10714 27 2019 22   .4818109  6.444926   .11691818    .007783956
        10735 46 2018 41  .01147052  6.077413   .56434965     .04588208
        10735 46 2019 41 .007799805  6.422273    .4761131     .03818654
        10867 13 2018 16 .005804029  5.679831    .0938887    .002389894
        10867 13 2019 16 .002844372  5.505738    .1117432     -.1056481
        10884 21 2015 13  .18231797 10.884612   .24478763     .10122007
        10884 21 2016 13   .1856919 10.924565    .1184179     .18285525
        10884 21 2017 13   .2083274 11.111485    .0985217      .1514279
        10884 21 2018 13  .23392244 11.290808   .12456716     .12606187
        10884 21 2019 13  .24438003 11.363976   .10957008     .11876795
        10903 20 2011 14   .3549336  7.921028    .4359254      .0897045
        10903 20 2012 14   .4041751  8.013906    .4086082     .13074404
        10903 20 2013 14   .3397412  8.218517    .3936641      .1340523
        10903 20 2014 14   .3510908  8.384233    .3441462     .17770417
        end
        
        
        
        ** generating time dummy
        gen tim_dum=.
        replace tim_dum=0 if year<2017
        replace tim_dum=1 if year>2016
        
        **generating treatment dummy
        * Following literature, I create treatment dummy as dividing the sample into three terciles (top 33%, middle 33%, and the bottom 33%), based on firms' average pretreatment measure (2011 to 2016) of asset tangibility (nppe_ta_w) – , where the highest tercile is our treated group and the lowest tercile is our control group.
        bysort code (year): egen mean_nppe=mean(nppe_ta_w) if inrange(year,2011,2016)
        bysort code (year): egen max_mean_nppe=max(nppe_ta_w)
        xtile tercile=max_mean_nppe, nq(3)
        gen treat_dum=1 if tercile==3    // high nppe_ta_w group 
        replace treat_dum=0 if tercile==1
        tabstat nppe_ta_w, by(treat_dum)

        **Related to Matching
        * I would like to make the treatment group (treat_dum==1) and control group (treat_dum==0) comparable in terms of variables like roa_w, size_w lever_w etc. For instance, using a nearest-neighbor algorithm for a set of firm characteristics within year and ind (Industry). Three years prior to policy enactment (2014,2015,2016), each of the firms in the treatment group is matched to a firm that is observationally similar in terms of roa_w, size_w, and lever_w etc

        Have I made myself clear? Can someone help me???

        Comment


        • #5
          I am not sure how you plan to handle multiple years. Assuming that you want to match each treatment firm to one or more controls is fine in a single year. But what about the other years? I am not sure what the literature says about matching in longitudinal data. What I have used is choose a single year, then match, and then use the matched firms and their panels. For example, match in 2010 and then compare the following years (say, 2011 to 2020) using panel methods. You can also generate matching weights instead of 1:1 matches, which seems better to me regarding the panel structure.
          Best wishes

          (Stata 16.1 MP)

          Comment


          • #6
            Dear Felix Bittmann. I think I understood what you are saying. So in my case, there is pre-treatment years (2011-16) and post treatment period (2017-19). Only one group gets treated in the post treatment years. Now what you say is that matching each treatment firms to one or more control groups based on certain covariates can only be done based on a single year in the window 2011-16, right? Let us say 2014. I don't have 2010 data now, hence I use a year in the pre-treatment period, is that okay? Now rather than matching 1 to 1, I have 1 to n matching, which is fine. In that case, can you assist me in guiding in such matching based on sample data at #4

            what the literature says about matching in longitudinal data
            In the language of the matching literature surveyed by Imbens and Wooldridge (2009), we use a caliper-based nearest-neighbor match adapted to a panel setting. Starting in 2002, for each public firm, we find the private firm closest in size in the same four-digit NAICS industry, requiring that the ratio of their total assets (TA) is less than two (i.e., max(TApublic, TAprivate) / min(TApublic, TAprivate) <2).10 If no match can be found, we discard the observation and look for a match in the following year. Once a match is formed, it is kept in subsequent years to ensure the panel structure remains intact. This allows us to estimate within-firm investment regressions. We match with replacement, though our results are not sensitive to this. If a matched private firm exits the panel, a new match is spliced in. The resulting matched sample contains 11,372 public-firm years and an equal number of private-firm years. As we match with replacement, the sample contains 2,595 public firms and 1,476 private firms

            Source :Corporate Investment and Stock Market Listing: A Puzzle
            Last edited by Neelakanda Krishna; 21 Sep 2021, 04:06. Reason: Found a literature on panel matching

            Comment


            • #7
              I think the way to go is then via weights, for example (indu is your id, right? Not sure here):

              Code:
              ssc install kmatch, replace
              kmatch ps treatvar control1 control2 control3 if year == 2014, wgen(temp)
              bysort id: egen w = max(temp)
              reg outcome treatvar [pweight=w] if inrange(year, 2017, 2019), vce(cluster id)
              This is the general template I could imagine. Of course, this is just a simple start. You need to check how well the matching performs and so on. Have a look at the relevant literature.
              Best wishes

              (Stata 16.1 MP)

              Comment


              • #8
                Thanks a lot Felix Bittmann. Indu means (Industry) in which firms are grouped. I think in my context id must be firm as I am matching firms with one another. Thanks for taking the time and effort for helping me.

                Comment

                Working...
                X