1. Configuración y Carga de Datos

datos_originales <- readr::read_csv2("C:/Users/cordo/OneDrive/Desktop/ESTADISITCA/Oil__Gas____Other_Regulated_Wells__Beginning_1860.csv")

2. Extracción y Limpieza de la Variable

tdf_seguridad <- datos_originales %>%
  select(`Financial Security`) %>%
  filter(!is.na(`Financial Security`)) %>%
  mutate(Seguridad = trimws(`Financial Security`)) %>%
  group_by(Seguridad) %>%
  summarise(Fi = n()) %>%
  arrange(desc(Fi)) %>%
  mutate(hi = Fi / sum(Fi), Pi = hi * 100, Fi_ac = cumsum(Fi), hi_ac = cumsum(hi))

3. Identificación de la Variable

  • Variable: FINANCIAL_SECURITY (Seguridad Financiera).
  • Tipo: Cualitativa Nominal.
  • Descripción: Tipo de garantía o seguridad financiera asociada al pozo.

4. Tabla de Distribución de Frecuencias

TABLA 1. Distribución de Frecuencias de Pozos por Seguridad Financiera
Seguridad Financiera Frec. Absoluta (Fi) Frec. Relativa (hi) Porcentaje (%) Frec. Abs. Acumulada (Fi_ac) Frec. Rel. Acumulada (hi_ac)
FALSE 32860 0.6935562 69.35562 32860 0.6935562
TRUE 14519 0.3064438 30.64438 47379 1.0000000
Fuente: Oil & Gas & Other Regulated Wells - Beginning 1860

5. Representación Gráfica

Gráfica N°1: Frecuencia Absoluta

ggplot(tdf_seguridad, aes(x = reorder(Seguridad, -Fi), y = Fi, fill = Seguridad)) +
  geom_bar(stat = "identity", show.legend = FALSE) +
  geom_text(aes(label = Fi), vjust = -0.5, size = 5, family = "Lora") +
  scale_fill_manual(values = paleta_azul) +
  theme_minimal(base_family = "Lora") +
  labs(x = "Seguridad Financiera", y = "Frecuencia Absoluta (Fi)") +
  theme(plot.title = element_blank(), axis.title = element_text(size = 16), 
        axis.text = element_text(size = 12), axis.text.x = element_text(angle = 45, hjust = 1))

Gráfica N°2: Distribución Porcentual

ggplot(tdf_seguridad, aes(x = reorder(Seguridad, -Pi), y = Pi, fill = Seguridad)) +
  geom_bar(stat = "identity", show.legend = FALSE) +
  geom_text(aes(label = paste0(round(Pi, 1), "%")), vjust = -0.5, size = 5, family = "Lora") +
  scale_fill_manual(values = paleta_azul) +
  theme_minimal(base_family = "Lora") +
  labs(x = "Seguridad Financiera", y = "Porcentaje (%)") +
  theme(plot.title = element_blank(), axis.title = element_text(size = 16), 
        axis.text = element_text(size = 12), axis.text.x = element_text(angle = 45, hjust = 1))

Gráfica N°3: Distribución Porcentual

plot_data <- tdf_seguridad %>% mutate(label_leyenda = paste0(Seguridad, " (", round(Pi, 1), "%)"))
ggplot(plot_data, aes(x = "", y = Pi, fill = label_leyenda)) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar("y", start = 0) +
  scale_fill_manual(values = paleta_azul) +
  theme_void(base_family = "Lora") +
  theme(legend.position = "right", legend.text = element_text(size = 12)) +
  guides(fill = guide_legend(title = "Seguridad Financiera"))

6. Tabla de Indicadores

TABLA 2. Indicadores Estadísticos
Indicador Valor
Total de Pozos (N) 47,379
Seguridad Modal FALSE
Porcentaje de la Moda 69.36%
Autor: Jennifer Cordones

7. Conclusión

  • La garantía financiera tipo FALSE es la más frecuente, representando el 69.4% de los casos registrados.
  • Esta distribución refleja las políticas de cumplimiento y respaldo económico vigentes para la regulación de los pozos en la cuenca bajo estudio.