Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions R/cs_upsetplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ cs_upsetplot <- function(data.EIR, data.schedule, birth_cohort, denominator = NU
# Step 2: Create empty columns and fill them if the child has the vaccine
# in dose_list
line_list[doses_in_schedule] <- FALSE
# pad the whole list with commas so we can search for the ",dose," string
# explicitly
padded_dose_list <- paste0(",", line_list$dose_list, ",")
for (dose in doses_in_schedule) {
# NOTE: Use \\b to detect word boundaries
line_list[[dose]] <- str_detect(line_list$dose_list, paste0("\\b", dose, "\\b"))
line_list[[dose]] <- str_detect(padded_dose_list, fixed(paste0(",", dose, ",")))
}

# check if anyone has a complete schedule to know if we have to highlight
Expand Down
42 changes: 42 additions & 0 deletions README.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# PAHOabc <img src="man/figures/logo.png" align="right" height="138" />

> 🌐 [**Read this in English**](https://im-data-paho.github.io/pahoabc/index.html)

PAHOabc es un paquete de R orientado a análisis de inmunización más allá de la cobertura (*(A)nalysis (B)eyond (C)overage*).

PAHOabc busca apoyar la misión de la Unidad de Inmunización Integral (CIM) de la Organización Panamericana de la Salud (OPS) con herramientas de análisis de datos para los programas de inmunización en las Américas. En concreto, facilita el cálculo de indicadores más allá de la cobertura básica, apoya la toma de decisiones basada en evidencia mediante la exploración y visualización de datos, y contribuye a fortalecer las capacidades de los programas de inmunización para aprovechar mejor sus datos.

Para la documentación y las viñetas, consulte: [https://im-data-paho.github.io/pahoabc](https://im-data-paho.github.io/pahoabc).

## Instalación

```r
# Instalar desde GitHub
devtools::install_github("IM-Data-PAHO/pahoabc")
```

## Uso

Actualmente, PAHOabc contiene cuatro módulos principales. Siga los enlaces a continuación para explorar viñetas detalladas con ejemplos prácticos y orientación sobre cómo usar cada módulo:

1. [**Tasa de abandono nominal**](https://im-data-paho.github.io/pahoabc/articles/es/nominal_dropout_es.html)
Calcula las tasas de abandono entre cualquier par de dosis de vacunas utilizando datos nominales. Este módulo permite dar seguimiento a la continuidad de las personas dentro de un esquema de vacunación.

2. [**Análisis de residencia vs. lugar de vacunación**](https://im-data-paho.github.io/pahoabc/articles/es/residence_occurrence_es.html)
Funciones para comparar la cobertura de vacunación y la distribución de dosis según el lugar donde viven las personas y el lugar donde fueron vacunadas. Este módulo ayuda a identificar flujos poblacionales y posibles brechas en la cobertura de los servicios entre áreas geográficas.

3. [**Cobertura de esquema completo**](https://im-data-paho.github.io/pahoabc/articles/es/complete_schedule_es.html)
Evalúa si las personas han recibido todas las dosis requeridas en un esquema nacional de vacunación, para una cohorte específica hasta una edad determinada. Este módulo se diferencia del cálculo de cobertura estándar porque evalúa el cumplimiento del esquema persona por persona.

4. [**Cobertura por cohorte de nacimiento**](https://im-data-paho.github.io/pahoabc/articles/es/birth_cohort_coverage_es.html)
Permite dar seguimiento y visualizar el estado de vacunación de una cohorte específica de recién nacidos. Ayuda a evaluar la protección de la población frente a las enfermedades prevenibles por vacunación.

Cada módulo funciona con los conjuntos de datos de ejemplo incluidos en el paquete. Estos datos facilitan probar las funciones y sirven de referencia al preparar sus propios datos. Conozca más sobre estos conjuntos de datos de ejemplo [en esta viñeta](https://im-data-paho.github.io/pahoabc/articles/es/example_datasets_es.html).

> **Nota**
>
> Puede explorar todas las viñetas disponibles haciendo clic en el botón **Guides** (Guías) de la barra de navegación.

## Contribuir

Agradecemos sugerencias, reportes de errores y solicitudes de nuevas funciones a través de la página de [incidencias de GitHub](https://github.com/IM-Data-PAHO/pahoabc/issues). Si desea contribuir con código o correcciones, puede abrir una [solicitud de incorporación de cambios](https://github.com/IM-Data-PAHO/pahoabc/pulls).
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# PAHOabc <img src="man/figures/logo.png" align="right" height="138" />

> 🌐 [**Lea esto en español**](https://im-data-paho.github.io/pahoabc/README.es.html)

PAHOabc is an R package aimed at immunization (A)nalyses (B)eyond (C)overage.

PAHOabc aims to support the Pan American Health Organization's (PAHO) Comprehensive Immunization Unit (CIM) mission by providing advanced data analysis tools for immunization programs in the Americas. Specifically, it facilitates the calculation of innovative indicators beyond basic coverage, supports evidence-based decision-making through in-depth data exploration and visualization, and contributes to strengthening data capabilities within immunization programs by empowering human resources to effectively leverage their data.
Expand All @@ -15,21 +17,21 @@ devtools::install_github("IM-Data-PAHO/pahoabc")

## Usage

Currently, PAHOabc contains three main modules. Follow the links below to explore detailed vignettes with practical examples and guidance on how to use each module:
Currently, PAHOabc contains four main modules. Follow the links below to explore detailed vignettes with practical examples and guidance on how to use each module:

1. [**Nominal Dropout Rate**](https://im-data-paho.github.io/pahoabc/articles/nominal_dropout_en.html)
1. [**Nominal Dropout Rate**](https://im-data-paho.github.io/pahoabc/articles/en/nominal_dropout_en.html)
Calculates dropout rates between any two vaccine doses using nominal data. This module ensures accurate follow-up tracking across a vaccination schedule.

2. [**Residence vs. Occurrence Analyses**](https://im-data-paho.github.io/pahoabc/articles/residence_occurrence_en.html)
2. [**Residence vs. Occurrence Analyses**](https://im-data-paho.github.io/pahoabc/articles/en/residence_occurrence_en.html)
Functions for comparing vaccination coverage and dose distribution based on where people live versus where they were vaccinated. This module helps identify population movement and service coverage gaps across geographic areas.

3. [**Complete Schedule Coverage**](https://im-data-paho.github.io/pahoabc/articles/complete_schedule_en.html)
3. [**Complete Schedule Coverage**](https://im-data-paho.github.io/pahoabc/articles/en/complete_schedule_en.html)
Evaluates whether individuals have received all required doses in a national immunization schedule (for a specific cohort up to a specified age). This module differs from standard coverage calculation as it evaluates each individual's compliance of the national immunization schedule.

4. [**Birth Cohort Coverage**](https://im-data-paho.github.io/pahoabc/articles/birth_cohort_coverage_en.html)
4. [**Birth Cohort Coverage**](https://im-data-paho.github.io/pahoabc/articles/en/birth_cohort_coverage_en.html)
Lets users track and visualize vaccination status among a specific cohort of newborns. Helps evaluate population-level protection against vaccine-preventable diseases.

Each module works seamlessly with the example datasets provided in the package. These examples make it easy to test out the functionality and serve as a reference when preparing your own data. Learn more about these example datasets [in this vignette](https://im-data-paho.github.io/pahoabc/articles/example_datasets_en.html).
Each module works seamlessly with the example datasets provided in the package. These examples make it easy to test out the functionality and serve as a reference when preparing your own data. Learn more about these example datasets [in this vignette](https://im-data-paho.github.io/pahoabc/articles/en/example_datasets_en.html).

> **Note**
>
Expand Down
10 changes: 5 additions & 5 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ navbar:
menu:
- text: Modules
- text: Nominal Dropout Rate
href: articles/nominal_dropout_en.html
href: articles/en/nominal_dropout_en.html
- text: Residence vs. Occurrence Analyses
href: articles/residence_occurrence_en.html
href: articles/en/residence_occurrence_en.html
- text: Complete Schedule Coverage
href: articles/complete_schedule_en.html
href: articles/en/complete_schedule_en.html
- text: Birth Cohort Coverage
href: articles/birth_cohort_coverage_en.html
href: articles/en/birth_cohort_coverage_en.html
- text: Date Consistency Comparison
href: articles/date_consistency_comparison_en.html
- text: -------
- text: Other guides
- text: Using our Example Datasets
href: articles/example_datasets_en.html
href: articles/en/example_datasets_en.html

authors:
Pan American Health Organization:
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ output:
toc_depth: 2
---

<a href="../es/birth_cohort_coverage_es.html" class="btn btn-outline-primary" role="button">🌐 Lea esto en español</a>

```{r setup, include = FALSE, message = FALSE, warning = FALSE}
library(pahoabc)
library(dplyr)
Expand All @@ -23,16 +25,16 @@ library(knitr)

The objective of this indicator is to monitor a specific birth cohort of newborns to determine their vaccination status and estimate the level of population protection against vaccine-preventable diseases. This analysis is essential for preventing the accumulation of susceptible individuals, maximizing herd immunity, and developing targeted vaccination strategies for those who have not received the necessary doses.

Vaccination coverage by birth cohort is calculates using the following formula:
Vaccination coverage by birth cohort is calculated using the following formula:

$$
\text{Coverage by birth cohort (\%)} =
\frac{\text{# of vaccines administered to people in a specific birth cohort}}{\text{Total people in the specific birth cohort}} \times 100
\frac{\text{# of people vaccinated in a specific birth cohort}}{\text{Total people in the specific birth cohort}} \times 100
$$

> **Note**
>
> All functions used for complete schedule coverage analyses within PAHOabc begin with the `bc_` prefix.
> All functions used for birth cohort coverage analyses within PAHOabc begin with the `bc_` prefix.

# Glossary

Expand Down Expand Up @@ -92,7 +94,7 @@ pahoabc.schedule %>% kable(caption = "Example Immunization Schedule")

### Population Denominators

While not mandatory, this module will lets you provide a population table to use as denominator for the coverage calculation. The geographic level of this table will be directly dependent on the geographic level of your analysis. For example, if you were to perform an analysis at ADM1 level, the required population denominator table must contain the following.
While not mandatory, this module lets you provide a population table to use as denominator for the coverage calculation. The geographic level of this table will be directly dependent on the geographic level of your analysis. For example, if you were to perform an analysis at ADM1 level, the required population denominator table must contain the following.

```{r pahoabc-pop-ADM1, message=FALSE}
pahoabc.pop.ADM1 %>% head() %>% kable(caption = "Example Population at ADM1")
Expand Down Expand Up @@ -140,7 +142,7 @@ We can visually observe these results by calling the `bc_barplot()` function as

```{r cov-viz-example, message=FALSE, fig.width=12, fig.height=6}

# visualize output from cs_coverage()
# visualize output from bc_coverage()
coverage_plot <- bc_barplot(data = coverage_df, vaccine = "SRP1")

# show
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ output:
toc_depth: 2
---

<a href="../es/complete_schedule_es.html" class="btn btn-outline-primary" role="button">🌐 Lea esto en español</a>

```{r setup, include = FALSE, message = FALSE, warning = FALSE}
library(pahoabc)
library(dplyr)
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ output:
toc_depth: 2
---

<a href="../es/example_datasets_es.html" class="btn btn-outline-primary" role="button">🌐 Lea esto en español</a>

```{r setup, include = FALSE, message = FALSE, warning = FALSE}
library(pahoabc)
library(dplyr)
Expand Down Expand Up @@ -41,7 +43,7 @@ Namely, PAHOabc can distinguish three administrative levels, which listed from t

Our example datasets use a specific naming convention for the vaccine doses. This might not match your own naming schemes, but it will not affect the usage of the package as long as you make sure to be consistent when naming vaccine doses.

For example, the vaccine names used in the PAHOabc package are:
For example, the vaccine names used in the PAHOabc example datasets are:

| Abbreviation | Full Name |
|--------------|------------------------------------------------------------------|
Expand Down
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ output:
toc_depth: 2
---

<a href="../es/nominal_dropout_es.html" class="btn btn-outline-primary" role="button">🌐 Lea esto en español</a>

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(pahoabc)
Expand All @@ -23,9 +25,14 @@ library(knitr)

# Rationale

The dropout rate is an indicator used to evaluate the loss of follow-up in vaccination schedules. It reflects the percentage of individuals who did not receive a final dose (i.e, DTP3) among those who received an initial dose (i.e, DTP1). In aggregated systems, it is estimated using the following formula:
The dropout rate is an indicator used to evaluate the loss of follow-up in vaccination schedules. It reflects the percentage of individuals who did not receive a final dose (i.e., DTP3) among those who received an initial dose (i.e., DTP1). In aggregated systems, it is estimated using the following formula:

$$
\text{Dropout rate (\%)} =
\frac{\text{DTP1 doses administered} - \text{DTP3 doses administered}}{\text{DTP1 doses administered}} \times 100
$$

Performing the analysis with aggregated data does not guarantee that the individuals who received both doses are the same, as shown in Figure 1a. Electronic nominal vaccination records enable a person-to-person analysis, ensuring that the individuals who received both doses are indeed the same, as illustrated in Figure 1b.
Performing the analysis with aggregated data does not guarantee that the individuals who received both doses are the same, as shown in Figure 1A. Electronic nominal vaccination records enable a person-to-person analysis, ensuring that the individuals who received both doses are indeed the same, as illustrated in Figure 1B.

![Figure 1. Visual representation of a nominal dropout analysis.](nod_rationale.png)

Expand Down Expand Up @@ -97,7 +104,7 @@ pahoabc.EIR %>% head() %>% kable(caption = "Example Electronic Immunization Regi

## Nominal Dropout Analysis

PAHOabc includes the functionality to estimate the nominal dropout rate, on a per-person basis. This allows for the analysis of any pair of doses by specifying an initial dose and a final dose. For correct interpretation, the initial dose must precede the final dose in the vaccination schedule, for example: DTP1 – DTP3 or DTP1 – MCV. Additionally, it allows users to select the level of aggregation for the results, which can be at the national level or subnational levels (ADM1 or ADM2).
PAHOabc includes the functionality to estimate the nominal dropout rate, on a per-person basis. This allows for the analysis of any pair of doses by specifying an initial dose and a final dose. For correct interpretation, the initial dose must precede the final dose in the vaccination schedule, for example: DTP1 – DTP3 or DTP1 – MCV1. Additionally, it allows users to select the level of aggregation for the results, which can be at the national level or subnational levels (ADM1 or ADM2).

### Expected workflow

Expand Down Expand Up @@ -127,13 +134,13 @@ example_dropout %>%

#### Parameters accepted

- `data`: R Structured dataframe with the variables listed above.\
- `data.EIR`: R Structured dataframe with the variables listed above.\
- `vaccine_init`: The name (string) of the vaccine to use as the start point of the analysis as stored in the **dose** column of the dataframe.\
- `vaccine_end`: The name (string) of the vaccine to use as the end point of the analysis as stored in the **dose** column of the dataframe.\
- `geo_level`: Administrative level to use, this is an optional parameter. Can be "ADM0", "ADM1" or "ADM2" as strings. Defaults to "ADM0" if ignored.
- `birth_cohorts` (years): Parameter to segment the analysis based on the year of birth of the persons in the dataframe. This function uses the `date_birth` column in the dataframe and can be a single year or a vector of years.
- `birth_cohorts`: Parameter to segment the analysis based on the year of birth of the persons in the dataframe. It is based on the `date_birth` column in the dataframe and can be a single year or a vector of years.

The `data`, `vaccine_init`, `vaccine_end` parameters are mandatory. `geo_level` and `birth_cohorts` are optional and help to segment the data for more precise analyses.
The `data.EIR`, `vaccine_init`, `vaccine_end` parameters are mandatory. `geo_level` and `birth_cohorts` are optional and help to segment the data for more precise analyses.

Check the documentation of the function using `?nod_dropout()` in R for additional information.

Expand All @@ -152,9 +159,9 @@ example_dropout_plot

The function `nod_barplot()` accepts the following parameters:

- `data`: Dataframe` formatted from the result of the `nod_dropout()` function.
- `data`: Dataframe formatted from the result of the `nod_dropout()` function.
- `order`: Organizes the bars based on three options: "alpha", "desc" or "asc", default is "alpha".
- `within_ADM1` Allows to filter within an ADM1 to filter and display only the ADM2 data corresponding to the specified ADM1.
- `within_ADM1`: Allows to filter within an ADM1 and display only the ADM2 data corresponding to the specified ADM1.

#### Interpretation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ output:
toc_depth: 2
---

<a href="../es/residence_occurrence_es.html" class="btn btn-outline-primary" role="button">🌐 Lea esto en español</a>

```{r setup, include = FALSE, message = FALSE, warning = FALSE}
library(pahoabc)
library(dplyr)
Expand Down Expand Up @@ -299,12 +301,12 @@ As an example, it is notable that among all individuals residing in ADM2_3_10 wh

Looking at the heatmap horizontally, we can see that ADM2_3_20 provides vaccinations to a large number of people coming from other areas: 35% of those from ADM2_3_7, 18% from ADM2_3_15, 17% from ADM2_3_12, 14% from ADM2_3_17, etc.

The top row is also interesting, since it indicates people getting vaccinated outside of ADM1_3 entirely. For example, in column 4, 85% of the residents of ADM3_3_13 get vaccinated outside of ADM1_3, suggesting a strong population flow.
The top row is also interesting, since it indicates people getting vaccinated outside of ADM1_3 entirely. For example, in column 4, 85% of the residents of ADM2_3_13 get vaccinated outside of ADM1_3, suggesting a strong population flow.

# Summary

This vignette showed how you can use the PAHOabc package to compare vaccination coverage by place of residence and place of occurrence, and to explore how people move between areas to get vaccinated.

We saw that coverage can vary a lot depending on which location you use, and in some cases, coverage by occurrence can go over 100% — a sign that people are coming from elsewhere to get vaccinated. The distribution and heatmap functions help visualize these patterns and can reveal which areas act as service hubs or where people are going for vaccines.
We saw that coverage can vary a lot depending on which location you use, and in some cases, coverage by occurrence can go over 100% — a sign that people may be coming from elsewhere to get vaccinated. The distribution and heatmap functions help visualize these patterns and can reveal which areas act as service hubs or where people are going for vaccines.

Overall, this kind of analysis helps make sense of population flows and supports better planning for immunization programs.
Loading
Loading