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

top_n_cat <- 12
tdf_formacion <- datos_originales %>%
  select(`Objective Formation`) %>%
  filter(!is.na(`Objective Formation`)) %>%
  mutate(Formacion = trimws(`Objective Formation`)) %>%
  group_by(Formacion) %>%
  summarise(Fi = n()) %>%
  arrange(desc(Fi)) %>%
  mutate(Cat_Plot = ifelse(row_number() <= top_n_cat, Formacion, "Otras"),
         Cat_Plot = fct_relevel(as.factor(Cat_Plot), "Otras", after = Inf)) %>%
  group_by(Cat_Plot) %>%
  summarise(Fi = sum(Fi)) %>%
  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: OBJECTIVE_FORMATION (Formación Objetivo).
  • Tipo: Cualitativa Nominal.
  • Descripción: Unidad geológica objetivo para la perforación.

4. Tabla de Distribución de Frecuencias

TABLA 1. Distribución de Frecuencias de Pozos por Formación
Formación Frec. Absoluta (Fi) Frec. Relativa (hi) Porcentaje (%) Frec. Abs. Acumulada (Fi_ac) Frec. Rel. Acumulada (hi_ac)
Medina 5527 0.3836063 38.360633 5527 0.3836063
Otras 1962 0.1361743 13.617435 7489 0.5197807
Bradford 1072 0.0744031 7.440311 8561 0.5941838
Richburg 1008 0.0699611 6.996113 9569 0.6641449
Upper Devonian 793 0.0550389 5.503887 10362 0.7191838
Fulmer Valley 786 0.0545530 5.455303 11148 0.7737368
Queenston 782 0.0542754 5.427540 11930 0.8280122
Bradford Third 630 0.0437257 4.372571 12560 0.8717379
Black River 465 0.0322737 3.227374 13025 0.9040117
Salina 394 0.0273459 2.734592 13419 0.9313576
Bradford Second 352 0.0244309 2.443087 13771 0.9557885
Glade 330 0.0229039 2.290394 14101 0.9786924
Oriskany 307 0.0213076 2.130761 14408 1.0000000
Fuente: Oil & Gas & Other Regulated Wells - Beginning 1860

5. Representación Gráfica

5.1. Frecuencia Absoluta

ggplot(tdf_formacion, aes(x = Cat_Plot, y = Fi, fill = Cat_Plot)) +
  geom_bar(stat = "identity", show.legend = FALSE) +
  geom_text(aes(label = Fi), vjust = -0.5, size = 6, family = "Lora") +
  scale_fill_manual(values = paleta_azul) +
  theme_minimal(base_family = "Lora") +
  labs(title = "Gráfica N°1: Frecuencia Absoluta", x = "Formación", y = "N° de Pozos") +
  theme(plot.title = element_text(size = 22, face = "bold"),
        axis.title = element_text(size = 18), axis.text = element_text(size = 14),
        axis.text.x = element_text(angle = 45, hjust = 1))

5.2. Distribución Porcentual (Barras)

ggplot(tdf_formacion, aes(x = reorder(Cat_Plot, -Pi), y = Pi, fill = Cat_Plot)) +
  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 = "Formación", 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))

5.3. Diagrama Circular

plot_data <- tdf_formacion %>% mutate(label_leyenda = paste0(Cat_Plot, " (", 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 = "Formación"))

6. Tabla de Indicadores

TABLA 2. Indicadores Estadísticos
Indicador Valor
Total de Pozos (N) 14,408
Formación Modal Medina
Porcentaje de la Moda 38.36%
Autor: Jennifer Cordones

7. Conclusión

  • La formación Medina es el objetivo predominante, concentrando el 38.4% de la actividad.
  • La concentración en un grupo selecto de formaciones subraya la necesidad de estandarizar los procesos operativos para estas unidades geológicas.