I have this dataset:
I would like to have only 1 row for each municipality(var mun)-year(var ano), but stata do not allow me to do the command below:
:
mun ano d_fem fxetaria pop 110001 1991 no 0 to 4 years 2328 110001 1991 no 5 to 9 years 2139 110001 1991 no 10 to 14 years 2202 110001 1991 no 15 to 19 years 1984 110001 1991 no 20 to 24 years 1677 110001 1991 no 25 to 29 years 1532 110001 1991 no 30 to 34 years 1216 110001 1991 no 35 to 39 years 932 110001 1991 no 40 to 44 years 742 110001 1991 no 45 to 49 years 641 110001 1991 no 50 to 54 years 539 110001 1991 no 55 to 59 years 446 110001 1991 no 60 to 64 years 309 110001 1991 no 65 to 69 years 172 110001 1991 no 70 to 74 years 72 110001 1991 no 75 to 79 years 48 110001 1991 no 80 years+ 30 110001 1991 yes 0 to 4 years 2199 110001 1991 yes 5 to 9 years 2141 110001 1991 yes 10 to 14 years 2033 110001 1991 yes 15 to 19 years 1907 110001 1991 yes 20 to 24 years 1456 110001 1991 yes 25 to 29 years 1271 110001 1991 yes 30 to 34 years 998 110001 1991 yes 35 to 39 years 774 110001 1991 yes 40 to 44 years 605 110001 1991 yes 45 to 49 years 521 110001 1991 yes 50 to 54 years 386
:
. reshape wide pop, i (mun ano) j (d_fem fxetaria) variable d_fem is numeric r(109);