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_objetivo_limpia <- datos_originales |>
dplyr::transmute(FormacionObjetivo=stringr::str_squish(as.character(.data[[columna_formacion]]))) |>
dplyr::filter(!is.na(FormacionObjetivo), FormacionObjetivo != "",
!toupper(FormacionObjetivo) %in% c("NA", "N/A", "NULL"))
N <- nrow(formacion_objetivo_limpia)
if (N == 0L) stop("No hay registros válidos de OBJECTIVE_FORMATION.")
k_formaciones <- dplyr::n_distinct(formacion_objetivo_limpia$FormacionObjetivo)
cat("Registros válidos:", fmt_entero(N),
" | Formaciones objetivo distintas:", fmt_entero(k_formaciones), "\n")
## Registros válidos: 14.469 | Formaciones objetivo distintas: 66
| VARIABLE | TIPO | ESCALA DE MEDICIÓN | UNIDAD DE ANÁLISIS | CATEGORÍAS (k) | REGISTROS VÁLIDOS (N) |
|---|---|---|---|---|---|
| OBJECTIVE_FORMATION (Formación objetivo) | Cualitativa nominal | Nominal | Pozo regulado | 66 | 14.469 |
El Cuadro N° 1 presenta la frecuencia absoluta (nᵢ), la frecuencia relativa (hᵢ) y el porcentaje de cada una de las 66 formaciones objetivo, considerando 14.469 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 objetivo, Nueva York, 1860 - 2026",
desplazamiento=(k_formaciones > 15L)))
| FORMACIÓN OBJETIVO | FRECUENCIA ABSOLUTA (nᵢ) | FRECUENCIA RELATIVA (hᵢ) | FRECUENCIA RELATIVA PORCENTUAL (%) |
|---|---|---|---|
| Oneida | 63 | 0.0044 | 0.44% |
| Penny & Fulmer Valley | 5 | 0.0003 | 0.03% |
| Pre-Cambrian | 15 | 0.0010 | 0.10% |
| Herkimer | 140 | 0.0097 | 0.97% |
| Penny | 23 | 0.0016 | 0.16% |
| Medina-Queenston | 18 | 0.0012 | 0.12% |
| Precambrian | 6 | 0.0004 | 0.04% |
| Bradford | 1.072 | 0.0741 | 7.41% |
| Little Falls | 2 | 0.0001 | 0.01% |
| Vernon | 17 | 0.0012 | 0.12% |
| Marcellus | 187 | 0.0129 | 1.29% |
| Hamilton | 20 | 0.0014 | 0.14% |
| Devonian Shale | 11 | 0.0008 | 0.08% |
| Chipmunk, Bradford 1st,2nd,3rd | 88 | 0.0061 | 0.61% |
| Humphrey | 8 | 0.0006 | 0.06% |
| Potsdam | 18 | 0.0012 | 0.12% |
| Queenston | 782 | 0.0540 | 5.40% |
| Trenton | 62 | 0.0043 | 0.43% |
| Bradford Third | 659 | 0.0455 | 4.55% |
| Clinton | 3 | 0.0002 | 0.02% |
| Theresa | 68 | 0.0047 | 0.47% |
| Salina | 394 | 0.0272 | 2.72% |
| Nunda | 33 | 0.0023 | 0.23% |
| Chipmunk | 237 | 0.0164 | 1.64% |
| Richburg | 1.008 | 0.0697 | 6.97% |
| Medina | 5.540 | 0.3829 | 38.29% |
| Oswego | 5 | 0.0003 | 0.03% |
| Bertie | 14 | 0.0010 | 0.10% |
| Onondaga-Oriskany | 6 | 0.0004 | 0.04% |
| Utica | 34 | 0.0023 | 0.23% |
| Bradford 2nd & 3rd | 8 | 0.0006 | 0.06% |
| Bass Island | 70 | 0.0048 | 0.48% |
| Whirlpool | 7 | 0.0005 | 0.05% |
| Upper Devonian | 793 | 0.0548 | 5.48% |
| Bradford Second | 352 | 0.0243 | 2.43% |
| Chipmunk & Bradford 2nd | 30 | 0.0021 | 0.21% |
| Waugh & Porter | 24 | 0.0017 | 0.17% |
| Lockport | 2 | 0.0001 | 0.01% |
| Chipmunk, Bradford 2nd & 3rd | 89 | 0.0062 | 0.62% |
| Bradford 1st & Chipmunk | 2 | 0.0001 | 0.01% |
| Inwood Marble | 26 | 0.0018 | 0.18% |
| Manhattan Schist | 35 | 0.0024 | 0.24% |
| Hartland | 4 | 0.0003 | 0.03% |
| Chazy | 1 | 0.0001 | 0.01% |
| Black River | 465 | 0.0321 | 3.21% |
| Clarksville | 74 | 0.0051 | 0.51% |
| Oriskany | 307 | 0.0212 | 2.12% |
| Richburg-Waugh & Porter | 15 | 0.0010 | 0.10% |
| Oneida-Oswego | 10 | 0.0007 | 0.07% |
| Sauquoit | 1 | 0.0001 | 0.01% |
| Scio | 40 | 0.0028 | 0.28% |
| Wappinger Limestone | 11 | 0.0008 | 0.08% |
| Glacial Till | 11 | 0.0008 | 0.08% |
| Herkimer-Oneida | 3 | 0.0002 | 0.02% |
| Bradford & Chipmunk | 105 | 0.0073 | 0.73% |
| Chipmunk & Bradford 3rd | 1 | 0.0001 | 0.01% |
| Tribes Hill | 2 | 0.0001 | 0.01% |
| Akron | 8 | 0.0006 | 0.06% |
| Fordham Gneiss | 10 | 0.0007 | 0.07% |
| Glade | 330 | 0.0228 | 2.28% |
| Onondaga | 129 | 0.0089 | 0.89% |
| Syracuse | 120 | 0.0083 | 0.83% |
| Fulmer Valley | 786 | 0.0543 | 5.43% |
| Upper Devonian Shale | 11 | 0.0008 | 0.08% |
| Helderberg | 48 | 0.0033 | 0.33% |
| Yonkers Gneiss | 1 | 0.0001 | 0.01% |
| TOTAL | 14.469 | 1.0000 | 100.00% |
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
Interpretación: la formación objetivo más frecuente es Medina, con 5.540 pozos (38.29% del total). La menor frecuencia registrada es 1, compartida por 4 formaciones objetivo.
if (usar_resumen) {
cat("## Top ", numero_top, " de formaciones objetivo con mayor frecuencia {-}\n\n", sep="")
cat("El Cuadro N° 2 presenta las ", numero_top,
" formaciones objetivo más frecuentes, ordenadas de mayor a menor, ",
"y agrupa las restantes en Otras formaciones objetivo. ",
"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 objetivo y Otras, Nueva York, 1860 - 2026")))
}
El Cuadro N° 2 presenta las 10 formaciones objetivo más frecuentes, ordenadas de mayor a menor, y agrupa las restantes en Otras formaciones objetivo. El Top 10 representa el 81.91% de los 14.469 registros válidos.
| FORMACIÓN OBJETIVO | FRECUENCIA ABSOLUTA (nᵢ) | FRECUENCIA RELATIVA (hᵢ) | FRECUENCIA RELATIVA PORCENTUAL (%) |
|---|---|---|---|
| Medina | 5.540 | 0.3829 | 38.29% |
| Bradford | 1.072 | 0.0741 | 7.41% |
| Richburg | 1.008 | 0.0697 | 6.97% |
| Upper Devonian | 793 | 0.0548 | 5.48% |
| Fulmer Valley | 786 | 0.0543 | 5.43% |
| Queenston | 782 | 0.0540 | 5.40% |
| Bradford Third | 659 | 0.0455 | 4.55% |
| Black River | 465 | 0.0321 | 3.21% |
| Salina | 394 | 0.0272 | 2.72% |
| Bradford Second | 352 | 0.0243 | 2.43% |
| Otras formaciones objetivo | 2.618 | 0.1809 | 18.09% |
| TOTAL | 14.469 | 1.0000 | 100.00% |
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
ggplot2::ggplot(tabla_local, ggplot2::aes(x=FormacionObjetivo,y=ni,fill=FormacionObjetivo)) +
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 objetivo",y="Frecuencia absoluta (nᵢ)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_global, ggplot2::aes(x=FormacionObjetivo,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 objetivo",y="Frecuencia absoluta (nᵢ)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_local, ggplot2::aes(x=FormacionObjetivo,y=hi,fill=FormacionObjetivo)) +
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 objetivo",y="Frecuencia relativa (%)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_global, ggplot2::aes(x=FormacionObjetivo,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 objetivo",y="Frecuencia relativa (%)",caption=fuente_graficas) +
tema_barras
leyenda <- paste0(stringr::str_wrap(as.character(tabla_local$FormacionObjetivo),width=23),
" — ",sprintf("%.2f%%",tabla_local$porcentaje))
ggplot2::ggplot(tabla_local,ggplot2::aes(x=1,y=ni,fill=FormacionObjetivo)) +
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 objetivo",
fill="Formación objetivo — 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) |
|---|---|---|---|---|---|---|---|---|
| OBJECTIVE_FORMATION (Formación objetivo) | N/A | N/A | Medina | N/A | N/A | N/A | N/A | N/A |
N/A: No aplicable a una variable cualitativa nominal.
Registros válidos (N): 14.469 | Categorías: 66 | Frecuencia modal: 5.540 | Porcentaje modal: 38.29%.
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
La variable OBJECTIVE_FORMATION (Formación objetivo) es cualitativa nominal y presenta 66 categorías en 14.469 registros válidos. La moda corresponde a Medina, con una frecuencia de 5.540 pozos (38.29% del total), lo que evidencia una mayor concentración de registros en determinadas formaciones objetivo registradas en el estado de Nueva York.
Autor: Jennifer Cordones | Análisis Estadístico — Oil, Gas & Other Regulated Wells - NY State