Pirámide poblacional Verificación: Tabulados_2012.XLS Tabulado 1.1 ENIGH 2012 Tradicional
Pirámide poblacional
clear set mem 100m use folioviv factor_viv using "C:\ENIGH 2012 Tradicional\Viviendas.dta", clear sort folioviv save "C:\ENIGH 2012 Tradicional\factor_viv.dta", replace use folioviv foliohog numren sexo edad parentesco using "C:\ENIGH 2012 Tradicional\pobla12.dta", clear sort folioviv merge folioviv using "C:\ENIGH 2012 Tradicional\factor_viv.dta" * Pirámide de población a 8 grupos recode edad (0/4=1) (5/11=2) (12/19=3) (20/29=4) (30/39=5) (40/49=6) (50/59=7) (60/97=8), gen(g_edad) tabulate g_edad [iw=factor_viv] tabulate g_edad sexo [iw=factor_viv] label define g_edad 1 "0 a 4 años" 2 "5 a 11 años" 3 "12 a 19 años" 4 "20 a 29 años" 5 "30 a 39 años" 6 "40 a 49 años" 7 "50 a 59 años" 8 "60 y más años" label values g_edad g_edad tabulate g_edad [iw=factor_viv] tabulate g_edad sexo [iw=factor_viv] destring sexo, replace label define sexo 1 "Hombres" 2 "Mujeres" label values sexo sexo tabulate g_edad sexo [iw=factor_viv] gen hombres=(sexo==1) gen mujeres=(sexo==2) collapse (sum) hombres mujeres [iw=factor_viv], by(g_edad) gen mill_hom = hombres/ gen mill_muj = -mujeres/ gen cero=0 twoway (bar mill_muj g_edad, horizontal) (bar mill_hom g_edad, horizontal) (scatter g_edad cero, msymbol(i) mlabel(g_edad) mlabcolor(black)), title("Población por Género y Grupo de Edad al 2012") xlabel(-6 "6" -5 "5" -4 "4" -3 "3" -2 "2" -1 "1" ) xtitle("(millones de habitantes)") yscale(off) ylabel(, nogrid) legend(order(1 "Mujeres" 2 "Hombres")) note("Elaboración con datos de la ENIGH 2012")
Pirámide poblacional * Pirámide de población a 19 grupos use folioviv foliohog numren sexo edad using "C:\ENIGH 2012 Tradicional\pobla12.dta", clear sort folioviv merge folioviv using "C:\ENIGH 2012 Tradicional\factor_viv.dta" recode edad (0/4=1) (5/9=2) (10/14=3) (15/19=4) (20/24=5) (25/29=6) (30/34=7) (35/39=8) (40/44=9) (45/49=10) (50/54=11) (55/59=12) (60/64=13) (65/69=14) (70/74=15) (75/79=16) (80/84=17) (85/89=18) (90/97=19), gen(g19_edad) label define g19_edad 1 "Menores de 5" 2 "5 a 9" 3 "10 a 14" 4 "15 a 19" 5 "20 a 24" 6 "25 a 29" 7 "30 a 34" 8 "35 a 39" 9 "40 a 44" 10 "45 a 49" 11 "50 a 54" 12 "55 a 59" 13 "60 a 64" 14 "65 a 69" 15 "70 a 74" 16 "75 a 79" 17 "80 a 84" 18 "85 a 89" 19 "90 y más" label values g19_edad g19_edad tabulate g19_edad sexo [iw=factor_viv] destring sexo, replace label define sexo 1 "Hombres" 2 "Mujeres" label values sexo sexo tabulate g19_edad sexo [iw=factor_viv] gen hombres=(sexo==1) gen mujeres=(sexo==2) collapse (sum) hombres mujeres [iw=factor_viv], by(g19_edad) gen mill_hom = hombres/ gen mill_muj = -mujeres/ gen cero=0 twoway (bar mill_muj g19_edad, horizontal) (bar mill_hom g19_edad, horizontal) (scatter g19_edad cero, msymbol(i) mlabel(g19_edad) mlabcolor(black)), title("Población por Género y Grupo de Edad al 2012") xlabel(-6 "6" -5 "5" -4 "4" -3 "3" -2 "2" -1 "1" ) xtitle("(millones de habitantes)") yscale(off) ylabel(, nogrid) legend(order(1 "Mujeres" 2 "Hombres")) note("Elaboración con datos de la ENIGH 2012")