Se llaman los paquetes y base de ENDES desde el 2014-2023 con las 19 variables seleccionadas.

## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
## Cargando paquete requerido: emmeans
## 
## Welcome to emmeans.
## Caution: You lose important information if you filter this package's results.
## See '? untidy'
## 
## Cargando paquete requerido: ggformula
## 
## Cargando paquete requerido: scales
## 
## 
## Adjuntando el paquete: 'scales'
## 
## 
## The following object is masked from 'package:purrr':
## 
##     discard
## 
## 
## The following object is masked from 'package:readr':
## 
##     col_factor
## 
## 
## Cargando paquete requerido: ggridges
## 
## 
## New to ggformula?  Try the tutorials: 
##  learnr::run_tutorial("introduction", package = "ggformula")
##  learnr::run_tutorial("refining", package = "ggformula")
## 
## Cargando paquete requerido: gtsummary
## 
## Cargando paquete requerido: huxtable
## 
## 
## Adjuntando el paquete: 'huxtable'
## 
## 
## The following object is masked from 'package:gtsummary':
## 
##     as_flextable
## 
## 
## The following object is masked from 'package:scales':
## 
##     number_format
## 
## 
## The following object is masked from 'package:dplyr':
## 
##     add_rownames
## 
## 
## The following object is masked from 'package:ggplot2':
## 
##     theme_grey
## 
## 
## Cargando paquete requerido: magrittr
## 
## 
## Adjuntando el paquete: 'magrittr'
## 
## 
## The following object is masked from 'package:purrr':
## 
##     set_names
## 
## 
## The following object is masked from 'package:tidyr':
## 
##     extract
## Warning: package 'sf' was built under R version 4.4.2
## Linking to GEOS 3.13.0, GDAL 3.10.1, PROJ 9.5.1; sf_use_s2() is TRUE
## Cargando paquete requerido: sda
## Cargando paquete requerido: entropy
## Cargando paquete requerido: corpcor
## Cargando paquete requerido: fdrtool
## Warning: package 'geodata' was built under R version 4.4.2
## Cargando paquete requerido: terra
## terra 1.7.78
## 
## Adjuntando el paquete: 'terra'
## 
## The following object is masked from 'package:sda':
## 
##     centroids
## 
## The following object is masked from 'package:ggmosaic':
## 
##     mosaic
## 
## The following objects are masked from 'package:magrittr':
## 
##     extract, inset
## 
## The following objects are masked from 'package:huxtable':
## 
##     align, width, wrap
## 
## The following object is masked from 'package:scales':
## 
##     rescale
## 
## The following object is masked from 'package:tidyr':
## 
##     extract
## 
## 
## Adjuntando el paquete: 'rstatix'
## 
## The following object is masked from 'package:stats':
## 
##     filter
## Warning: package 'DescTools' was built under R version 4.4.2
## 
## Adjuntando el paquete: 'patchwork'
## 
## The following object is masked from 'package:terra':
## 
##     area
## Warning: NAs introducidos por coerción

Análisis exploratorio


2014, N = 24,872

2015, N = 35,766

2016, N = 33,135

2017, N = 22,753

2018, N = 24,312

2019, N = 33,311

2020, N = 16,438

2021, N = 34,051

2022, N = 35,787

2023, N = 14,999

Overall, N = 275,424

niv_educ
0610 (2.5%)767 (2.1%)702 (2.1%)380 (1.7%)422 (1.7%)608 (1.8%)238 (1.4%)439 (1.3%)442 (1.2%)186 (1.2%)4,794 (1.7%)
15,707 (23%)7,896 (22%)6,958 (21%)4,458 (20%)4,564 (19%)6,057 (18%)2,820 (17%)6,964 (20%)7,221 (20%)2,986 (20%)55,631 (20%)
211,440 (46%)17,094 (48%)15,719 (47%)10,888 (48%)11,357 (47%)15,679 (47%)7,929 (48%)16,726 (49%)17,856 (50%)7,472 (50%)132,160 (48%)
37,115 (29%)10,009 (28%)9,756 (29%)7,027 (31%)7,969 (33%)10,967 (33%)5,451 (33%)9,922 (29%)10,268 (29%)4,355 (29%)82,839 (30%)
indice_rique
15,855 (24%)8,494 (24%)7,566 (23%)5,616 (25%)6,174 (25%)8,685 (26%)3,975 (24%)9,942 (29%)10,494 (29%)4,477 (30%)71,278 (26%)
25,899 (24%)8,855 (25%)8,473 (26%)6,269 (28%)6,630 (27%)8,625 (26%)4,112 (25%)8,711 (26%)9,297 (26%)3,823 (25%)70,694 (26%)
35,219 (21%)7,391 (21%)7,115 (21%)4,948 (22%)5,154 (21%)6,816 (20%)3,525 (21%)6,529 (19%)7,139 (20%)2,968 (20%)56,804 (21%)
44,306 (17%)6,232 (17%)5,877 (18%)3,672 (16%)3,760 (15%)5,290 (16%)2,706 (16%)5,240 (15%)5,278 (15%)2,321 (15%)44,682 (16%)
53,593 (14%)4,794 (13%)4,104 (12%)2,248 (9.9%)2,594 (11%)3,895 (12%)2,120 (13%)3,629 (11%)3,579 (10%)1,410 (9.4%)31,966 (12%)
conocimiento_vih
01,323 (5.3%)1,262 (3.5%)1,018 (3.1%)690 (3.0%)732 (3.0%)998 (3.0%)407 (2.5%)1,436 (4.2%)1,564 (4.4%)674 (4.5%)10,104 (3.7%)
1836 (3.4%)1,179 (3.3%)1,045 (3.2%)670 (2.9%)853 (3.5%)1,240 (3.7%)499 (3.0%)1,045 (3.1%)1,114 (3.1%)451 (3.0%)8,932 (3.2%)
22,072 (8.3%)2,835 (7.9%)2,335 (7.0%)1,729 (7.6%)2,102 (8.6%)2,771 (8.3%)1,235 (7.5%)2,460 (7.2%)2,691 (7.5%)1,248 (8.3%)21,478 (7.8%)
34,963 (20%)6,915 (19%)6,000 (18%)4,230 (19%)4,611 (19%)6,294 (19%)3,162 (19%)6,554 (19%)6,774 (19%)2,896 (19%)52,399 (19%)
49,568 (38%)13,711 (38%)12,795 (39%)8,797 (39%)9,337 (38%)12,773 (38%)6,819 (41%)13,834 (41%)14,679 (41%)5,967 (40%)108,280 (39%)
56,110 (25%)9,864 (28%)9,942 (30%)6,637 (29%)6,677 (27%)9,235 (28%)4,316 (26%)8,722 (26%)8,965 (25%)3,763 (25%)74,231 (27%)

EDAD:

La distribución de edad es simétrica con una media, moda y mediana muy cercanas, describiendo una distribución casi normal.

Distribución de la edad por nivel educativo

En esta población de aprecia que las personas alfabetas tienen un promedio de edad mayor con una media superior a 40 años. Los que estudiaron primaria, tienen también una edad adulta con una mediana superior a 35. Quienes estudiaron secundaria son los más jóvenes en promedio con una mediana cercana a 25 años. Finalmente quienes estudiaron un nivel superior tienen una mediana cercana a 30 años. La tendencia indica que los menores estudiaron secundaria y están estudiando también niveles superiores.

Se observa que predomina el mal conocimiento en todas las regiones. Sin embargo, San Martín, Junín, Apurímac, Amazonas y Piura, tienen al rededor de 1/3 a 1/4 de buen conocimiento.

Conocimiento de VIH según Índice de riqueza

## Warning: The `scale_name` argument of `continuous_scale()` is deprecated as of ggplot2
## 3.5.0.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: The `trans` argument of `continuous_scale()` is deprecated as of ggplot2 3.5.0.
## ℹ Please use the `transform` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: `unite_()` was deprecated in tidyr 1.2.0.
## ℹ Please use `unite()` instead.
## ℹ The deprecated feature was likely used in the ggmosaic package.
##   Please report the issue at <https://github.com/haleyjeppson/ggmosaic>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Se observa que mientras más aumenta el índice de riqueza, mayor es el conocimiento de VIH, pues se responden más preguntas adecuadamente.

Conocimiento de VIH según Nivel educativo

Se observa que a mayor nivel educativo, hay más conocimiento de VIH pues se reponden más preguntas adecuadamente.

Conocimiento de VIH

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

El nivel de conocimiento predominante es de 4 respuestas correctas. La UNAIDS clasifica bajo conocimiento con 4 o menos respuestas correctas. Sin embargo se puede evaluar de acuerdo a las preguntas individuales para ver en los temas que se debe reforzar.

Conocimiento de VIH por pregunta

Mapas de distribución por regiones y por años

Conocimiento VIH

Se calcularon los promedios de la cantidad de preguntas respondidas adecuadamente. Respondieron a 5 preguntas:

## Reading layer `DEPARTAMENTOS' from data source 
##   `C:\Users\cayetano\Box\MCEIT\Tesis\R\Rtesis\Bases\DEPARTAMENTOS\DEPARTAMENTOS.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 25 features and 4 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -81.32823 ymin: -18.35093 xmax: -68.65228 ymax: -0.03860597
## Geodetic CRS:  WGS 84

Índice de riqueza

Se calcularon los promedios del índice de riqueza que va del 1-5.

  1. Los más pobres
  2. Pobre
  3. Medio
  4. Rico
  5. Más rico

Por regiones y por años:

Nivel educativo

Se calcularon los promedios del nivel educativo que va del 0-3.

  1. Sin educación
  2. Primario
  3. Secundario
  4. Superior

Por regiones y por años:

```{r}