Howdy, Statalisters,
I'm trying to create comparison groups to ultimately move into a diff-in-diff evaluating policy effect.
I can't figure out how to appropriately do PSM for panel data and get conflicting advice based on what I'm reading.
I have a policy that took effect in 2013 and all institutions that should be in the treatment group received the treatment at the same time. I know I need to match on pre-intervention characteristics.
Characteristics I want to match on: f1b11_mil, upgrntt_mil, sgrnt_p, igrnt_p, scfa2, scfa13p
Outcome of Interest: tuition2
Binary treatment variable: treat
Pre-treatment year to match on: 2009 (4 years prior to treatment)
There are 540 unique unitids (ID variable)

input long unitid str75 inst_name int year byte(opeflag fips sector deggrant instcat ftftug) long(f1b11 scfa2) byte scfa13p long upgrntt byte(sgrnt_p igrnt_p) int(tuition2 fee2) float(f1b11_mil upgrntt_mil treat)
input long unitid int year byte(opeflag fips sector deggrant instcat ftftug) float(upgrntt_mil f1b11_mil) int(fee2 tuition2) byte(igrnt_p sgrnt_p) long scfa2 byte scfa13p float treat
100654 2008 1 1 1 1 2 1 8.90603 42.45104 640 3432 15 4 4297 39 0
100654 2009 1 1 1 1 2 1 13.75782 38.35684 744 3948 27 4 4496 41 0
100654 2010 1 1 1 1 2 1 16.12934 38.82124 928 4872 33 4 4940 36 0
100654 2011 1 1 1 1 2 1 13.88352 40.40534 1500 5328 22 6 4285 29 0
100654 2012 1 1 1 1 2 1 13.857038 39.33574 1590 5592 32 1 4170 38 0
100654 2013 1 1 1 1 2 1 13.670262 39.88214 1590 5592 49 1 4051 32 0
100654 2014 1 1 1 1 2 1 14.741945 40.10284 1596 7500 70 1 4210 32 0
100654 2015 1 1 1 1 2 1 14.64031 40.52152 1596 7770 56 1 4505 26 0
100654 2016 1 1 1 1 2 1 15.953983 41.01709 1236 8130 55 6 4851 39 0
100654 2017 1 1 1 1 2 1 17.821852 41.01709 1478 8379 68 5 5039 47 0
100654 2018 1 1 1 1 2 1 18.20018 42.59988 1134 8610 64 4 5143 53 0
100654 2019 1 1 1 1 2 1 19.91651 46.71782 1414 8610 54 3 5273 51 0
100663 2008 1 1 1 1 2 1 8.913727 284.94476 872 3792 54 1 10369 9 0
100663 2009 1 1 1 1 2 1 13.67419 256.19058 872 4224 57 1 10646 9 0
100663 2010 1 1 1 1 2 1 17.59017 254.28854 0 5806 56 1 11028 10 0
100663 2011 1 1 1 1 2 1 16.988588 268.64035 0 6264 57 0 11128 12 0
100663 2012 1 1 1 1 2 1 15.837111 258.42984 0 6798 60 0 11291 13 0
100663 2013 1 1 1 1 2 1 16.360283 264.07272 0 7206 66 0 11542 13 0
100663 2014 1 1 1 1 2 1 16.991112 265.2935 0 7510 72 0 11679 15 0
100663 2015 1 1 1 1 2 1 17.813177 267.32974 0 7766 77 0 11511 16 0
100663 2016 1 1 1 1 2 1 19.483265 272.16626 0 8040 74 0 12369 15 0
100663 2017 1 1 1 1 2 1 24.210266 273.35114 0 8328 77 2 13134 15 0
100663 2018 1 1 1 1 2 1 26.68324 287.69174 0 8568 78 3 13836 16 0
100663 2019 1 1 1 1 2 1 26.747816 306.9647 0 8568 82 1 13836 16 0
100706 2008 1 1 1 1 2 1 4.546748 45.86145 900 5052 62 2 5893 10 0
100706 2009 1 1 1 1 2 1 10.007614 43.07262 930 5580 66 2 6119 11 0
100706 2010 1 1 1 1 2 1 11.415048 42.70377 1140 6352 71 1 6005 12 0
100706 2011 1 1 1 1 2 1 8.610964 43.24059 0 8094 65 2 5935 12 0
100706 2012 1 1 1 1 2 1 8.136506 42.71096 0 8794 63 1 5882 13 0
100706 2013 1 1 1 1 2 1 7.614492 43.10239 0 9192 66 1 5696 9 0
100706 2014 1 1 1 1 2 1 7.613859 43.99723 0 9158 74 3 5618 15 0
100706 2015 1 1 1 1 2 1 7.468719 44.95922 0 9128 76 1 6013 22 0
100706 2016 1 1 1 1 2 1 7.442209 47.83325 846 8996 75 1 6507 23 0
100706 2017 1 1 1 1 2 1 8.194441 48.35246 924 9356 82 1 7090 24 0
100706 2018 1 1 1 1 2 1 8.700366 52.36505 984 9730 83 1 7671 28 0
100706 2019 1 1 1 1 2 1 8.533685 55.3336 1392 9730 87 1 7987 31 0
100724 2008 1 1 1 1 2 1 12.590665 45.73027 852 4608 30 15 4730 47 0
100724 2009 1 1 1 1 2 1 15.51089 45.81357 852 5616 33 7 4638 47 0
100724 2010 1 1 1 1 2 1 16.512516 47.14528 852 6312 30 14 4882 34 0
100724 2011 1 1 1 1 2 1 16.038794 44.31322 1770 6312 33 17 4743 30 0
100724 2012 1 1 1 1 2 1 17.190329 42.65814 1620 6312 34 11 5130 35 0
100724 2013 1 1 1 1 2 1 16.640139 43.32461 1784 6936 36 7 5356 39 0
100724 2014 1 1 1 1 2 1 15.424078 41.88078 1784 6936 39 10 4805 47 0
100724 2015 1 1 1 1 2 1 16.0307 42.29859 1784 6936 32 10 4764 44 0
100724 2016 1 1 1 1 2 1 14.936663 42.94614 2284 6936 37 8 4727 35 0
100724 2017 1 1 1 1 2 1 14.14102 43.25482 2740 8328 41 8 4208 32 0
100724 2018 1 1 1 1 2 1 14.182984 46.91959 2740 8328 46 6 3903 42 0
100724 2019 1 1 1 1 2 1 13.341998 49.98301 2740 8328 38 7 3750 48 0
100751 2008 1 1 1 1 2 1 13.423014 156.52147 0 6400 39 2 22341 36 0
100751 2009 1 1 1 1 2 1 21.01965 138.54085 0 7000 44 1 23700 38 0
100751 2010 1 1 1 1 2 1 25.219826 137.4272 0 7900 46 4 24420 42 0
100751 2011 1 1 1 1 2 1 23.875544 145.95123 0 8600 49 7 26234 49 0
100751 2012 1 1 1 1 2 1 23.68567 140.6999 0 9200 50 2 28026 54 0
100751 2013 1 1 1 1 2 1 24.54046 144.23485 0 9450 53 1 29440 58 0
100751 2014 1 1 1 1 2 1 25.44726 146.22292 0 9826 55 1 30752 63 0
100751 2015 1 1 1 1 2 1 25.83105 148.44188 0 10170 56 1 31958 64 0
100751 2016 1 1 1 1 2 1 24.65764 154.8363 0 10470 57 1 32480 66 0
100751 2017 1 1 1 1 2 1 27.17063 156.7428 0 10780 57 1 33305 65 0
100751 2018 1 1 1 1 2 1 26.857683 169.7337 0 10780 56 3 33028 64 0
100751 2019 1 1 1 1 2 1 26.35378 182.79796 0 10780 65 3 32795 61 0
100830 2008 1 1 1 1 2 1 4.723343 24.8307 270 5310 21 15 4469 8 0
100830 2009 1 1 1 1 2 1 7.260708 22.842974 330 5640 18 6 4695 6 0
100830 2010 1 1 1 1 2 1 8.761985 22.826807 440 6180 32 19 4829 9 0
100830 2011 1 1 1 1 2 1 7.31186 22.863407 650 6930 33 3 4403 6 0
100830 2012 1 1 1 1 2 1 6.985468 21.947664 650 7500 48 5 4239 7 0
100830 2013 1 1 1 1 2 1 7.648208 22.55773 650 8100 41 3 4334 4 0
100830 2014 1 1 1 1 2 1 8.200942 22.6638 650 8430 33 3 4377 12 0
100830 2015 1 1 1 1 2 1 8.186193 22.7753 650 8700 33 2 4257 11 0
100830 2016 1 1 1 1 2 1 8.333386 22.99492 760 8880 44 3 4273 8 0
100830 2017 1 1 1 1 2 1 9.843336 23.31845 700 7320 86 2 4313 9 0
100830 2018 1 1 1 1 2 1 11.167484 25.59884 868 7536 89 5 4632 12 0
100830 2019 1 1 1 1 2 1 11.282206 27.002506 868 7752 90 4 4523 9 0
100858 2008 1 1 1 1 2 1 8.713446 236.8604 620 5880 52 2 20037 42 0
100858 2009 1 1 1 1 2 1 13.466878 213.36974 732 6240 57 2 19926 42 0
100858 2010 1 1 1 1 2 1 15.528426 212.89734 892 7008 62 2 20221 43 0
100858 2011 1 1 1 1 2 1 14.252439 224.95274 1402 7296 69 1 20446 44 0
100858 2012 1 1 1 1 2 1 13.54504 216.6535 1574 7872 65 1 20175 37 0
100858 2013 1 1 1 1 2 1 13.094865 220.4243 1596 8256 65 0 19799 35 0
100858 2014 1 1 1 1 2 1 13.920345 222.8384 1608 8592 57 1 20629 38 0
100858 2015 1 1 1 1 2 1 14.05016 225.2862 1616 8808 59 1 21786 38 0
100858 2016 1 1 1 1 2 1 14.119303 231.68108 1624 9072 62 1 22658 39 0
100858 2017 1 1 1 1 2 1 17.071264 233.2523 1632 9336 62 1 23964 40 0
100858 2018 1 1 1 1 2 1 16.757233 247.33 1652 9624 61 2 24628 40 0
100858 2019 1 1 1 1 2 1 15.631504 262.83594 1676 9816 59 2 24594 44 0

1. Do my data need to be in wide format?
2. Will psmatch2 work for this?