datos_originales <- readr::read_delim(
ruta, delim=delimitador, trim_ws=TRUE, show_col_types=FALSE,
name_repair="minimal", col_types=readr::cols(.default=readr::col_character())
)
## Carga exitosa: 47.501 registros.
formacion_productora_limpia <- datos_originales |>
dplyr::transmute(FormacionProductora=stringr::str_squish(as.character(.data[[columna_formacion]]))) |>
dplyr::filter(!is.na(FormacionProductora), FormacionProductora != "",
!toupper(FormacionProductora) %in% c("NA", "N/A", "NULL"))
N <- nrow(formacion_productora_limpia)
if (N == 0L) stop("No hay registros válidos de PRODUCING_FORMATION.")
k_formaciones <- dplyr::n_distinct(formacion_productora_limpia$FormacionProductora)
cat("Registros válidos:", fmt_entero(N),
" | Formaciones productoras distintas:", fmt_entero(k_formaciones), "\n")
## Registros válidos: 33.013 | Formaciones productoras distintas: 80
| VARIABLE | TIPO | ESCALA DE MEDICIÓN | UNIDAD DE ANÁLISIS | CATEGORÍAS (k) | REGISTROS VÁLIDOS (N) |
|---|---|---|---|---|---|
| PRODUCING_FORMATION (Formación productora) | Cualitativa nominal | Nominal | Pozo regulado | 80 | 33.013 |
El Cuadro N° 1 presenta la frecuencia absoluta (nᵢ), la frecuencia relativa (hᵢ) y el porcentaje de cada una de las 80 formaciones productoras, considerando 33.013 registros válidos. Desplázate dentro de la tabla para consultar todas las categorías.
cat(crear_cuadro(tabla_frecuencias, 1,
"Distribución de frecuencias de los pozos regulados según la formación productora, Nueva York, 1860 - 2026",
desplazamiento=(k_formaciones > 15L)))
| FORMACIÓN PRODUCTORA | FRECUENCIA ABSOLUTA (nᵢ) | FRECUENCIA RELATIVA (hᵢ) | FRECUENCIA RELATIVA PORCENTUAL (%) |
|---|---|---|---|
| Lorraine | 1 | 0.0000 | 0.00% |
| Niagara | 25 | 0.0008 | 0.08% |
| Little Falls | 1 | 0.0000 | 0.00% |
| Oneida-Oswego | 11 | 0.0003 | 0.03% |
| Black River | 157 | 0.0048 | 0.48% |
| Helderberg | 26 | 0.0008 | 0.08% |
| NA - Geoexchange | 5 | 0.0002 | 0.02% |
| Retsof | 1 | 0.0000 | 0.00% |
| Chipmunk, Bradford 1st,2nd,3rd | 157 | 0.0048 | 0.48% |
| Bradford 2nd & 3rd | 79 | 0.0024 | 0.24% |
| Penny & Fulmer Valley | 243 | 0.0074 | 0.74% |
| Chipmunk, Bradford 1st & 2nd | 84 | 0.0025 | 0.25% |
| Inwood Marble | 6 | 0.0002 | 0.02% |
| Bradford Third | 617 | 0.0187 | 1.87% |
| Precambrian | 1 | 0.0000 | 0.00% |
| Wappinger Limestone | 2 | 0.0001 | 0.01% |
| Laona | 1 | 0.0000 | 0.00% |
| Sodus Shale | 1 | 0.0000 | 0.00% |
| Beekmantown Group | 2 | 0.0001 | 0.01% |
| Rochester Shale | 1 | 0.0000 | 0.00% |
| Medina | 8.829 | 0.2674 | 26.74% |
| Waugh & Porter | 250 | 0.0076 | 0.76% |
| Bradford 1st & 2nd | 3 | 0.0001 | 0.01% |
| Onondaga-Bass Island | 2 | 0.0001 | 0.01% |
| Bass Island | 107 | 0.0032 | 0.32% |
| Whirlpool | 36 | 0.0011 | 0.11% |
| Hamilton | 21 | 0.0006 | 0.06% |
| Marcellus | 50 | 0.0015 | 0.15% |
| Upper Devonian Shale | 8 | 0.0002 | 0.02% |
| Vernon | 26 | 0.0008 | 0.08% |
| Bradford 1st & Chipmunk | 8 | 0.0002 | 0.02% |
| Potsdam | 5 | 0.0002 | 0.02% |
| Theresa | 39 | 0.0012 | 0.12% |
| Penny | 82 | 0.0025 | 0.25% |
| Bradford & Chipmunk | 618 | 0.0187 | 1.87% |
| Glade | 749 | 0.0227 | 2.27% |
| Lockport | 14 | 0.0004 | 0.04% |
| Oriskany | 608 | 0.0184 | 1.84% |
| Trenton | 233 | 0.0071 | 0.71% |
| Bertie | 2 | 0.0001 | 0.01% |
| Utica | 4 | 0.0001 | 0.01% |
| Chipmunk & Harrisburg | 4 | 0.0001 | 0.01% |
| Upper Devonian | 503 | 0.0152 | 1.52% |
| Queenston | 651 | 0.0197 | 1.97% |
| Richburg | 8.874 | 0.2688 | 26.88% |
| Rice Brook | 34 | 0.0010 | 0.10% |
| Confidential | 36 | 0.0011 | 0.11% |
| Fordham Gneiss | 26 | 0.0008 | 0.08% |
| Manlius | 2 | 0.0001 | 0.01% |
| Chipmunk & Bradford 2nd | 459 | 0.0139 | 1.39% |
| Akron | 39 | 0.0012 | 0.12% |
| Devonian Shale | 16 | 0.0005 | 0.05% |
| Richburg-Waugh & Porter | 22 | 0.0007 | 0.07% |
| Bradford | 2.051 | 0.0621 | 6.21% |
| Camillus | 10 | 0.0003 | 0.03% |
| Oneida | 35 | 0.0011 | 0.11% |
| Yonkers Gneiss | 3 | 0.0001 | 0.01% |
| Onondaga | 214 | 0.0065 | 0.65% |
| Chipmunk & Bradford 3rd | 48 | 0.0015 | 0.15% |
| Syracuse | 111 | 0.0034 | 0.34% |
| Manhattan Schist | 35 | 0.0011 | 0.11% |
| Unknown | 15 | 0.0005 | 0.05% |
| Harrisburg | 2 | 0.0001 | 0.01% |
| Chipmunk, Bradford 2nd & 3rd | 716 | 0.0217 | 2.17% |
| Herkimer-Oneida | 5 | 0.0002 | 0.02% |
| Clarksville | 141 | 0.0043 | 0.43% |
| Medina-Queenston | 5 | 0.0002 | 0.02% |
| Salina | 403 | 0.0122 | 1.22% |
| Rhinestreet | 21 | 0.0006 | 0.06% |
| Clinton | 4 | 0.0001 | 0.01% |
| Fulmer Valley | 1.975 | 0.0598 | 5.98% |
| Rice Brook & Chipmunk | 12 | 0.0004 | 0.04% |
| Chipmunk | 2.369 | 0.0718 | 7.18% |
| Oswego | 2 | 0.0001 | 0.01% |
| Bradford Second | 29 | 0.0009 | 0.09% |
| Nunda | 1 | 0.0000 | 0.00% |
| Tully | 4 | 0.0001 | 0.01% |
| Herkimer | 67 | 0.0020 | 0.20% |
| Scio | 645 | 0.0195 | 1.95% |
| Grimsby | 309 | 0.0094 | 0.94% |
| TOTAL | 33.013 | 1.0000 | 100.00% |
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
Interpretación: la formación productora más frecuente es Richburg, con 8.874 pozos (26.88% del total). La menor frecuencia registrada es 1, compartida por 8 formaciones productoras.
if (usar_resumen) {
cat("## Top ", numero_top, " de formaciones productoras con mayor frecuencia {-}\n\n", sep="")
cat("El Cuadro N° 2 presenta las ", numero_top,
" formaciones productoras más frecuentes, ordenadas de mayor a menor, ",
"y agrupa las restantes en Otras formaciones productoras. ",
"El Top ", numero_top, " representa el ", sprintf("%.2f%%", pct_top),
" de los ", fmt_entero(N), " registros válidos.\n\n", sep="")
cat(crear_cuadro(tabla_resumen, 2,
paste0("Distribución de frecuencias de los pozos regulados: Top ", numero_top,
" formaciones productoras y Otras, Nueva York, 1860 - 2026")))
}
El Cuadro N° 2 presenta las 10 formaciones productoras más frecuentes, ordenadas de mayor a menor, y agrupa las restantes en Otras formaciones productoras. El Top 10 representa el 83.23% de los 33.013 registros válidos.
| FORMACIÓN PRODUCTORA | FRECUENCIA ABSOLUTA (nᵢ) | FRECUENCIA RELATIVA (hᵢ) | FRECUENCIA RELATIVA PORCENTUAL (%) |
|---|---|---|---|
| Richburg | 8.874 | 0.2688 | 26.88% |
| Medina | 8.829 | 0.2674 | 26.74% |
| Chipmunk | 2.369 | 0.0718 | 7.18% |
| Bradford | 2.051 | 0.0621 | 6.21% |
| Fulmer Valley | 1.975 | 0.0598 | 5.98% |
| Glade | 749 | 0.0227 | 2.27% |
| Chipmunk, Bradford 2nd & 3rd | 716 | 0.0217 | 2.17% |
| Queenston | 651 | 0.0197 | 1.97% |
| Scio | 645 | 0.0195 | 1.95% |
| Bradford & Chipmunk | 618 | 0.0187 | 1.87% |
| Otras formaciones productoras | 5.536 | 0.1677 | 16.77% |
| TOTAL | 33.013 | 1.0000 | 100.00% |
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
ggplot2::ggplot(tabla_local, ggplot2::aes(x=FormacionProductora,y=ni,fill=FormacionProductora)) +
ggplot2::geom_col(width=.72,color="#244861",linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=fmt_entero(ni)),vjust=-.48,
size=4.5,fontface="bold",color="#15364C") +
ggplot2::scale_fill_manual(values=colores) +
escala_formaciones +
ggplot2::scale_y_continuous(limits=c(0,limite_ni_local),
labels=fmt_entero,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::coord_cartesian(clip="off") +
ggplot2::labs(title="Gráfica N° 1: Frecuencia absoluta (nᵢ) local",
x="Formación productora",y="Frecuencia absoluta (nᵢ)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_global, ggplot2::aes(x=FormacionProductora,y=ni)) +
ggplot2::geom_col(fill="#286492",color="#244861",width=.72,linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=fmt_entero(ni)),vjust=-.48,
size=4.5,fontface="bold",color="#15364C") +
escala_formaciones +
ggplot2::scale_y_continuous(limits=c(0,limite_ni_global),
labels=fmt_entero,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::coord_cartesian(clip="off") +
ggplot2::labs(title="Gráfica N° 2: Frecuencia absoluta (nᵢ) global",
x="Formación productora",y="Frecuencia absoluta (nᵢ)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_local, ggplot2::aes(x=FormacionProductora,y=hi,fill=FormacionProductora)) +
ggplot2::geom_col(width=.72,color="#244861",linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=sprintf("%.2f%%",100*hi)),vjust=-.48,
size=4.3,fontface="bold",color="#15364C") +
ggplot2::scale_fill_manual(values=colores) +
escala_formaciones +
ggplot2::scale_y_continuous(limits=c(0,limite_hi_local),labels=etiqueta_pct,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::coord_cartesian(clip="off") +
ggplot2::labs(title="Gráfica N° 3: Frecuencia relativa (hᵢ) local",
x="Formación productora",y="Frecuencia relativa (%)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_global, ggplot2::aes(x=FormacionProductora,y=hi)) +
ggplot2::geom_col(fill="#286492",color="#244861",width=.72,linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=sprintf("%.2f%%",100*hi)),vjust=-.48,
size=4.3,fontface="bold",color="#15364C") +
escala_formaciones +
ggplot2::scale_y_continuous(limits=c(0,limite_hi_global),
breaks=seq(0,1,by=.2),labels=etiqueta_pct,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::coord_cartesian(clip="off") +
ggplot2::labs(title="Gráfica N° 4: Frecuencia relativa (hᵢ) global",
x="Formación productora",y="Frecuencia relativa (%)",caption=fuente_graficas) +
tema_barras
leyenda <- paste0(stringr::str_wrap(as.character(tabla_local$FormacionProductora),width=23),
" — ",sprintf("%.2f%%",tabla_local$porcentaje))
ggplot2::ggplot(tabla_local,ggplot2::aes(x=1,y=ni,fill=FormacionProductora)) +
ggplot2::geom_col(width=1,color="#244861",linewidth=.48) +
ggplot2::coord_polar(theta="y",start=0) +
ggplot2::scale_fill_manual(values=colores,labels=leyenda) +
ggplot2::labs(title="Gráfica N° 5: Distribución porcentual por formación productora",
fill="Formación productora — porcentaje",caption=fuente_graficas) +
ggplot2::theme_void(base_size=15) +
ggplot2::theme(
plot.title=ggplot2::element_text(hjust=.5,face="bold",size=17,color="#15364C"),
plot.subtitle=ggplot2::element_text(hjust=.5,size=12,color="#49657A",
margin=ggplot2::margin(t=7,b=12)),
legend.position="right",
legend.title=ggplot2::element_text(face="bold",size=13,color="#15364C"),
legend.text=ggplot2::element_text(size=12,color="#253B4B",lineheight=1.05),
legend.key.size=grid::unit(.56,"cm"),
plot.caption=ggplot2::element_text(hjust=0,face="italic",size=10.5,
color="#546775",margin=ggplot2::margin(t=14)),
plot.margin=ggplot2::margin(18,30,25,24)
)
cat(crear_indicadores())
| VARIABLE ANALIZADA | Media (X̄) | Mediana (Me) | Moda (Mo) | Desviación estándar (Sd) | Coeficiente de variación (CV %) | Asimetría (As) | Curtosis (K) | Valores atípicos (Outliers) |
|---|---|---|---|---|---|---|---|---|
| PRODUCING_FORMATION (Formación productora) | N/A | N/A | Richburg | N/A | N/A | N/A | N/A | N/A |
N/A: No aplicable a una variable cualitativa nominal.
Registros válidos (N): 33.013 | Categorías: 80 | Frecuencia modal: 8.874 | Porcentaje modal: 26.88%.
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
La variable PRODUCING_FORMATION (Formación productora) es cualitativa nominal y presenta 80 categorías en 33.013 registros válidos. La moda corresponde a Richburg, con una frecuencia de 8.874 pozos (26.88% del total), lo que evidencia una mayor concentración de registros en determinadas formaciones productoras del estado de Nueva York.
Autor: Jennifer Cordones | Análisis Estadístico — Oil, Gas & Other Regulated Wells - NY State