Hi Everyone,

I would be so pleased to get some help concerning the following issue:

I have done with the Difference-in-differences analysis. My treatment is at the county level. Each county received the treatment at a certian point in time.

I would want to proceed with the Propensity Score Matching as an extension procedure and get results for DID-Matching. I know everything about PSM, however, I am not quite sure how to get the STATA command in order to:
- generate Pre- and Post-treatment dummies since I don't have a treatment at one point in time; i.e. DD is staggered.
- use the DD with pscore


The data example is as follows (PS, I have not used all the covariates in the example bellow, just to save space and not to overwrite):

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float treatment double(outcome median_age) str17 county double Graduates float chinaratio double price float outcome_date int treatment_date
0  977.6230030012131    . "alameda"          .         0            2019285 2006 2009
0  186.4290008544922 49.1 "amador"         5.1         0             109700 2013    .
1 5018.5009333491325 36.8 "butte"          8.3  2.020202      86220.2734375 2015 2013
0 26.644999694824218 48.5 "calaveras"      6.6         0      218429.453125 2010 2016
1  5633.800985813141 34.7 "colusa"         3.4         0      165693.703125 2016 2014
1  9848.898022890091 39.2 "contracosta"   14.9         0     123313.8671875 2017 2010
0 1171.5039973258972    . "eldorado"         .         0                  . 2006 2015
1  18139.15609360695 30.7 "fresno"         6.3 1.2623686  1477646.126818182 2012 2011
1 2403.0899991989136    . "glenn"            .  .3584229      182184.390625 2018 2014
0  3.865000009536743    . "humboldt"         .         0                  . 2001 2015
0 11.725000381469727 32.2 "imperial"       4.4         0              33500 2017 2018
0 130.51142597198486 45.7 "inyo"             8  11.11111              95511 2012 2016
1  49581.69443356991 31.2 "kern"           5.2  1.199577         431813.025 2016 2010
0 2.6500000953674316    . "kings"            .         0                  . 2002 2015
0 118.67999811935425    . "lake"             .         0         2784842.75 2007    .
0 188.26600074768066 36.2 "lassen"         4.5         0             212319 2017    .
1 15421.118027787208 35.6 "losangeles"    10.5 1.6742994  432154.2635365853 2015 2010
0  372.9580023670197    . "madera"           .         0         1088171.75 2007 2014
1   950.754987192154 45.1 "marin"           24 3.5714285         337785.375 2014 2012
0  596.9810292720795 48.4 "mariposa"         7         0                  . 2011 2015
1  955.7599940299988 42.4 "mendocino"      8.4  9.523809      203997.421875 2017 2014
0 118.22599649429321    . "merced"           .         0                  . 2004 2013
0 17.968571462631225 37.2 "mono"           9.3         0              50230 2014 2014
1 13381.888020515442    . "monterey"         . 4.1666665        475311.1875 2018 2014
0 1652.3920265712738 39.3 "napa"          10.5         0      297411.843125 2009 2012
0  41.76599884033203    . "nevada"           .         0                  . 2003 2016
1 12751.384747743607    . "orange"           .  1.635514  594329.4550965099 2018 2013
1   2941.57594871521   41 "placer"          12  3.472222    30934.466796875 2015 2009
0 36.129999947547915 49.9 "plumas"         9.4         0      95743.4296875 2013    .
0  8294.275227535247    . "riverside"        .         0     2403835.644375 2008 2008
0   170.242998752594 34.6 "sacramento"     8.9         0          1193160.5 2010 2013
0 318.01400032043455 33.7 "sanbenito"      5.1         0  738047.9554166667 2010 2016
0  3975.420595321655    . "sanbernardino"    .         0 2746432.4444444445 2006 2009
0 1801.7347531318665    . "sandiego"         .         0  390164.2361111111 2003 2010
0 121.97300136089325    . "sanfrancisco"     .         0                  . 2005 2010
0 11213.282019805909 33.2 "sanjoaquin"     5.7 1.1641929        2654699.005 2014 2014
0  3127.586973787308    . "sanluisobispo"    .         0  999652.3431250001 2008 2010
0  61.30000066757202    . "sanmateo"         .         0                  . 2004 2010
0  486.6688573074341    . "santabarbara"     .         0 1535883.9627083333 2006 2015
0  8.059000015258789    . "santaclara"       .         0                  . 2000 2009
0  638.5910001277923    . "santacruz"        .         0       750463.62625 2007 2010
0  1930.181016921997 42.2 "shasta"         6.8  8.823529              73866 2015 2016
0 1.7300000190734863 51.6 "sierra"         5.6         0                  . 2012    .
0 3250.1130371284485 35.9 "solano"           7        20        3075822.675 2009 2009
0 1748.7119809389114    . "sonoma"           .         0                  . 2004 2009
0  645.8740153312683 32.6 "stanislaus"     5.2         0             303344 2011 2014
0 446.34900802612304 34.5 "sutter"           5         0           82638.25 2012 2012
0  2279.308996319771 40.6 "tehama"         4.6         0       163665.90625 2016 2018
1  19601.44639503479 30.3 "tulare"         4.3 18.227596 1216182.9858163265 2015 2011
0  7.289999771118164 45.9 "tuolumne"       6.1         0            16832.5 2009    .
0  699.3892369270325    . "ventura"          .         0            2867200 2003 2014
0  1174.821017074585    . "yolo"             .         0          1165226.5 2007 2011
0  687.8650116920471 32.1 "yuba"           4.5         0      88120.2890625 2015 2015
1  5567.919020372391 36.4 "alameda"       16.6 4.2375884       1056647.9375 2011 2009
1  8763.080038547516 37.1 "alameda"         18  .9803922        85849.28125 2015 2009
1 10110.525970374107 36.2 "alameda"       16.3  7.158948  1306180.638382353 2010 2009
0  5595.163978595734    . "alameda"          .         0 1180082.8805555555 2007 2009
0  5213.825936393738 36.1 "alameda"         16         0  811276.8029166667 2009 2009
1 13239.111066102982 37.3 "alameda"         19   .764526       294720.90625 2017 2009
1   9636.29299182892 36.8 "alameda"       17.2 1.6851852       541313.88625 2013 2009
1 14981.315011024475    . "alameda"          . 2.0833333      187289.140625 2018 2009
0   69.0370020866394    . "alameda"          .         0                  . 2002 2009
1  8848.585966467857 37.2 "alameda"       18.5  1.488673       227775.03125 2016 2009
0  2986.469010679245    . "alameda"          .  7.142857 1294418.6735714285 2008 2009
0 1038.2130085229874    . "alameda"          .         0                  . 2004 2009
1  7629.609037940979 36.9 "alameda"       17.5 1.4699074       1279580.8625 2014 2009
0 2641.6559681892395    . "alameda"          .         0                  . 2005 2009
1  7827.785046882629 36.6 "alameda"       16.8  6.208333      542930.591125 2012 2009
0  924.9690197706223    . "alameda"          .         0                  . 2003 2009
0 12.899999618530273    . "amador"           .         0                  . 2004    .
0  210.7160016298294 50.3 "amador"         6.9         0      72191.6640625 2016    .
0  555.8660011291504    . "amador"           .         0         209160.375 2018    .
0 258.14600563049316    . "amador"           .         0          293817.75 2008    .
0   213.392000579834    . "amador"           .         0 218393.72770833335 2007    .
0  39.49600019454956 47.2 "amador"         5.8         0     72759.80078125 2010    .
0  2.015000104904175    . "amador"           .         0                  . 2001    .
0 20.483999133110046    . "amador"           .         0                  . 2006    .
0  252.5989990234375 48.4 "amador"         4.8         0          4034958.5 2012    .
0 2.2869999408721924    . "amador"           .         0                  . 2002    .
0 155.96100211143494   48 "amador"         5.7         0       1041219.1875 2011    .
0 2059.2509994506836 50.6 "amador"         7.3        10       362101.90625 2017    .
0 18.808000087738037 49.6 "amador"         6.2         0                  . 2014    .
0 126.29799842834473   50 "amador"         6.6         0     47183.33203125 2015    .
0                  7 46.3 "amador"         6.1         0     102867.3359375 2009    .
0 105.51700210571289    . "amador"           .         0                  . 2005    .
0 272.96199798583984    . "butte"            .         0                  . 2003 2013
0  992.7100081443787    . "butte"            .         0                  . 2005 2013
0   4762.09196833229 37.2 "butte"          8.1         0 1324352.9196428573 2010 2013
0  376.8860079050064    . "butte"            .         0            7129597 2006 2013
0 20.935999870300293    . "butte"            .         0                  . 2002 2013
1  7265.540008544922 36.9 "butte"          8.7         0         160430.625 2016 2013
0  2035.965983390808    . "butte"            .         0                  . 2004 2013
1  2811.237986087799    . "butte"            . 2.3245614     122259.6484375 2018 2013
1 1517.4980118751525 36.9 "butte"          8.4 .12755102      514816.765625 2014 2013
0 1722.6520069503783   37 "butte"          8.2 .16666666  95047.46828125001 2013 2013
1  7542.768997192383 36.9 "butte"          8.9         0      242201.078125 2017 2013
0  772.7609907150269    . "butte"            .         0        2529700.625 2007 2013
0  2624.578981103897    . "butte"            .         0        795442.9375 2008 2013
0  7879.005087003708 37.2 "butte"          7.9 11.416667       598783.10625 2011 2013
0   810.153014626503 36.6 "butte"          8.4         0      526406.796875 2009 2013
end

Many thanks in advance,
Ali