2. TABLA DE DISTRIBUCION CON STURGES
k <- floor(1 + 3.322 * log10(n))
minimo <- min(latitud_pozos)
maximo <- max(latitud_pozos)
R <- maximo - minimo
A <- R / k
Li_s <- round(seq(from = minimo, to = maximo - A, by = A), 2)
Ls_s <- round(seq(from = minimo + A, to = maximo, by = A), 2)
MC_s <- round((Li_s + Ls_s) / 2, 2)
ni_s <- numeric(length(Li_s))
for (i in 1:length(Li_s)) {
ni_s[i] <- sum(latitud_pozos >= Li_s[i] & latitud_pozos < Ls_s[i])
}
ni_s[length(Li_s)] <- sum(latitud_pozos >= Li_s[length(Li_s)] & latitud_pozos <= maximo)
TDF_Sturges <- data.frame(Li=Li_s, Ls=Ls_s, MC=MC_s, ni=ni_s, hi=round((ni_s/n)*100, 2))
TDF_Sturges_P <- rbind(TDF_Sturges, data.frame(Li="TOTAL", Ls="", MC="", ni=sum(ni_s), hi=100))
kable(TDF_Sturges_P, format = "markdown", caption = "Tabla N.1: Distribucion de cantidad de latitud (Sturges)")
Tabla N.1: Distribucion de cantidad de latitud
(Sturges)
| 32 |
32.36 |
32.18 |
707 |
5.63 |
| 32.36 |
32.71 |
32.53 |
1290 |
10.27 |
| 32.71 |
33.07 |
32.89 |
638 |
5.08 |
| 33.07 |
33.43 |
33.25 |
74 |
0.59 |
| 33.43 |
33.79 |
33.61 |
413 |
3.29 |
| 33.79 |
34.14 |
33.97 |
155 |
1.23 |
| 34.14 |
34.5 |
34.32 |
0 |
0.00 |
| 34.5 |
34.86 |
34.68 |
0 |
0.00 |
| 34.86 |
35.21 |
35.03 |
0 |
0.00 |
| 35.21 |
35.57 |
35.39 |
0 |
0.00 |
| 35.57 |
35.93 |
35.75 |
0 |
0.00 |
| 35.93 |
36.28 |
36.11 |
303 |
2.41 |
| 36.28 |
36.64 |
36.46 |
3563 |
28.37 |
| 36.64 |
37 |
36.82 |
5418 |
43.13 |
| TOTAL |
|
|
12561 |
100.00 |
2. TABLA DE DISTRIBUCION AGRUPADA
h_f <- hist(latitud_pozos, plot = FALSE)
lis <- h_f$breaks[1:(length(h_f$breaks)-1)]
lss <- h_f$breaks[2:length(h_f$breaks)]
MC_f <- h_f$mids
ni_f <- h_f$counts
hi_f <- (ni_f / sum(ni_f)) * 100
Niasc <- cumsum(ni_f); Nidsc <- rev(cumsum(rev(ni_f)))
Hiasc <- round(cumsum(hi_f), 2); Hidsc <- round(rev(cumsum(rev(hi_f))), 2)
TDF_Simp <- data.frame(Li=lis, Ls=lss, MC=MC_f, ni=ni_f, hi=round(hi_f, 2),
Niasc, Nidsc, Hiasc, Hidsc)
TDF_Simp_P <- rbind(TDF_Simp, data.frame(Li="TOTAL", Ls="", MC="", ni=sum(ni_f), hi=100,
Niasc=NA, Nidsc=NA, Hiasc=NA, Hidsc=NA))
kable(TDF_Simp_P, format = "markdown", caption = "Tabla N.2: Distribucion simplificada de latitud")
Tabla N.2: Distribucion simplificada de latitud
| 32 |
32.5 |
32.25 |
1296 |
10.32 |
1296 |
12561 |
10.32 |
100.00 |
| 32.5 |
33 |
32.75 |
1306 |
10.40 |
2602 |
11265 |
20.71 |
89.68 |
| 33 |
33.5 |
33.25 |
184 |
1.46 |
2786 |
9959 |
22.18 |
79.29 |
| 33.5 |
34 |
33.75 |
486 |
3.87 |
3272 |
9775 |
26.05 |
77.82 |
| 34 |
34.5 |
34.25 |
5 |
0.04 |
3277 |
9289 |
26.09 |
73.95 |
| 34.5 |
35 |
34.75 |
0 |
0.00 |
3277 |
9284 |
26.09 |
73.91 |
| 35 |
35.5 |
35.25 |
0 |
0.00 |
3277 |
9284 |
26.09 |
73.91 |
| 35.5 |
36 |
35.75 |
3 |
0.02 |
3280 |
9284 |
26.11 |
73.91 |
| 36 |
36.5 |
36.25 |
1868 |
14.87 |
5148 |
9281 |
40.98 |
73.89 |
| 36.5 |
37 |
36.75 |
7413 |
59.02 |
12561 |
7413 |
100.00 |
59.02 |
| TOTAL |
|
|
12561 |
100.00 |
NA |
NA |
NA |
NA |
3. GRAFICAS DE DISTRIBUCION
par(mar = c(6, 5, 4, 2) + 0.1)
colores_hist <- gray.colors(length(ni_f), start = 0.3, end = 0.9)
color_abs <- "#76D7C4"
color_rel <- "#F1948A"
# Grafica 1: Local ni
hist(latitud_pozos, col = colores_hist, xlab = "Latitud", ylab = "Cantidad (ni)",
main = "Grafica N.1: Distribucion de cantidad de la latitud")

# Grafica 2: Global ni
hist(latitud_pozos, col = colores_hist, xlab = "Latitud", ylab = "Cantidad",
ylim = c(0, n), main = "Grafica N.2: Distribucion de cantidad de la latitud (Global)")

# Grafica 3: Local hi
barplot(hi_f, names.arg = MC_f, col = color_abs, las = 2, cex.names = 0.7,
ylab = "Porcentaje (%)", xlab = "Latitud",
main = "Grafica N.3: Distribucion de cantidad en porcentaje de la latitud")

# Grafica 4: Global hi
barplot(hi_f, names.arg = MC_f, col = color_rel, las = 2, cex.names = 0.7,
ylim = c(0, 100), ylab = "Porcentaje (%)", xlab = "Latitud",
main = "Grafica N.4: Distribucion en porcentaje de la latitud")

# Grafica 5: Ojivas Ni
plot(lss, Nidsc, type="o", col="blue", pch=19, xlab="Latitud", ylab="Cant. Acumulada",
main="Grafica N.5: Ojivas combinadas de cantidad acumulada")
lines(lis, Niasc, type="o", col="black", pch=18)
legend("right", legend=c("Descendente", "Ascendente"), col=c("blue", "black"), pch=c(19, 18), bty="n")

# Grafica 6: Ojivas Hi
plot(lss, Hidsc, type="o", col="blue", pch=19, ylim=c(0, 100),
xlab="Latitud", ylab="Porcentaje Acumulado",
main="Grafica N.6: Ojivas combinadas de porcentaje acumulado")
lines(lis, Hiasc, type="o", col="black", pch=18)
legend("right", legend=c("Descendente", "Ascendente"), col=c("blue", "black"), pch=c(19, 18), bty="n")

# Grafica 7: Boxplot
boxplot(latitud_pozos, horizontal = TRUE, col = "skyblue", xlab = "Latitud",
main = "Grafica N.7: Boxplot de la latitud")

4. INDICADORES ESTADISTICOS
media <- mean(latitud_pozos)
mediana <- median(latitud_pozos)
desviacion <- sd(latitud_pozos)
cv <- (desviacion/media)*100
asimetria <- skewness(latitud_pozos)
curtosis <- kurtosis(latitud_pozos)
TablaInd <- data.frame(
Variable = "Latitud",
Minimo = min(latitud_pozos),
Maximo = max(latitud_pozos),
Media = round(media, 2),
Mediana = round(mediana, 2),
Desv_Est = round(desviacion, 2),
CV_Porc = round(cv, 2),
Asimetria = round(asimetria, 2),
Curtosis = round(curtosis, 2)
)
kable(TablaInd, format = "markdown", caption = "Tabla N.3: Indicadores Estadisticos de Latitud")
Tabla N.3: Indicadores Estadisticos de Latitud
| Latitud |
32.00058 |
36.99897 |
35.65 |
36.58 |
1.76 |
4.93 |
-1.12 |
-0.61 |