![stata mp 14 key generator stata mp 14 key generator](https://creatornew903.weebly.com/uploads/1/2/4/8/124878696/458552617.gif)
A third solution would be to set aside the data, to keep only the last tranches and to use them to generate new observations using the expand command, but again, I think I would need to combine that with the reshape wide command.Another way would be to create a loop, asking Stata to create a new observation and then to manually replace every variable by the sum of the preceding rows for every zipcode.The reason I would like to avoid that is that I have different variables every year (as tax forms evolve over time), so that would require to change the variables manually every year and be extremely long. That would require to reshape the data, then to create 40 new variables, each corresponding to the sum of their values for the three biggest income tranches, then to drop the variables corresponding to these tranches, then to use reshape long. That would be done by summing the variables that actually vary (A, B etc.) and keeping the other variables (State, Year) unchanged in a new observation, and by deleting the observations I used to do that.Ĭode: reshape wide, i(zipcode) j(income tranche) but I can't think of an appropriate way to use it with as many variables as I have. What I would need to do is, for the years where there are five tranches, to merge the last three of them in a unique, big tranche. The good news is that the three highest income tranches in the years where there are five tranches (50 000-100 000, 100 000 - 200 000, 200 000 and more) correspond to the higher tranche in the years when there are 3 tranches (50 000 and more).
![stata mp 14 key generator stata mp 14 key generator](https://pcwonderland.com/wp-content/uploads/2018/10/StataCorp-Stata-MP-15-4.jpg)
My problem is that the number of income tranches varies across time : in this example there are 5 of them on some years, and 3 on some other years.