Announcement

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

  • Cem for panel

    Hi Statlist,

    I would like to perform CEM (coarsened exact matching) on the following panel:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double(idfirm Year) float(recalled_dummy_byfirm agefirm inflow_ratio) double tot_sales
     1 2008 0  0          . 211591.55354704778
     1 2009 0  1          0  308746.0587639413
     1 2010 0  2        .25  407237.1453954251
     1 2011 0  3         .4  598549.0481277383
     1 2012 0  4   .2857143  664061.6305459269
     1 2013 0  5   .5555556    608140.67505112
     1 2014 0  6   .3571429  715163.0758130773
     1 2015 0  7          0  768412.7578732732
     2 2004 0 29          .  12237352.38962967
     2 2005 0 30          0 11513177.507807251
     2 2006 0 31          0 12304011.532418355
     2 2007 0 32          0 11406777.403632266
     2 2008 0 33  .16666667 12355367.684264863
     2 2009 0 34          0 12892224.398947667
     2 2010 0 35          0 10897763.444727022
     2 2011 0 36          0  10580189.86100467
     2 2012 0 37          0 10967562.283051893
     2 2013 0 38          0  9124157.813647183
     2 2014 0 39          0  7133930.997182059
     2 2015 0 40          0  5427924.711631365
     3 2004 0  9          . 2464566.2638161103
     3 2005 1 10  .23913044   4406664.46751826
     3 2006 0 11          0  1843225.499704768
     3 2007 0 12          0  476002.8259390887
     3 2008 0 13          0  160865.5648153848
     3 2009 0 14          0   82650.9899064962
     3 2010 0 15   .3030303 126687.58501765266
     3 2011 0 16          0  35362.49685707843
     3 2012 0 17          0 16035.562916347304
     3 2013 1 18      .1875 22272.424034809985
     3 2014 0 19          0  21090.64112449751
     3 2015 0 20          0  23837.82400447101
     4 2004 1  4          .  8398246.263306491
     4 2005 0  5  .03947368  8251045.135936161
     4 2006 1  6   .0949367  9847010.316997783
     4 2007 1  7   .2485549 13503137.133153718
     4 2008 1  8   .1712963 13768126.595234673
     4 2009 0  9  .07509881  13834060.86932386
     4 2010 0 10 .025735294 12531817.194234656
     4 2011 1 11 .014336918 12433251.178176137
     4 2012 0 12  .03180212 11206517.411851741
     4 2013 1 13  .05821918 14594676.742348071
     4 2014 0 14  .05825243 26481277.906628065
     4 2015 0 15          0  29946995.67406721
     5 2007 0  0          .   39.4415442669969
     6 2004 0 29          .  28066686.19154623
     6 2005 0 30          0  5704381.338495776
     6 2006 0 31          0 496491.87314146105
     6 2007 0 32          0  9421.785319502253
     6 2008 0 33          0  394.3420099042942
     6 2009 0 34          0 1380.2071011962253
     7 2007 0  0          .  35459.78814655074
     7 2008 0  1          0  42076.49109553711
     7 2009 0  2          0   381988.536163157
     7 2010 0  3          0  451015.3511721381
     7 2011 0  4          0 270585.60116440145
     7 2012 0  5          0 329557.26253078564
     7 2013 0  6          0  305000.4474947418
     7 2014 0  7          0 173465.68589452517
     7 2015 0  8          0  31625.55690904084
     8 2004 0 43          .  1499855855.865098
     8 2005 1 44          0 1689540069.7170644
     8 2006 0 45          0  1598121054.119387
     8 2007 0 46          0  1656992400.409758
     8 2008 0 47          0   2142910992.52344
     8 2009 0 48          0 2201020370.9059067
     8 2010 0 49          0  2181284539.324025
     8 2011 1 50 .024390243 2029940306.3960855
     8 2012 0 51  .11904762 2225894374.1270456
     8 2013 0 52  .05319149  2727305730.021949
     8 2014 0 53          0 2359259573.3842134
     8 2015 0 54          0  2370530389.480409
     9 2004 0 41          .   9917874207.75519
     9 2005 0 42          0 10607521709.816193
     9 2006 0 43          0 11125455014.939121
     9 2007 0 44          0 10999908825.891459
     9 2008 0 45      .0625 11020835162.138296
     9 2009 0 46          0 11052308521.725805
     9 2010 0 47          0 11844314656.874342
     9 2011 0 48          0  12248782762.78322
     9 2012 0 49          0 12198970579.756456
     9 2013 0 50          0 11978041077.652853
     9 2014 0 51         .1 13100594403.908373
     9 2015 0 52  .03030303 16695333854.076557
    10 2004 0  1          . 20392.013641854945
    11 2008 0  0          . 1020956.3147491836
    11 2009 0  1          0  2431036.790986024
    11 2010 0  2          0  514778.3255435499
    11 2011 0  3          0  66955.82008718849
    11 2012 0  4          0 1857.2792628005145
    11 2013 0  5          0  57300.58370722538
    11 2014 0  6          0  31166.09542619379
    12 2012 0  0          . 1399.3437130821144
    12 2013 0  1          0 46875.852646417305
    12 2014 0  2          0  92413.03425338621
    12 2015 0  3          0 120786.41920184325
    13 2004 0  2          . 3551802.0606248565
    13 2005 0  3          0  5632204.502071029
    13 2006 0  4          1 6445605.7851592805
    13 2007 0  5          0  5607216.736637451
    end
    The treatment variable is recalled_dummy.
    It has been suggested first to reduce the panel into wide form and then apply cem command on the wide form, but in wide form, the treatment will also be reshaped...
    Can someone please help me on this?

    Many thanks,

    Federico
Working...
X