tidyverse
y eph
.library(eph)
library(tidyverse)
Input para las tasas de actividad y empleo
eph2020 <- get_microdata(year=2020,
trim=3)
eph2020 <- eph2020 %>% organize_labels()
eph2020 %>%
filter(ESTADO > 0 ) %>%
group_by(CH04, ESTADO) %>%
summarise(n=n()) %>%
mutate(por = n/sum(n)*100) %>%
pivot_wider(names_from = CH04,
values_from = c(n, por))
## # A tibble: 4 x 5
## ESTADO n_Varon n_Mujer por_Varon por_Mujer
## <labelled> <int> <int> <dbl> <dbl>
## 1 1 9124 6942 45.6 32.1
## 2 2 854 706 4.27 3.27
## 3 3 7150 11226 35.7 51.9
## 4 4 2889 2745 14.4 12.7
Tasas de desocupación
eph2020 %>%
filter(ESTADO > 0 & ESTADO < 3) %>%
group_by(CH04, ESTADO) %>%
summarise(n=n()) %>%
mutate(prop = n/sum(n)*100) %>%
pivot_wider(names_from = CH04,
values_from =c(prop,n))
## # A tibble: 2 x 5
## ESTADO prop_Varon prop_Mujer n_Varon n_Mujer
## <labelled> <dbl> <dbl> <int> <int>
## 1 1 91.4 90.8 9124 6942
## 2 2 8.56 9.23 854 706
###
eph2020 %>%
filter(CH06 >= 36 & CH06 <= 70) %>%
group_by(CH04) %>%
summarise(media_inglab = mean(P21)) %>%
pivot_wider(names_from = CH04,
values_from = media_inglab) %>%
mutate(brecha = Mujer/Varon*100)
## # A tibble: 1 x 3
## Varon Mujer brecha
## <dbl> <dbl> <dbl>
## 1 21738. 11963. 55.0
###
###