Census Tracts in Brazil

Census tracts are the smallest administrative divisions that provide socio-economic and demographic data. They are highly useful for statistical and spatial analysis, offering a robust and reliable set of information at a fine geographical scale.
census
brazil
sao-paulo
data-science
data-visualization
maps
leaflet
ggplot2
Author

Vinicius Oike

Published

June 14, 2024

Understanding Census Tracts in Brazil

Census tracts are the smallest administrative division that present socioeconomic and demographic data. Broadly speaking, census tracts are small areas that exhibit similar socioeconomic and demographic patterns. In another post I presented all of the Brazilian administrative and statistical subdivisions. Census tracts are small, usually much smaller than a neighborhood, but larger than a single block.

Census tracts are the strata used by National Bureau of Statistics and Geography (IBGE) in their decennial Census. The shape of each census tract usually respects administrative borders, land barriers, public spaces (parks, beaches, etc.), and follows the shape of roads, highways, or city blocks.

Census tracts also exhibit relatively homogeneous socioeconomic and demographic characteristics. This makes census tracts a very useful statistical tool in regression analysis and classification.

The map below shows the 2022 census tracts in Curitiba, a major city in the Southern part of Brazil.

Code
curitiba_setores <- cur_setores %>%
  mutate(across(pop:dom_prt_ocup, as.numeric)) %>%
  mutate(
    area_km2 = as.numeric(area_km2),
    pop_dens_area = pop / area_km2,
    pop_dens_hh = pop / dom_prt_ocup
  )

labels <- sprintf(
  "<b>Code Tract<b/>: %s <br>
  <b>Code Subdistrict<b/>: %s <br>
  <b>Name Subdistrict<b/>: %s",
  curitiba_setores$code_tract,
  curitiba_setores$code_subdistrict,
  curitiba_setores$name_subdistrict
)

labels <- lapply(labels, htmltools::HTML)

# center <- curitiba_setores %>%
#   summarise(geom = st_union(.)) %>%
#   st_centroid() %>%
#   st_coordinates()

curitiba_center <- c("lng" = -49.28824, "lat" = -25.47788)

leaflet(curitiba_setores) |> 
  addTiles() |> 
  addPolygons(weight = 2, fillColor = "gray80", color = "#feb24c", label = labels) |> 
  addProviderTiles(provider = "CartoDB.Positron") |> 
  setView(curitiba_center[[1]], curitiba_center[[2]], zoom = 15)