Dear Statalisters,
As part of my thesis I am conducting a DiD analysis on a balanced data set with US families from 2007 to 2021. In that matter, I want to match the treatment and control group based on income, marital status, and age (covariates). However, after searching the internet I am not sure how to do this with, as the treatment is defined on behalf of their wealth in 2017 before a reform, but I also have a dummy indicating 1 for all years for each family if they are treated. But I am afraid that Stata counts 1 for all years and creates he propensity score for each year. What I want is for each family to have only one propensity score from 2017. I want to match the data only on behalf of their treatment status in 2017. I have made a dummy indicating if they are treated in 2017 or not. My data is in long format.
So, the DiD is made from 2007 to 2021, with treatment status defined in 2017 just before the reform.
The outcome variable is whether or not they own a house (ownrate) and I tend to use nearest neighbour matching.
I really hope someone can help.
As part of my thesis I am conducting a DiD analysis on a balanced data set with US families from 2007 to 2021. In that matter, I want to match the treatment and control group based on income, marital status, and age (covariates). However, after searching the internet I am not sure how to do this with, as the treatment is defined on behalf of their wealth in 2017 before a reform, but I also have a dummy indicating 1 for all years for each family if they are treated. But I am afraid that Stata counts 1 for all years and creates he propensity score for each year. What I want is for each family to have only one propensity score from 2017. I want to match the data only on behalf of their treatment status in 2017. I have made a dummy indicating if they are treated in 2017 or not. My data is in long format.
So, the DiD is made from 2007 to 2021, with treatment status defined in 2017 just before the reform.
The outcome variable is whether or not they own a house (ownrate) and I tend to use nearest neighbour matching.
Code:
YEAR HOUSEHOLDID MARITAL treatment treatmentall ownrate avage loginc 2017 1066 Married 0 0 0 44.5 11.46163 2017 1019 Never married 0 0 1 37 11.27643 2015 3225 Divorced, annulled 0 0 0 67 9.174506 2017 1122 Divorced, annulled 0 0 0 51 11.46528 2007 2486 Never married 0 0 0 34 9.563529 2011 669 Divorced, annulled 0 0 0 54 11.27973 2005 3175 Married 0 0 0 35.5 11.24114 2011 2551 Married 0 0 1 54.5 10.18998 2007 876 Married 0 0 1 53.5 11.75194 2013 1707 Never married 0 0 0 34 9.746834 2007 109 Divorced, annulled 0 0 0 35 9.973806 2019 3094 Married 0 0 0 72.5 10.45057 2011 1194 Never married 0 0 0 27 9.753827 2011 2834 Married 0 0 0 52 10.60287 2011 3094 Married 0 0 1 64.5 11.05232 2019 3209 Never married 0 0 0 57 8.864323 2013 1095 Married 0 0 1 49 10.87805 2011 2308 Married 0 0 1 55.5 10.63164 2009 2639 Separated 0 0 1 60 9.10498 2005 1681 Married 0 0 1 32 11.04541 2007 2326 Separated 0 0 1 48 8.919454 2017 1815 Never married 0 0 0 38 12.76719 2009 3238 Never married 0 0 0 29 8.517193 2013 2771 Never married 0 0 1 66 10.2485 2015 2827 Divorced, annulled 0 0 0 35 10.22818 2013 3132 Never married 0 0 0 51 9.021598 2017 2923 Married 0 0 1 61 11.33675 2009 3034 Widowed 0 0 0 70 8.881836 2017 2771 Never married 0 0 1 70 10.75332 2011 7 Married 0 0 0 33 10.23996 2021 1245 Never married 0 0 1 59 2011 3132 Never married 0 0 0 49 8.998137 2005 2830 Never married 0 0 0 47 2007 1109 Widowed 0 0 1 63 10.10643 2015 13 Never married 0 0 0 49 8.34284 2011 1128 Divorced, annulled 0 0 0 40 9.814875 2013 935 Married 0 0 0 59 10.98597 2017 921 Widowed 0 0 1 69 11.32662 2009 806 Married 0 0 0 35 11.28978 2005 3275 Never married 0 0 0 23 10.00785 2017 2182 Widowed 0 0 0 93 9.103645 2007 3047 Separated 0 0 1 30 10.30535 2019 3226 Never married 0 0 0 46 9.73696 2015 1765 Divorced, annulled 0 0 0 49 11.00227 2019 2920 Married 0 0 0 43.5 11.28643 2021 1508 Married 0 0 1 47.5 2013 206 Married 0 0 1 60 10.93521 2015 839 Never married 0 0 0 29 9.082052 2015 2453 Never married 0 0 0 41 8.268732 2021 3068 Widowed 0 0 1 69 2011 410 Married 0 0 1 51.5 11.759 2013 165 Married 0 0 0 48 10.68281 2005 1088 Married 0 0 1 32 10.34174 2015 1448 Married 0 0 0 70.5 10.96992 2017 3043 Divorced, annulled 0 0 0 61 10.63219 2007 886 Never married 0 0 1 27 11.25156 2021 2109 Married 0 0 1 39 2021 2028 Never married 0 0 0 42 2015 3235 Married 0 0 0 41 10.59663 2013 2284 Married 0 0 1 49.5 9.908176 2007 2701 Married 0 0 0 50 10.60162 2019 2876 Divorced, annulled 0 0 0 61 10.55059 2021 474 Married 0 0 1 45.5 2021 1128 Divorced, annulled 0 0 0 50 2007 3130 Divorced, annulled 0 0 0 50 11.0021 2011 3206 Married 0 0 0 45.5 11.48839 2011 699 Married 0 0 1 68 11.13411 2015 3122 Divorced, annulled 0 0 1 48 9.789535 2021 489 Separated 0 0 1 47 2009 1805 Divorced, annulled 0 0 0 47 8.738735 2011 2550 Never married 0 0 0 72 9.763765 2015 2849 Divorced, annulled 0 0 0 44 11.351 2019 372 Married 0 0 1 63.5 10.93756 2017 165 Married 0 0 0 52.5 11.28978 2021 1045 Never married 0 0 0 40 2009 3364 Never married 0 0 0 58 11.21167 2005 691 Married 0 0 0 27 10.94553 2011 39 Married 0 0 1 54 10.07036 2007 1367 Never married 0 0 0 27 10.81978 2021 1640 Married 0 0 1 51 2015 561 Never married 0 0 0 73 10.4445 2017 1411 Married 0 0 1 32.5 11.54217 2009 3229 Married 0 0 1 47 11.55215 2005 123 Married 0 0 1 49.5 10.59663 2013 2684 Never married 0 0 0 48 2019 472 Married 0 0 1 59 10.63826 2015 2098 Never married 0 0 0 50 9.472705 2013 2828 Never married 0 0 0 32 7.824046 2021 3349 Never married 0 0 0 47 2013 2049 Divorced, annulled 0 0 0 64 10.08643 2009 2958 Widowed 0 0 0 27 8.131531 2021 1100 Married 0 0 1 69 2015 3243 Divorced, annulled 0 0 1 68 10.05818 2005 2098 Never married 0 0 0 40 9.903487 2013 362 Never married 0 0 0 47 10.71914 2009 2609 Divorced, annulled 0 0 0 39 10.91696 2013 3328 Widowed 0 0 0 85 9.421249 2013 191 Married 0 0 1 37 11.05645 2017 2486 Never married 0 0 0 45 10.70759 2015 1154 Never married 0 0 0 46 11.00225 2009 2302 Married 0 0 0 45.5 10.37349 2005 2681 Married 0 0 0 39.5 11.2051 2005 1550 Divorced, annulled 0 0 0 50 10.54534 2013 2138 Married 0 0 0 37.5 10.78808 2021 3109 Widowed 0 0 1 80 2021 2618 Divorced, annulled 0 0 0 59 2013 3395 Never married 0 0 1 54 9.560716 2017 3065 Divorced, annulled 0 0 0 46 10.75594 2021 1246 Married 0 0 0 50.5 2015 2546 Never married 0 0 0 34 2009 2588 Never married 0 0 0 54 10.40426
Comment