Objetivo: Unir as bases de dados do Censo demográfico (1991, 2000 e 2010) e da PNAD ContĂnua, com o intĂşito de verificar a evolução, ao longo do tempo, da taxa de evasĂŁo escolar no ensino fundamental, em relação ao IDHM.
library(esquisse)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## âś” ggplot2 3.4.0 âś” purrr 1.0.1
## âś” tibble 3.1.8 âś” dplyr 1.0.10
## âś” tidyr 1.3.0 âś” stringr 1.5.0
## âś” readr 2.1.3 âś” forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## âś– dplyr::filter() masks stats::filter()
## âś– dplyr::lag() masks stats::lag()
library(ggplot2)
library(readxl)
library(summarytools)
##
## Attaching package: 'summarytools'
##
## The following object is masked from 'package:tibble':
##
## view
munic <- read_excel("~/Library/CloudStorage/OneDrive-Pessoal/0.R_Projects/Teste/Atlas.xlsx",
sheet = "MUN 91-00-10")
educa <- read_excel("~/Library/CloudStorage/OneDrive-Pessoal/0.R_Projects/Teste/PNUD.xlsx",
sheet = "MUNICĂŤPIO")
munic %>%
select(ANO, GINI, PIND, IDHM, IDHM_E, IDHM_R, Codmun7, POP, pesoRUR, pesotot, pesourb) %>%
mutate(classe_pop = case_when(
(POP < 5001) ~ "1) Até 5.000",
(POP > 5000 & POP < 20001) ~ "2) 5.001 a 20.000",
(POP > 20000 & POP < 100001) ~ "3) 20.001 a 100.000",
(POP > 100000 & POP < 500001) ~ "4) 100.001 a 500.00",
(POP > 500000) ~ "5) Mais de 500.00"
)) %>%
mutate(Classe_idhm = case_when(
(IDHM < 0.5) ~ "Muito baixo",
(IDHM >= 0.5 & IDHM < 0.6) ~ "Baixo",
(IDHM >= 0.6 & IDHM < 0.7) ~ "Médio",
(IDHM >= 0.7 & IDHM < 0.8) ~ "Alto",
(IDHM >= 0.8) ~ "Muito Alto",
)) -> munic2
educa %>%
select(TTREVA_EF_PRI, TTREVA_EF_PUB, IBGE7, TTREVA_EF_TOTAL) -> educa2
munic2 %>%
full_join(educa2, by = c("Codmun7"="IBGE7")) %>%
na.omit() -> join_munic_edu
ggplot(join_munic_edu) +
aes(x = IDHM, y = TTREVA_EF_TOTAL, colour = Classe_idhm) +
geom_point(shape = "circle", size = 1.5) +
scale_color_hue(direction = -1) +
theme_minimal() +
facet_wrap(vars(ANO))