clear all
cd " C:\Bases de Datos\Bases de Datos\STATA\Bases Encuesta ENAHO\ENAHO 2017 - 2022"
/*
use "[Link]", clear
append using "[Link]"
append using "[Link]"
append using "[Link]"
append using "[Link]"
append using "[Link]"
save "[Link]", replace
*/
use "[Link]", clear
rename a*o year
gen anio=real(year)
label var year "Year"
tab p500i year
drop if p500i=="00"
*Se establece quienes son residentes habituales
gen resi=1 if ((p204==1 & p205==2) | (p204==2 & p206==1))
*P204 ¿Es miembro del hogar? 204. ¿Es miembro del hogar familiar? 1. Sí 2. No
*P205 ¿Se encuentra ausente del hogar 30 días o más? 1. Sí 2. No
*P206 ¿Está presente en el hogar 30 días o más? 1. Sí 2. No
. tab p204
�es miembro
del hogar? Freq. Percent Cum.
si 546,854 99.41 99.41
no 3,243 0.59 100.00
Total 550,097 100.00
. tab p205
�se
encuentra
ausente del
hogar 30
d�as o m�s? Freq. Percent Cum.
si 8,725 1.60 1.60
no 538,129 98.40 100.00
Total 546,854 100.00
. tab p206
�est�prese
nte en el
hogar 30
d�as o m�s? Freq. Percent Cum.
si 3,243 100.00 100.00
Total 3,243 100.00
*****************************************************************************
*GRÁFICO N° 3.2 PERÚ: TASA DE EMPLEO FORMAL E INFORMAL Y VARIACIÓN DE LA PEA
OCUPADA CON EMPLEO FORMAL E INFORMAL, 2017-2022
. table ocupinf anio if resi==1 [iw= fac500a], nformat(%12.0fc)
anio
2017 2018 2019 2020 2021 2022 Total
situacion de informalidad ([Link])
empleo informal 11,978,142 12,152,611 12,462,775 11,228,272 13,156,308 13,441,375 74,419,483
empleo formal 4,532,842 4,623,872 4,670,325 3,673,510 3,963,833 4,314,991 25,779,373
Total 16,510,984 16,776,484 17,133,100 14,901,782 17,120,141 17,756,366 100,198,856
. gen informal=ocupinf
(172,461 missing values generated)
.
. replace informal=0 if ocupinf==2
(82,203 real changes made)
.
. gen formal =1 if ocupinf==2
(467,894 missing values generated)
.
. replace formal =0 if ocupinf==1
(295,433 real changes made)
. graph bar informal formal if resi==1 [pw= fac500a], over(year) per stack yscale(off) legend(cols(2) position(6) label(1 "Tasa de empleo informal"
> )label(2 "Tasa de empleo formal")) blabel(bar, format(%4.1f) size(small) position(center) color(white)) bar(1,color(red)) bar(2,color(orange))
. graph save "Graph" "C:\Bases de Datos\Bases de Datos\STATA\Bases Encuesta ENAHO\ENAHO 2022\[Link]"
file C:\Bases de Datos\Bases de Datos\STATA\Bases Encuesta ENAHO\ENAHO 2022\[Link] saved
Tasa de Empleo
24.7 23.2 24.3
27.5 27.6 27.3
75.3 76.8 75.7
72.5 72.4 72.7
2017 2018 2019 2020 2021 2022
Tasa de empleo informal Tasa de empleo formal
bys year: egen double t_informal = total (fac500a * informal) if resi==1
bys year: egen float t_formal = total(fac500a * formal) if resi==1
label var t_informal "Empleos Informales"
label var t_formal "Empleos Formales"
br t_informal t_formal
format t_* %20.0fc
preserve
keep t_* anio
duplicates drop
scatter t_informal t_formal anio, connect(l l) lcolor(red orange) msymbol(D S) mcolor(red orange) mlabel(t_informal t_formal)
mlabcolor(red orange) mlabposition(6 12) mlabsize(small small) yscale(off) xtitle("") legend(cols(2) position(6)) xlabel(, nogrid)
ylabel(, nogrid) saving(gr3_2b.gph, replace)
13,441,375
13,156,308
12,462,775
11,978,142 12,152,611
11,228,272
4,532,843 4,623,872 4,670,325
4,314,991
3,963,833
3,673,510
2017 2018 2019 2020 2021 2022
Empleos Informales Empleos Formales
restore
gr combine gr3_2a.gph gr3_2b.gph, ///
title("GRÁFICO N° 3.2" "PERÚ: TASA DE EMPLEO FORMAL E INFORMAL Y VAR. DE LA PEA
OCUPADA" "CON EMPLEO FORMAL E INFORMAL, 2017-2022", size(small) color(red)
margin(medsmall)) ///
subtitle("(Porcentaje y absolutos)", size(small)) ///
xcommon commonscheme
graph export gr3_2.png, replace