En un entorno altamente competitivo donde la consolidación del comercio electrónico y la eficiencia de los canales exigen decisiones basadas en datos, este informe analiza 9,648 registros históricos de ventas de Adidas en Estados Unidos. Mediante técnicas de analítica descriptiva y exploratoria en R, se diagnostica el comportamiento de los ingresos, volúmenes comercializados, márgenes y rentabilidad operativa por producto, región y canal de distribución
El análisis exploratorio de datos (EDA) es un paso clave para comprender la información comercial y financiera de Adidas, identificar patrones y evaluar la distribución de las variables.
# Cargar librerías necesarias
library(readxl)
library(dplyr)
library(ggplot2)
library(plotly)
library(knitr)
library(kableExtra)
library(tidyr)
library(tidyverse)
library(scales)
library(corrplot)
# Cargar datos desde el archivo Excel
datos <- read_excel ("DatosCaso1.xlsx",,
col_types = c("text", "text", "text",
"text", "text", "numeric", "numeric",
"numeric", "numeric", "numeric",
"text"))
# Verificación de dimensiones e inspección inicial
dim(datos)
## [1] 9648 11
head(datos)
| distribuidor | region | estado | ciudad | producto | precio_unidad | unidades_vendidas | ventas_total | utilidad_operativa | margen_operativo | metodo_venta |
|---|---|---|---|---|---|---|---|---|---|---|
| Foot Locker | Northeast | New York | New York | Men’s Street Footwear | 50 | 1200 | 60000 | 30000.0 | 0.50 | In-store |
| Foot Locker | Northeast | New York | New York | Men’s Athletic Footwear | 50 | 1000 | 50000 | 15000.0 | 0.30 | In-store |
| Foot Locker | Northeast | New York | New York | Women’s Street Footwear | 40 | 1000 | 40000 | 14000.0 | 0.35 | In-store |
| Foot Locker | Northeast | New York | New York | Women’s Athletic Footwear | 45 | 850 | 38250 | 13387.5 | 0.35 | In-store |
| Foot Locker | Northeast | New York | New York | Men’s Apparel | 60 | 900 | 54000 | 16200.0 | 0.30 | In-store |
| Foot Locker | Northeast | New York | New York | Women’s Apparel | 50 | 1000 | 50000 | 12500.0 | 0.25 | In-store |
# Limpieza de duplicados y estructuración de variables
datos <- datos %>% distinct()
# Convertir variables cualitativas a factores
datos <- datos %>%
mutate(
distribuidor = as.factor(distribuidor),
region = as.factor(region),
estado = as.factor(estado),
ciudad = as.factor(ciudad),
producto = as.factor(producto),
metodo_venta = as.factor(metodo_venta)
)
Indicadores de centralidad y dispersion
# Resumen estadístico general de variables cuantitativas
resumen_general <- datos %>%
summarise(
Registros = n(),
Precio_Promedio = mean(precio_unidad, na.rm = TRUE),
Precio_Mediana = median(precio_unidad, na.rm = TRUE),
Unidades_Promedio = mean(unidades_vendidas, na.rm = TRUE),
Unidades_Mediana = median(unidades_vendidas, na.rm = TRUE),
Ventas_Promedio = mean(ventas_total, na.rm = TRUE),
Ventas_Mediana = median(ventas_total, na.rm = TRUE),
Utilidad_Promedio = mean(utilidad_operativa, na.rm = TRUE),
Utilidad_Mediana = median(utilidad_operativa, na.rm = TRUE),
Margen_Promedio = mean(margen_operativo, na.rm = TRUE)
)
resumen_general
| Registros | Precio_Promedio | Precio_Mediana | Unidades_Promedio | Unidades_Mediana | Ventas_Promedio | Ventas_Mediana | Utilidad_Promedio | Utilidad_Mediana | Margen_Promedio |
|---|---|---|---|---|---|---|---|---|---|
| 9386 | 45.13222 | 45 | 251.8805 | 175 | 12184.2 | 7616 | 4817.29 | 3201.87 | 0.4249659 |
# Totales consolidados de la operación financiera
resumen_totales <- datos %>%
summarise(
Ventas_Totales = sum(ventas_total, na.rm = TRUE),
Unidades_Totales = sum(unidades_vendidas, na.rm = TRUE),
Utilidad_Total = sum(utilidad_operativa, na.rm = TRUE),
Margen_Ponderado = sum(utilidad_operativa, na.rm = TRUE) / sum(ventas_total, na.rm = TRUE)
)
resumen_totales
| Ventas_Totales | Unidades_Totales | Utilidad_Total | Margen_Ponderado |
|---|---|---|---|
| 114360940 | 2364150 | 45215084 | 0.3953717 |
Desempeño y Participación por Producto
ventas_producto <- datos %>%
group_by(producto) %>%
summarise(
ventas_totales = sum(ventas_total, na.rm = TRUE),
unidades = sum(unidades_vendidas, na.rm = TRUE),
utilidad = sum(utilidad_operativa, na.rm = TRUE),
margen_promedio = mean(margen_operativo, na.rm = TRUE),
.groups = "drop"
) %>%
mutate(participacion = ventas_totales / sum(ventas_totales)) %>%
arrange(desc(ventas_totales))
ventas_producto
| producto | ventas_totales | unidades | utilidad | margen_promedio | participacion |
|---|---|---|---|---|---|
| Men’s Street Footwear | 26857769 | 577095 | 11299921 | 0.4468916 | 0.2348509 |
| Women’s Apparel | 22828659 | 415663 | 9359505 | 0.4436033 | 0.1996194 |
| Men’s Athletic Footwear | 19282616 | 409860 | 7017698 | 0.4049968 | 0.1686119 |
| Women’s Street Footwear | 16076592 | 368495 | 6102320 | 0.4122444 | 0.1405776 |
| Men’s Apparel | 15667757 | 290958 | 6069599 | 0.4145344 | 0.1370027 |
| Women’s Athletic Footwear | 13647547 | 302079 | 5366042 | 0.4270774 | 0.1193375 |
# Figura 1. Ventas totales por línea de producto
grafico_ventas_prod <- ggplotly(
ggplot(ventas_producto, aes(x = reorder(producto, ventas_totales), y = ventas_totales, fill = producto)) +
geom_col() +
coord_flip() +
scale_y_continuous(labels = dollar_format(prefix = "$")) +
labs(
title = "Figura 1. Ventas Totales por Línea de Producto",
x = "Producto",
y = "Ventas Totales ($USD)"
) +
theme_minimal() +
theme(legend.position = "none")
)
grafico_ventas_prod
# Figura 2. Unidades vendidas por línea de producto
grafico_unidades_prod <- ggplotly(
ggplot(ventas_producto, aes(x = reorder(producto, unidades), y = unidades, fill = producto)) +
geom_col() +
coord_flip() +
scale_y_continuous(labels = comma) +
labs(
title = "Figura 2. Unidades Vendidas por Línea de Producto",
x = "Producto",
y = "Unidades Vendidas"
) +
theme_minimal() +
theme(legend.position = "none")
)
grafico_unidades_prod
Análisis Geográfico y Canales de Distribución
ventas_region <- datos %>%
group_by(region) %>%
summarise(
ventas = sum(ventas_total, na.rm = TRUE),
unidades = sum(unidades_vendidas, na.rm = TRUE),
utilidad = sum(utilidad_operativa, na.rm = TRUE),
margen_promedio = mean(margen_operativo, na.rm = TRUE),
.groups = "drop"
) %>%
arrange(desc(ventas))
grafico_region <- ggplotly(
ggplot(ventas_region, aes(x = reorder(region, ventas), y = ventas, fill = region)) +
geom_col() +
coord_flip() +
scale_y_continuous(labels = dollar_format(prefix = "$")) +
labs(
title = "Figura 3. Ventas Totales por Región Geográfica",
x = "Región",
y = "Ventas ($USD)"
) +
theme_minimal() +
theme(legend.position = "none")
)
grafico_region
ventas_metodo <- datos %>%
group_by(metodo_venta) %>%
summarise(
ventas = sum(ventas_total, na.rm = TRUE),
unidades = sum(unidades_vendidas, na.rm = TRUE),
utilidad = sum(utilidad_operativa, na.rm = TRUE),
margen_promedio = mean(margen_operativo, na.rm = TRUE),
.groups = "drop"
) %>%
arrange(desc(ventas))
grafico_metodo <- ggplotly(
ggplot(ventas_metodo, aes(x = reorder(metodo_venta, ventas), y = ventas, fill = metodo_venta)) +
geom_col() +
scale_y_continuous(labels = dollar_format(prefix = "$")) +
labs(
title = "Figura 4. Ventas Totales por Método de Venta",
x = "Método de Venta",
y = "Ventas Totales ($USD)"
) +
theme_minimal() +
theme(legend.position = "none")
)
grafico_metodo
Al evaluar las distribuciones del desempeño financiero mediante gráficos de caja interactivos:
Análisis del Boxplot: La mediana de las ventas totales se sitúa por debajo de la media debido a un sesgo positivo hacia la derecha. Se registran transacciones atípicas de gran volumen (compras al por mayor) que superan los $60,000 USD por registro.
# Figura 5. Boxplot interactivo de ventas totales
ggplotly(
ggplot(datos, aes(y = ventas_total)) +
geom_boxplot(fill = "skyblue", color = "black", outlier.colour = "red", outlier.shape = 16, outlier.size = 2) +
scale_y_continuous(labels = dollar_format(prefix = "$")) +
labs(
title = "Figura 5. Boxplot de Distribución de Ventas Totales",
y = "Ventas Totales ($USD)"
) +
theme_minimal()
)
Figura 6. Relación entre Ventas y Utilidad Operativa
En la Figura 6 se observa una fuerte correlación positiva entre los ingresos totales y la utilidad operacional, con un coeficiente de correlación de 0.96. Esto indica que a medida que los ingresos aumentan, la utilidad crece prácticamente de forma directa y proporcional.
# Figura 6. Gráfico de dispersión interactivo entre ventas y utilidad
ggplotly(
ggplot(datos, aes(x = ventas_total, y = utilidad_operativa)) +
geom_point(color = "lightblue", alpha = 0.6, size = 1.8) +
geom_smooth(method = "lm", color = "grey30", se = TRUE) +
scale_x_continuous(labels = dollar_format(prefix = "$")) +
scale_y_continuous(labels = dollar_format(prefix = "$")) +
labs(
title = paste("Figura 6. Relación entre Ventas y Utilidad Operativa\nCoef. de correlación: ",
round(cor(datos$ventas_total, datos$utilidad_operativa, use = "complete.obs"), 2)),
x = "Ventas Totales ($USD)",
y = "Utilidad Operativa ($USD)"
) +
theme_minimal()
)
# Cargar librería para matriz de correlación
library(reshape2)
# Selección de variables cuantitativas
variables_numericas <- datos %>%
select(precio_unidad, unidades_vendidas, ventas_total, utilidad_operativa, margen_operativo)
# Cálculo de la matriz de correlación
matriz_cor <- cor(variables_numericas, use = "complete.obs")
# Renombrar variables para evitar solapamiento de texto
colnames(matriz_cor) <- c("Precio", "Unidades", "Ventas", "Utilidad", "Margen")
rownames(matriz_cor) <- c("Precio", "Unidades", "Ventas", "Utilidad", "Margen")
# Transformación de datos
matriz_melt <- melt(matriz_cor)
# Creación del gráfico de calor
grafico_cor <- ggplot(matriz_melt, aes(Var1, Var2, fill = value)) +
geom_tile(color = "white") +
geom_text(aes(label = round(value, 2)), color = "black", size = 3.5) +
scale_fill_gradient2(low = "#6D9EC1", high = "#E46726", mid = "white", midpoint = 0, limit = c(-1,1)) +
labs(
title = "Figura 7. Matriz de Correlación de Variables Cuantitativas",
x = "",
y = "",
fill = "Correlación"
) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# Renderizado interactivo
ggplotly(grafico_cor)
Evaluamos el desempeño en ventas acumuladas según cada distribuidor para identificar los principales socios comerciales de la marca:
ventas_retailer <- datos %>%
group_by(distribuidor) %>%
summarise(
ventas = sum(ventas_total, na.rm = TRUE),
unidades = sum(unidades_vendidas, na.rm = TRUE),
utilidad = sum(utilidad_operativa, na.rm = TRUE),
margen_promedio = mean(margen_operativo, na.rm = TRUE),
.groups = "drop"
) %>%
arrange(desc(ventas))
grafico_retailer <- ggplotly(
ggplot(ventas_retailer, aes(x = reorder(distribuidor, ventas), y = ventas, fill = distribuidor)) +
geom_col() +
coord_flip() +
scale_y_continuous(labels = dollar_format(prefix = "$")) +
labs(
title = "Figura 8. Ventas Totales por Distribuidor (Retailer)",
x = "Distribuidor",
y = "Ventas Totales ($USD)"
) +
theme_minimal() +
theme(legend.position = "none")
)
grafico_retailer
Conclusiones Generales
Recomendaciones Estratégicas para ADIDAS