Este informe presenta un analisis descriptivo y diagnostico enfocado en la rentabilidad de Adidas. El objetivo es responder cuatro preguntas centrales: como se distribuyen la utilidad operativa y el margen operativo, cual es el margen promedio y que tan variable es, que productos, ciudades y metodos de venta parecen mas rentables, y si existe relacion entre ventas y utilidad.
Con el fin de mantener el trabajo alineado con las preguntas del
caso, el analisis se concentra en las variables
utilidad_operativa, margen_operativo,
ventas_total, producto, ciudad y
metodo_venta.
library(readxl)
library(dplyr)
library(ggplot2)
library(plotly)
library(knitr)
library(kableExtra)
library(tidyr)
library(tidyverse)
library(janitor)
library(scales)
adidas <- read_excel(
"C:/Users/ASUS/OneDrive - PUJ Cali/Desktop/MASTER FINANZAS JAVERIANA 2026-2027/Analitica de negocios/trabajos R/DatosCaso111.xlsx",
sheet = "Data Sales Adidas"
) %>%
clean_names() %>%
mutate(
producto = as.factor(producto),
ciudad = as.factor(ciudad),
metodo_venta = as.factor(metodo_venta)
)
Esta seccion responde como se distribuyen la utilidad operativa y el margen operativo. Se utilizan estadisticas descriptivas, histogramas y boxplots para identificar sesgo, dispersion y posibles valores atipicos.
resumen_rentabilidad <- tibble::tibble(
variable = c("Utilidad operativa", "Margen operativo"),
minimo = c(min(adidas$utilidad_operativa, na.rm = TRUE),
min(adidas$margen_operativo, na.rm = TRUE)),
media = c(mean(adidas$utilidad_operativa, na.rm = TRUE),
mean(adidas$margen_operativo, na.rm = TRUE)),
mediana = c(median(adidas$utilidad_operativa, na.rm = TRUE),
median(adidas$margen_operativo, na.rm = TRUE)),
maximo = c(max(adidas$utilidad_operativa, na.rm = TRUE),
max(adidas$margen_operativo, na.rm = TRUE)),
desviacion_estandar = c(sd(adidas$utilidad_operativa, na.rm = TRUE),
sd(adidas$margen_operativo, na.rm = TRUE))
) %>%
mutate(across(where(is.numeric), ~ round(.x, 4)))
knitr::kable(
resumen_rentabilidad,
caption = "Tabla 2. Resumen estadistico de utilidad y margen"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| variable | minimo | media | mediana | maximo | desviacion_estandar |
|---|---|---|---|---|---|
| Utilidad operativa | 0.0 | 4894.793 | 3262.98 | 39000.0 | 4866.4644 |
| Margen operativo | 0.1 | 0.423 | 0.41 | 0.8 | 0.0972 |
grafico_hist_utilidad <- ggplot(adidas, aes(x = utilidad_operativa)) +
geom_histogram(bins = 30, fill = "lightblue", color = "black") +
labs(
title = "Figura 1. Distribucion de la utilidad operativa",
x = "Utilidad operativa",
y = "Frecuencia"
) +
theme_minimal()
ggplotly(grafico_hist_utilidad)
grafico_box_utilidad <- ggplot(adidas, aes(y = utilidad_operativa)) +
geom_boxplot(fill = "tomato", color = "black") +
labs(
title = "Figura 2. Boxplot de utilidad operativa",
y = "Utilidad operativa"
) +
theme_minimal()
ggplotly(grafico_box_utilidad)
grafico_box_margen <- ggplot(adidas, aes(y = margen_operativo)) +
geom_boxplot(fill = "gold", color = "black") +
labs(
title = "Figura 4. Boxplot del margen operativo",
y = "Margen operativo"
) +
theme_minimal()
ggplotly(grafico_box_margen)
Los histogramas y boxplots permiten evaluar si la distribucion es simetrica o si existen colas largas y valores atipicos. En particular, estos graficos ayudan a determinar si la utilidad y el margen se comportan de manera uniforme o si dependen de pocos casos sobresalientes.
Esta tabla resume el nivel central del margen y su dispersion. Es util porque no basta con conocer el promedio; tambien es importante entender si el margen es estable o si cambia mucho entre observaciones.
resumen_margen <- tibble::tibble(
medida = c("Media", "Mediana", "Desviacion estandar", "Rango", "Coeficiente de variacion"),
valor = c(
mean(adidas$margen_operativo, na.rm = TRUE),
median(adidas$margen_operativo, na.rm = TRUE),
sd(adidas$margen_operativo, na.rm = TRUE),
max(adidas$margen_operativo, na.rm = TRUE) - min(adidas$margen_operativo, na.rm = TRUE),
sd(adidas$margen_operativo, na.rm = TRUE) / mean(adidas$margen_operativo, na.rm = TRUE)
)
) %>%
mutate(valor = round(valor, 4))
knitr::kable(
resumen_margen,
caption = "Tabla 3. Margen promedio y variabilidad"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| medida | valor |
|---|---|
| Media | 0.4230 |
| Mediana | 0.4100 |
| Desviacion estandar | 0.0972 |
| Rango | 0.7000 |
| Coeficiente de variacion | 0.2298 |
La media resume el margen promedio general. La mediana ayuda a verificar si el valor central cambia mucho al reducir el efecto de valores extremos. La desviacion estandar, el rango y el coeficiente de variacion permiten evaluar si la rentabilidad relativa es estable o heterogenea.
Para evaluar que productos parecen mas rentables, se comparan la utilidad total, la utilidad promedio y el margen promedio.
rent_producto <- adidas %>%
group_by(producto) %>%
summarise(
utilidad_total = sum(utilidad_operativa, na.rm = TRUE),
utilidad_promedio = mean(utilidad_operativa, na.rm = TRUE),
margen_promedio = mean(margen_operativo, na.rm = TRUE),
n = n(),
.groups = "drop"
) %>%
mutate(across(where(is.numeric), ~ round(.x, 4))) %>%
arrange(desc(utilidad_total))
knitr::kable(
rent_producto,
caption = "Tabla 4. Rentabilidad por producto"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| producto | utilidad_total | utilidad_promedio | margen_promedio | n |
|---|---|---|---|---|
| Men’s Street Footwear | 11629046 | 7223.010 | 0.4461 | 1610 |
| Women’s Apparel | 9685221 | 6023.147 | 0.4413 | 1608 |
| Men’s Athletic Footwear | 7437457 | 4619.538 | 0.4027 | 1610 |
| Women’s Street Footwear | 6494017 | 4038.568 | 0.4102 | 1608 |
| Men’s Apparel | 6381405 | 3973.478 | 0.4132 | 1606 |
| Women’s Athletic Footwear | 5597822 | 3485.568 | 0.4244 | 1606 |
grafico_producto_utilidad <- ggplot(rent_producto, aes(x = reorder(producto, utilidad_total), y = utilidad_total)) +
geom_col(fill = "steelblue", color = "black") +
coord_flip() +
labs(
title = "Figura 5. Utilidad total por producto",
x = "Producto",
y = "Utilidad total"
) +
theme_minimal()
ggplotly(grafico_producto_utilidad)
grafico_producto_margen <- ggplot(rent_producto, aes(x = reorder(producto, margen_promedio), y = margen_promedio)) +
geom_col(fill = "darkseagreen", color = "black") +
coord_flip() +
labs(
title = "Figura 6. Margen promedio por producto",
x = "Producto",
y = "Margen promedio"
) +
theme_minimal()
ggplotly(grafico_producto_margen)
Esta comparacion permite diferenciar productos que destacan por escala de utilidad y productos que sobresalen por eficiencia relativa.
Para analizar la dimension geografica, se calcula la utilidad total, la utilidad promedio y el margen promedio por ciudad.
rent_ciudad <- adidas %>%
group_by(ciudad) %>%
summarise(
ventas_totales = sum(ventas_total, na.rm = TRUE),
utilidad_total = sum(utilidad_operativa, na.rm = TRUE),
utilidad_promedio = mean(utilidad_operativa, na.rm = TRUE),
margen_promedio = mean(margen_operativo, na.rm = TRUE),
n = n(),
.groups = "drop"
) %>%
arrange(desc(utilidad_total))
rent_ciudad_tabla <- rent_ciudad %>%
slice_max(order_by = utilidad_total, n = 10) %>%
mutate(across(where(is.numeric), ~ round(.x, 4)))
knitr::kable(
rent_ciudad_tabla,
caption = "Tabla 5. Top 10 ciudades por utilidad total"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| ciudad | ventas_totales | utilidad_total | utilidad_promedio | margen_promedio | n |
|---|---|---|---|---|---|
| New York | 5676160 | 2114664 | 9790.113 | 0.3964 | 216 |
| Charleston | 4904272 | 2024086 | 7028.078 | 0.4449 | 288 |
| San Francisco | 4929220 | 1581993 | 7324.043 | 0.3577 | 216 |
| Miami | 3874113 | 1579388 | 10967.971 | 0.4292 | 144 |
| Portland | 4176777 | 1575861 | 4377.391 | 0.4077 | 360 |
| Houston | 3629632 | 1494772 | 6920.242 | 0.4359 | 216 |
| New Orleans | 3377031 | 1424390 | 6594.397 | 0.4469 | 216 |
| Los Angeles | 3651288 | 1378158 | 6380.363 | 0.4160 | 216 |
| Birmingham | 2513424 | 1368206 | 6334.289 | 0.5536 | 216 |
| Orlando | 3946476 | 1342207 | 6213.919 | 0.3643 | 216 |
top_ciudad_utilidad <- rent_ciudad %>%
slice_max(order_by = utilidad_total, n = 10)
grafico_ciudad_utilidad <- ggplot(top_ciudad_utilidad, aes(x = reorder(ciudad, utilidad_total), y = utilidad_total)) +
geom_col(fill = "tomato", color = "black") +
coord_flip() +
labs(
title = "Figura 7. Top 10 ciudades por utilidad total",
x = "Ciudad",
y = "Utilidad total"
) +
theme_minimal()
ggplotly(grafico_ciudad_utilidad)
top_ciudad_margen <- rent_ciudad %>%
slice_max(order_by = margen_promedio, n = 10)
grafico_ciudad_margen <- ggplot(top_ciudad_margen, aes(x = reorder(ciudad, margen_promedio), y = margen_promedio)) +
geom_col(fill = "goldenrod", color = "black") +
coord_flip() +
labs(
title = "Figura 8. Top 10 ciudades por margen promedio",
x = "Ciudad",
y = "Margen promedio"
) +
theme_minimal()
ggplotly(grafico_ciudad_margen)
La comparacion por ciudad ayuda a identificar mercados que aportan utilidad por volumen y mercados que destacan por eficiencia relativa.
Como metodo_venta es una variable categorica, no se
interpreta con correlacion lineal tradicional. Lo correcto es evaluar si
existen diferencias sistematicas de margen entre canales.
rent_metodo <- adidas %>%
group_by(metodo_venta) %>%
summarise(
ventas_totales = sum(ventas_total, na.rm = TRUE),
utilidad_total = sum(utilidad_operativa, na.rm = TRUE),
utilidad_promedio = mean(utilidad_operativa, na.rm = TRUE),
margen_promedio = mean(margen_operativo, na.rm = TRUE),
desviacion_margen = sd(margen_operativo, na.rm = TRUE),
n = n(),
.groups = "drop"
) %>%
mutate(across(where(is.numeric), ~ round(.x, 4))) %>%
arrange(desc(utilidad_total))
knitr::kable(
rent_metodo,
caption = "Tabla 6. Rentabilidad por metodo de venta"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| metodo_venta | ventas_totales | utilidad_total | utilidad_promedio | margen_promedio | desviacion_margen | n |
|---|---|---|---|---|---|---|
| Online | 44965657 | 19552538 | 3999.292 | 0.4642 | 0.0885 | 4889 |
| Outlet | 39536618 | 14913301 | 4939.815 | 0.3949 | 0.0925 | 3019 |
| In-store | 35664375 | 12759129 | 7332.833 | 0.3561 | 0.0702 | 1740 |
grafico_margen_metodo <- ggplot(adidas, aes(x = metodo_venta, y = margen_operativo, fill = metodo_venta)) +
geom_boxplot(color = "black") +
labs(
title = "Figura 9. Distribucion del margen por metodo de venta",
x = "Metodo de venta",
y = "Margen operativo"
) +
theme_minimal() +
theme(legend.position = "none")
ggplotly(grafico_margen_metodo)
grafico_metodo_utilidad <- ggplot(rent_metodo, aes(x = reorder(metodo_venta, utilidad_total), y = utilidad_total)) +
geom_col(fill = "purple", color = "black") +
coord_flip() +
labs(
title = "Figura 10. Utilidad total por metodo de venta",
x = "Metodo de venta",
y = "Utilidad total"
) +
theme_minimal()
ggplotly(grafico_metodo_utilidad)
grafico_metodo_margen <- ggplot(rent_metodo, aes(x = reorder(metodo_venta, margen_promedio), y = margen_promedio)) +
geom_col(fill = "darkorange", color = "black") +
coord_flip() +
labs(
title = "Figura 11. Margen promedio por metodo de venta",
x = "Metodo de venta",
y = "Margen promedio"
) +
theme_minimal()
ggplotly(grafico_metodo_margen)
El boxplot es especialmente util porque permite evaluar si un metodo de venta no solo tiene mayor margen promedio, sino tambien si dicho margen es mas estable o mas disperso.
cor_ventas_utilidad <- cor(adidas$ventas_total, adidas$utilidad_operativa, use = "complete.obs")
correlacion_tabla <- tibble::tibble(
indicador = "Correlacion entre ventas_total y utilidad_operativa",
valor = round(cor_ventas_utilidad, 4)
)
knitr::kable(
correlacion_tabla,
caption = "Tabla 7. Correlacion entre ventas y utilidad"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| indicador | valor |
|---|---|
| Correlacion entre ventas_total y utilidad_operativa | 0.9354 |
grafico_ventas_utilidad <- ggplot(adidas, aes(x = ventas_total, y = utilidad_operativa)) +
geom_point(alpha = 0.5, color = "steelblue") +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(
title = "Figura 12. Relacion entre ventas y utilidad operativa",
x = "Ventas totales",
y = "Utilidad operativa"
) +
theme_minimal()
ggplotly(grafico_ventas_utilidad)
Esta relacion permite evaluar si un mayor volumen comercial suele traducirse en mayor utilidad operativa.
Esta grafica ayuda a separar ciudades que destacan por escala de ventas y ciudades que destacan por eficiencia.
ciudad_resumen <- rent_ciudad %>%
mutate(
utilidad_total_red = round(utilidad_total, 2),
ventas_totales_red = round(ventas_totales, 2),
margen_promedio_red = round(margen_promedio, 4)
)
grafico_ciudad_scatter <- ggplot(ciudad_resumen, aes(
x = ventas_totales,
y = margen_promedio,
size = utilidad_total,
text = paste0(
"Ciudad: ", ciudad,
"<br>Ventas totales: ", comma(ventas_totales_red),
"<br>Utilidad total: ", comma(utilidad_total_red),
"<br>Margen promedio: ", margen_promedio_red
)
)) +
geom_point(alpha = 0.7, color = "steelblue") +
labs(
title = "Figura 13. Ventas totales vs margen promedio por ciudad",
x = "Ventas totales",
y = "Margen promedio",
size = "Utilidad total"
) +
theme_minimal()
ggplotly(grafico_ciudad_scatter, tooltip = "text")
Esta visualizacion es util para interpretar por que ciertas ciudades venden mucho sin necesariamente liderar en margen, y por que otras pueden repetir en rankings de utilidad y rentabilidad relativa.
Para relacionar extremos geograficos, se comparan las ciudades con mayores y menores niveles de utilidad y margen.
top_bottom_utilidad <- bind_rows(
rent_ciudad %>% slice_max(order_by = utilidad_total, n = 5) %>% mutate(grupo = "Top utilidad"),
rent_ciudad %>% slice_min(order_by = utilidad_total, n = 5) %>% mutate(grupo = "Bottom utilidad")
) %>%
mutate(across(where(is.numeric), ~ round(.x, 4)))
top_bottom_margen <- bind_rows(
rent_ciudad %>% slice_max(order_by = margen_promedio, n = 5) %>% mutate(grupo = "Top margen"),
rent_ciudad %>% slice_min(order_by = margen_promedio, n = 5) %>% mutate(grupo = "Bottom margen")
) %>%
mutate(across(where(is.numeric), ~ round(.x, 4)))
knitr::kable(
top_bottom_utilidad,
caption = "Tabla 8. Maximos y minimos de utilidad por ciudad"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| ciudad | ventas_totales | utilidad_total | utilidad_promedio | margen_promedio | n | grupo |
|---|---|---|---|---|---|---|
| New York | 5676160 | 2114664.4 | 9790.113 | 0.3964 | 216 | Top utilidad |
| Charleston | 4904272 | 2024086.4 | 7028.078 | 0.4449 | 288 | Top utilidad |
| San Francisco | 4929220 | 1581993.3 | 7324.043 | 0.3577 | 216 | Top utilidad |
| Miami | 3874113 | 1579387.9 | 10967.971 | 0.4292 | 144 | Top utilidad |
| Portland | 4176777 | 1575860.6 | 4377.391 | 0.4077 | 360 | Top utilidad |
| Omaha | 728838 | 316805.9 | 2200.041 | 0.4579 | 144 | Bottom utilidad |
| Des Moines | 909811 | 345626.1 | 2400.181 | 0.4209 | 144 | Bottom utilidad |
| Minneapolis | 903918 | 347262.3 | 2411.544 | 0.4081 | 144 | Bottom utilidad |
| Fargo | 950930 | 352558.5 | 2448.323 | 0.3986 | 144 | Bottom utilidad |
| Baltimore | 951134 | 359490.9 | 2496.464 | 0.4074 | 144 | Bottom utilidad |
knitr::kable(
top_bottom_margen,
caption = "Tabla 9. Maximos y minimos de margen por ciudad"
) %>%
kableExtra::kable_styling(full_width = FALSE)
| ciudad | ventas_totales | utilidad_total | utilidad_promedio | margen_promedio | n | grupo |
|---|---|---|---|---|---|---|
| Birmingham | 2513424 | 1368206.4 | 6334.289 | 0.5536 | 216 | Top margen |
| Knoxville | 2567190 | 1269585.1 | 5877.709 | 0.5066 | 216 | Top margen |
| Detroit | 2287283 | 1050351.5 | 7294.108 | 0.4758 | 144 | Top margen |
| Billings | 1930761 | 810775.1 | 5630.382 | 0.4710 | 144 | Top margen |
| Charlotte | 2936581 | 1263674.1 | 8775.515 | 0.4635 | 144 | Top margen |
| Honolulu | 2734457 | 779756.6 | 5414.976 | 0.3196 | 144 | Bottom margen |
| Seattle | 3222093 | 927709.4 | 6442.426 | 0.3251 | 144 | Bottom margen |
| Boston | 1578435 | 517402.1 | 2395.380 | 0.3471 | 216 | Bottom margen |
| Anchorage | 1810428 | 592154.6 | 4112.185 | 0.3499 | 144 | Bottom margen |
| San Francisco | 4929220 | 1581993.3 | 7324.043 | 0.3577 | 216 | Bottom margen |
A partir de este analisis se puede diferenciar entre ciudades, productos y canales que destacan por escala y aquellos que destacan por eficiencia relativa. Una ciudad puede vender mucho y aun asi no ubicarse entre las de mayor margen si depende de volumen, descuentos o una mezcla comercial menos rentable. De forma similar, un metodo de venta puede liderar en utilidad total sin necesariamente presentar la mejor rentabilidad relativa.