Thank you for the note.
My point is that the pctile column includes only percentile scores for the control group, the ultimate goal of the procedure stated in #4 is to assign percentile scores for the treated based on the distribution of the scores for the control units. Here is the output after running the command in #12, as you can see the treated units are assigned . instead of percentile scores.
The procedure I described in #4 would result, for example, in the year 2002 country 2, for units 4 (a control unit) and 7 (a treated unit) having a percentile score of .75. This is true for the control unit based on the percentile score formula ((w+(s/2))/a), and true for the treated unit because it falls in the same place as unit 4 in the distribution of the control group because both have the same x-score. While the code in #12 produces missing value for the treated, the one in #8 recalculates the percentile scores (pctile) rather than merely identify location then assign percentile score for the treated.
My point is that the pctile column includes only percentile scores for the control group, the ultimate goal of the procedure stated in #4 is to assign percentile scores for the treated based on the distribution of the scores for the control units. Here is the output after running the command in #12, as you can see the treated units are assigned . instead of percentile scores.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int year byte(country id x) float(treat ecdf_control) double pctile_among_controls 2000 1 1 19 0 .25 .25 2000 1 2 22 0 .75 .75 2000 1 6 23 1 . . 2000 2 3 23 0 .16666667 .1666666716337204 2000 2 4 90 0 .8333333 .8333333134651184 2000 2 5 88 0 .5 .5 2000 2 7 15 1 . . 2001 1 1 60 0 .75 .75 2001 1 2 33 0 .25 .25 2001 1 6 75 1 . . 2001 2 3 53 0 .16666667 .1666666716337204 2001 2 4 81 0 .5 .5 2001 2 5 92 0 .8333333 .8333333134651184 2001 2 7 44 1 . . 2002 1 1 70 0 .75 .75 2002 1 2 44 0 .25 .25 2002 1 6 97 1 . . 2002 2 3 56 0 .25 .25 2002 2 4 85 0 .75 .75 2002 2 5 . 0 . . 2002 2 7 45 1 . . end
Comment