## Rows: 1,137
## Columns: 43
## $ id <chr> "us7000necw", "tx2024shcj", "ci40734823", "tx2024scvz"…
## $ magnitude <dbl> 4.80, 5.10, 3.70, 3.90, 4.10, 3.23, 3.43, 3.44, 4.69, …
## $ type <chr> "earthquake", "earthquake", "earthquake", "earthquake"…
## $ title <chr> "M 4.8 - 33 km WSW of Ackerly, Texas", "M 5.1 - 34 km …
## $ date <dttm> 2024-09-17 00:49:42, 2024-09-17 00:49:42, 2024-09-16 …
## $ time <dbl> 1.726534e+12, 1.726534e+12, 1.726486e+12, 1.726333e+12…
## $ updated <dbl> 1.726584e+12, 1.726672e+12, 1.726637e+12, 1.726584e+12…
## $ url <chr> "https://earthquake.usgs.gov/earthquakes/eventpage/us7…
## $ detailUrl <chr> "https://earthquake.usgs.gov/earthquakes/feed/v1.0/det…
## $ felt <dbl> 1893, 2042, 1580, 5, 4, 472, 234, 225, 18592, 0, 5, 1,…
## $ cdi <dbl> 6, 6, 4, 3, 3, 4, 4, 4, 5, 0, 3, 3, 3, 3, 4, 5, 4, 4, …
## $ mmi <dbl> 5, 5, 4, 4, 4, 3, 3, 3, 5, 3, 4, 4, 4, 4, 4, 5, 4, 4, …
## $ alert <chr> "green", "green", NA, "green", "green", NA, NA, NA, "g…
## $ status <chr> "reviewed", "reviewed", "reviewed", "reviewed", "revie…
## $ tsunami <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, …
## $ sig <dbl> 994, 1040, 591, 236, 260, 340, 277, 272, 818, 188, 224…
## $ net <chr> "us", "tx", "ci", "tx", "us", "ci", "ci", "ci", "ci", …
## $ code <chr> "7000necw", "2024shcj", "40734823", "2024scvz", "7000n…
## $ ids <chr> ",us7000necw,tx2024shcj,", ",us7000necw,tx2024shcj,", …
## $ sources <chr> ",us,tx,", ",us,tx,", ",ci,us,", ",us,tx,", ",us,", ",…
## $ types <chr> ",dyfi,ground-failure,losspager,moment-tensor,oaf,orig…
## $ nst <dbl> 37, 24, 135, 38, 28, 131, 111, 115, 145, 14, 32, 34, 4…
## $ dmin <dbl> 0.287000, 0.000000, 0.032940, 0.000000, 0.043000, 0.03…
## $ rms <dbl> 0.4800, 0.1000, 0.2800, 0.1000, 0.2600, 0.2600, 0.2900…
## $ gap <dbl> 70.00, 38.00, 99.00, 65.00, 67.00, 88.00, 92.00, 84.00…
## $ magType <chr> "mww", "ml", "ml", "ml", "mb", "ml", "ml", "ml", "mw",…
## $ geometryType <chr> "Point", "Point", "Point", "Point", "Point", "Point", …
## $ depth <dbl> 4.0440, 6.1279, 10.9000, 6.2024, 8.8140, 10.9500, 11.0…
## $ latitude <dbl> 32.3984, 32.4140, 34.0678, 31.6470, 31.6323, 34.0637, …
## $ longitude <dbl> -102.044, -102.057, -118.807, -104.450, -104.473, -118…
## $ place <chr> "33 km WSW of Ackerly, Texas", "34 km WSW of Ackerly, …
## $ distanceKM <dbl> 33, 34, 6, 58, 60, 6, 5, 7, 6, 7, 56, 61, 57, 61, 15, …
## $ placeOnly <chr> "WSW of Ackerly, Texas", "WSW of Ackerly, Texas", "N o…
## $ location <chr> "Ackerly, Texas", "Ackerly, Texas", "Malibu, CA", "Whi…
## $ continent <chr> "North America", "North America", "North America", "No…
## $ country <chr> "United States of America (the)", "United States of Am…
## $ subnational <chr> "Texas", "Texas", "California", "Texas", "Texas", "Cal…
## $ city <chr> "Tarzan-Lenorah", "Tarzan-Lenorah", "Los Angeles", "Va…
## $ locality <chr> "Tarzan-Lenorah", "Tarzan-Lenorah", "Agoura Hills-Mali…
## $ postcode <dbl> 79783, 79331, 90265, NA, NA, 90265, 90265, 90265, 9026…
## $ what3words <chr> "landmass.perkily.affords", "escalator.grownups.dwell"…
## $ timezone <dbl> -300, -300, -420, -300, -300, -420, -420, -420, -420, …
## $ locationDetails <chr> "[{'id': '80684', 'wikidataId': '', 'name': '79783', '…
## [1] "United States of America (the)" "United States of America (the)"
## [3] "United States of America (the)" "United States of America (the)"
## [5] "United States of America (the)" "United States of America (the)"
## [7] "United States of America (the)" "United States of America (the)"
## [9] "United States of America (the)" "United States of America (the)"
## [11] "United States of America (the)" "United States of America (the)"
## [13] "United States of America (the)" "United States of America (the)"
## [15] "United States of America (the)"
tabla_paises <- datos %>%
filter(!is.na(country)) %>%
count(country, name = "frecuencia") %>%
mutate(
porcentaje = round((frecuencia / sum(frecuencia)) * 100, 2)
) %>%
arrange(desc(frecuencia))
tabla_paises <- datos %>%
filter(!is.na(country)) %>%
count(country, name = "frecuencia") %>%
mutate(
porcentaje = round((frecuencia / sum(frecuencia)) * 100, 2)
) %>%
arrange(desc(frecuencia))
total_paises <- tibble(
country = "TOTAL",
frecuencia = sum(tabla_paises$frecuencia),
porcentaje = round(sum(tabla_paises$porcentaje), 2)
)
bind_rows(tabla_paises, total_paises) %>%
gt() %>%
tab_header(
title = md("**Conteo Original por País**"),
subtitle = "Distribución completa de registros por país"
) %>%
cols_label(
country = "País",
frecuencia = "Frecuencia absoluta (ni)",
porcentaje = "Porcentaje (%)"
) %>%
fmt_number(columns = frecuencia, decimals = 0, use_seps = FALSE) %>%
fmt_number(columns = porcentaje, decimals = 2) %>%
tab_style(
style = cell_text(weight = "bold"),
locations = cells_body(rows = country == "TOTAL")
) %>%
tab_source_note(
source_note = "Autor: Grupo 1 – Carrera de Geología"
) %>%
tab_options(
table.border.top.color = "#999999",
table.border.top.width = px(1.5),
table.border.bottom.color = "#999999",
table.border.bottom.width = px(1.5),
heading.border.bottom.color = "#999999",
column_labels.border.bottom.color = "#999999",
table_body.hlines.color = "#e0e0e0"
)| Conteo Original por País | ||
| Distribución completa de registros por país | ||
| País | Frecuencia absoluta (ni) | Porcentaje (%) |
|---|---|---|
| United States of America (the) | 423 | 52.94 |
| Japan | 68 | 8.51 |
| Taiwan (Province of China) | 55 | 6.88 |
| Indonesia | 38 | 4.76 |
| China | 30 | 3.75 |
| Chile | 29 | 3.63 |
| Afghanistan | 26 | 3.25 |
| Argentina | 26 | 3.25 |
| Philippines (the) | 17 | 2.13 |
| Iran (Islamic Republic of) | 11 | 1.38 |
| Mexico | 11 | 1.38 |
| Peru | 11 | 1.38 |
| Canada | 8 | 1.00 |
| Turkiye | 7 | 0.88 |
| Nepal | 6 | 0.75 |
| Bolivia (Plurinational State of) | 5 | 0.63 |
| Montenegro | 4 | 0.50 |
| India | 3 | 0.38 |
| Myanmar | 3 | 0.38 |
| New Zealand | 3 | 0.38 |
| Pakistan | 3 | 0.38 |
| Bangladesh | 2 | 0.25 |
| Brazil | 2 | 0.25 |
| Congo (the Democratic Republic of the) | 1 | 0.13 |
| Djibouti | 1 | 0.13 |
| Ecuador | 1 | 0.13 |
| El Salvador | 1 | 0.13 |
| Guatemala | 1 | 0.13 |
| Nicaragua | 1 | 0.13 |
| Tanzania, the United Republic of | 1 | 0.13 |
| Viet Nam | 1 | 0.13 |
| TOTAL | 799 | 100.06 |
| Autor: Grupo 1 – Carrera de Geología | ||
top_n <- 10
tabla_top10 <- datos %>%
filter(!is.na(country), trimws(country) != "") %>%
mutate(
pais_agrupado = fct_lump_n(as.character(country), n = top_n, other_level = "Otros")
) %>%
count(pais_agrupado, name = "frecuencia") %>%
mutate(
porcentaje = round((frecuencia / sum(frecuencia)) * 100, 2)
) %>%
arrange(pais_agrupado == "Otros", desc(frecuencia))
total_top10 <- tibble(
pais_agrupado = "TOTAL",
frecuencia = sum(tabla_top10$frecuencia),
porcentaje = round(sum(tabla_top10$porcentaje), 2)
)
bind_rows(tabla_top10, total_top10) %>%
gt() %>%
tab_header(
title = md("**Conteo Agrupado por País (Top 10)**"),
subtitle = "Agrupación de los 10 países con mayor frecuencia"
) %>%
cols_label(
pais_agrupado = "País",
frecuencia = "Frecuencia absoluta (ni)",
porcentaje = "Porcentaje (%)"
) %>%
fmt_number(columns = frecuencia, decimals = 0, use_seps = FALSE) %>%
fmt_number(columns = porcentaje, decimals = 2) %>%
tab_style(
style = cell_text(weight = "bold"),
locations = cells_body(rows = pais_agrupado == "TOTAL")
) %>%
tab_source_note(
source_note = "Autor: Grupo 1 – Carrera de Geología"
) %>%
tab_options(
table.border.top.color = "#999999",
table.border.top.width = px(1.5),
table.border.bottom.color = "#999999",
table.border.bottom.width = px(1.5),
heading.border.bottom.color = "#999999",
column_labels.border.bottom.color = "#999999",
table_body.hlines.color = "#e0e0e0"
)| Conteo Agrupado por País (Top 10) | ||
| Agrupación de los 10 países con mayor frecuencia | ||
| País | Frecuencia absoluta (ni) | Porcentaje (%) |
|---|---|---|
| United States of America (the) | 423 | 52.94 |
| Japan | 68 | 8.51 |
| Taiwan (Province of China) | 55 | 6.88 |
| Indonesia | 38 | 4.76 |
| China | 30 | 3.75 |
| Chile | 29 | 3.63 |
| Afghanistan | 26 | 3.25 |
| Argentina | 26 | 3.25 |
| Philippines (the) | 17 | 2.13 |
| Iran (Islamic Republic of) | 11 | 1.38 |
| Mexico | 11 | 1.38 |
| Peru | 11 | 1.38 |
| Otros | 54 | 6.76 |
| TOTAL | 799 | 100.00 |
| Autor: Grupo 1 – Carrera de Geología | ||
tabla_completa <- datos %>%
filter(!is.na(country), trimws(country) != "") %>%
count(country, name = "frecuencia_absoluta") %>%
mutate(
pais_agrupado = if_else(frecuencia_absoluta >= 20, as.character(country), "Otros")
) %>%
group_by(pais_agrupado) %>%
summarise(
frecuencia_absoluta = sum(frecuencia_absoluta),
.groups = "drop"
) %>%
arrange(pais_agrupado == "Otros", desc(frecuencia_absoluta)) %>%
mutate(
frecuencia_relativa = frecuencia_absoluta / sum(frecuencia_absoluta),
frecuencia_porcentual = frecuencia_relativa * 100
)
fila_total <- tibble(
pais_agrupado = "TOTAL",
frecuencia_absoluta = sum(tabla_completa$frecuencia_absoluta),
frecuencia_relativa = sum(tabla_completa$frecuencia_relativa),
frecuencia_porcentual = sum(tabla_completa$frecuencia_porcentual)
)
tabla_final <- bind_rows(tabla_completa, fila_total)
tabla_gt_completa <- tabla_final %>%
gt() %>%
tab_header(
title = md("**Tabla N° 1**"),
subtitle = "Distribución de frecuencias de los países con registro de sismos a nivel mundial"
) %>%
cols_label(
pais_agrupado = "País",
frecuencia_absoluta = "Frecuencia absoluta (ni)",
frecuencia_relativa = "Frecuencia relativa",
frecuencia_porcentual = "Frecuencia relativa (%)"
) %>%
fmt_number(columns = frecuencia_absoluta, decimals = 0, use_seps = FALSE) %>%
fmt_number(columns = frecuencia_relativa, decimals = 4) %>%
fmt_number(columns = frecuencia_porcentual, decimals = 2) %>%
tab_style(
style = cell_text(weight = "bold"),
locations = cells_body(rows = pais_agrupado == "TOTAL")
) %>%
tab_source_note(
source_note = "Autor: Grupo 1 – Carrera de Geología"
) %>%
tab_options(
table.border.top.color = "#999999",
table.border.top.width = px(1.5),
table.border.bottom.color = "#999999",
table.border.bottom.width = px(1.5),
heading.border.bottom.color = "#999999",
column_labels.border.bottom.color = "#999999",
table_body.hlines.color = "#e0e0e0"
)
tabla_gt_completa| Tabla N° 1 | |||
| Distribución de frecuencias de los países con registro de sismos a nivel mundial | |||
| País | Frecuencia absoluta (ni) | Frecuencia relativa | Frecuencia relativa (%) |
|---|---|---|---|
| United States of America (the) | 423 | 0.5294 | 52.94 |
| Japan | 68 | 0.0851 | 8.51 |
| Taiwan (Province of China) | 55 | 0.0688 | 6.88 |
| Indonesia | 38 | 0.0476 | 4.76 |
| China | 30 | 0.0375 | 3.75 |
| Chile | 29 | 0.0363 | 3.63 |
| Afghanistan | 26 | 0.0325 | 3.25 |
| Argentina | 26 | 0.0325 | 3.25 |
| Otros | 104 | 0.1302 | 13.02 |
| TOTAL | 799 | 1.0000 | 100.00 |
| Autor: Grupo 1 – Carrera de Geología | |||
tabla_base <- tabla_completa %>%
rename(
pais = pais_agrupado,
ni = frecuencia_absoluta,
fr_pct = frecuencia_porcentual
)# Gráfica 1: Distribución local de los países
par(mar = c(7, 5, 4, 2))
max_ni <- max(tabla_base$ni)
pos_x <- barplot(
tabla_base$ni,
names.arg = tabla_base$pais,
col = "steelblue",
border = "black",
space = 0.2,
las = 2,
ylim = c(0, max_ni + max_ni * 0.12),
yaxt = "n",
main = "Gráfica 1: Distribución local de los países con\nregistro de sismos a nivel mundial",
xlab = "",
ylab = "Cantidad",
cex.names = 0.75
)
mtext("País", side = 1, line = 5.5, cex = 1, font = 2)
ticks_y <- round(
seq(0, max_ni, length.out = 5),
0
)
axis(
side = 2,
at = ticks_y,
labels = ticks_y,
las = 1
)
text(
x = pos_x,
y = tabla_base$ni,
labels = tabla_base$ni,
pos = 3,
font = 2,
cex = 0.7
)
# 6. INDICADORES ESTADÍSTICOS {#indicadores}
## Tamaño de la muestra (n): 799
## Número de categorías: 9
## Moda: United States of America (the) (ni = 423 | 52.94 %)
## País menos frecuente: Afghanistan
| Tabla N° 2 | |
| Indicadores estadísticos de la variable País | |
| Indicador | Resultado |
|---|---|
| Autor: Grupal – Carrera de Ingeniería en Geología | |
A partir del análisis estadístico descriptivo de la variable
cualitativa nominal País (country) en una
muestra total de 799 eventos sísmicos registrados a
nivel mundial, se concluye que: