Arca Continental es una empresa embotelladora y distribuidora de
productos; esta es mayormente conocida por su embotellamiento y
distribución de Coca-Cola. En esta situación problema. la empresa Arca
Continental se encuentra en un dilema. Los canales modernos le brindan
competencia los canales tradicionales de Arca Continental.
Consecuentemente, la empresa ha implementado el: “Proyecto Siglo XXI”.
Un proyecto de capacitación de abarroteros para mejorar el rendimiento
de sus sucursales.
Es nuestro trabajo analizar el desempeño de las tiendas para definir si
el Proyecto Siglo XXI ha sido beneficiente para Arca Continental.
## Warning: package 'readxl' was built under R version 4.3.1
df <- read_excel("C:\\Users\\memil\\OneDrive\\Desktop\\aaTecDeMonterrey\\5to Semestre\\SemanaTecProgra\\Datos Arca Continental Original.xlsx")## Warning: Expecting numeric in N184066 / R184066C14: got a date
## Warning: Expecting numeric in O184066 / R184066C15: got a date
## Warning: Expecting numeric in P184066 / R184066C16: got a date
## Warning: Expecting numeric in Q184066 / R184066C17: got a date
## Warning: Expecting numeric in R184066 / R184066C18: got a date
## Warning: Expecting numeric in S184066 / R184066C19: got a date
## Warning: Expecting numeric in T184066 / R184066C20: got a date
## Warning: Expecting numeric in U184066 / R184066C21: got a date
## Warning: Expecting numeric in V184066 / R184066C22: got a date
## Warning: Expecting numeric in W184066 / R184066C23: got a date
## Warning: Expecting numeric in X184066 / R184066C24: got a date
## Warning: Expecting numeric in Y184066 / R184066C25: got a date
## tibble [466,509 × 25] (S3: tbl_df/tbl/data.frame)
## $ ID : num [1:466509] 1 2 3 4 5 6 7 8 9 10 ...
## $ Año : num [1:466509] 2016 2016 2016 2016 2016 ...
## $ Territorio : chr [1:466509] "Guadalajara" "Guadalajara" "Guadalajara" "Guadalajara" ...
## $ Sub Territorio : chr [1:466509] "Belenes" "Belenes" "Belenes" "Belenes" ...
## $ CEDI : chr [1:466509] "Suc. Belenes" "Suc. Belenes" "Suc. Belenes" "Suc. Belenes" ...
## $ Cliente : chr [1:466509] "77737" "77737" "77737" "77737" ...
## $ Nombre : chr [1:466509] "ABARR" "ABARR" "ABARR" "ABARR" ...
## $ Tamaño Cte Industria: chr [1:466509] "Extra Grande" "Extra Grande" "Extra Grande" "Extra Grande" ...
## $ Segmento Det : chr [1:466509] "Agua Mineral" "Agua Purificada" "Agua Purificada" "Agua Saborizada" ...
## $ Marca : chr [1:466509] "Topo Chico A.M." "Ciel Agua Purificada" "Ciel Agua Purificada" "Ciel Exprim" ...
## $ Presentacion : chr [1:466509] "600 ml NR" "1 Ltro. N.R." "1.5 Lts. NR" "600 ml NR" ...
## $ Tamaño : chr [1:466509] "Individual" "Individual" "Individual" "Individual" ...
## $ Retornable_NR : chr [1:466509] "No Retornable" "No Retornable" "No Retornable" "No Retornable" ...
## $ Enero : num [1:466509] NA NA NA NA NA NA 1 NA 3 NA ...
## $ Febrero : num [1:466509] NA 2 NA NA NA NA NA 1 3 NA ...
## $ Marzo : num [1:466509] NA 8 3 NA NA 1 NA NA 4 NA ...
## $ Abril : num [1:466509] NA 4 6 NA NA NA NA 1 4 NA ...
## $ Mayo : num [1:466509] NA 4 3 NA NA NA 0 NA 4 NA ...
## $ Junio : num [1:466509] NA 2 3 NA NA NA NA 1 4 0 ...
## $ Julio : num [1:466509] NA 2 3 NA NA NA 0 NA 4 NA ...
## $ Agosto : num [1:466509] NA 2 3 NA NA NA NA 1 7 NA ...
## $ Septiembre : num [1:466509] NA 2 3 NA NA NA NA 1 4 NA ...
## $ Octubre : num [1:466509] NA 2 3 NA NA NA 0 NA 3 NA ...
## $ Noviembre : num [1:466509] NA 4 3 NA 0 NA NA NA 1 NA ...
## $ Diciembre : num [1:466509] 1 2 3 1 NA NA NA NA 3 NA ...
## ID Año Territorio Sub Territorio
## Min. : 1 Min. :2016 Length:466509 Length:466509
## 1st Qu.:116628 1st Qu.:2017 Class :character Class :character
## Median :233255 Median :2018 Mode :character Mode :character
## Mean :233255 Mean :2018
## 3rd Qu.:349882 3rd Qu.:2019
## Max. :466509 Max. :2019
##
## CEDI Cliente Nombre Tamaño Cte Industria
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## Segmento Det Marca Presentacion Tamaño
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## Retornable_NR Enero Febrero Marzo
## Length:466509 Min. : -19.0 Min. : -11.00 Min. : -32.00
## Class :character 1st Qu.: 1.0 1st Qu.: 1.00 1st Qu.: 1.00
## Mode :character Median : 2.0 Median : 2.00 Median : 3.00
## Mean : 10.1 Mean : 9.76 Mean : 11.36
## 3rd Qu.: 6.0 3rd Qu.: 6.00 3rd Qu.: 6.00
## Max. :42736.0 Max. :42767.00 Max. :42795.00
## NA's :233480 NA's :231213 NA's :227420
## Abril Mayo Junio Julio
## Min. : -70.00 Min. : -106.00 Min. : -211.0 Min. : -60.00
## 1st Qu.: 1.00 1st Qu.: 1.00 1st Qu.: 1.0 1st Qu.: 1.00
## Median : 3.00 Median : 3.00 Median : 3.0 Median : 2.00
## Mean : 11.71 Mean : 12.75 Mean : 12.2 Mean : 11.75
## 3rd Qu.: 6.00 3rd Qu.: 7.00 3rd Qu.: 6.0 3rd Qu.: 6.00
## Max. :42826.00 Max. :42856.00 Max. :42887.0 Max. :42917.00
## NA's :224057 NA's :216910 NA's :215753 NA's :223411
## Agosto Septiembre Octubre Noviembre
## Min. : -211.00 Min. : -527.0 Min. : -38.0 Min. : -25.0
## 1st Qu.: 1.00 1st Qu.: 1.0 1st Qu.: 1.0 1st Qu.: 1.0
## Median : 3.00 Median : 3.0 Median : 3.0 Median : 3.0
## Mean : 11.98 Mean : 13.4 Mean : 13.7 Mean : 13.3
## 3rd Qu.: 6.00 3rd Qu.: 7.0 3rd Qu.: 7.0 3rd Qu.: 6.0
## Max. :42948.00 Max. :42979.0 Max. :43009.0 Max. :43040.0
## NA's :220242 NA's :337314 NA's :338386 NA's :338460
## Diciembre
## Min. : -28.0
## 1st Qu.: 1.0
## Median : 3.0
## Mean : 14.8
## 3rd Qu.: 7.0
## Max. :43070.0
## NA's :341855
## Warning: package 'dplyr' was built under R version 4.3.1
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## # A tibble: 2 × 2
## Territorio n
## <chr> <int>
## 1 Guadalajara 466508
## 2 Territorio 1
# count(df, CEDI, sort = TRUE)
# count(df, Cliente, sort = TRUE)
# count(df, Nombre, sort = TRUE)
# count(df, Marca, sort = TRUE)
# count(df, Presentacion, sort = TRUE)
# count(df, Tamaño, sort = TRUE)
# count(df, Retornable_NR, sort = TRUE)df$Enero <- as.integer(df$Enero)
df$Febero <- as.integer(df$Febrero)
df$Marzo <- as.integer(df$Marzo)
df$Abril <- as.integer(df$Abril)
df$Mayo <- as.integer(df$Mayo)
df$Junio <- as.integer(df$Junio)
df$Julio <- as.integer(df$Julio)
df$Agosto <- as.integer(df$Agosto)
df$Septiembre <- as.integer(df$Septiembre)
df$Octubre <- as.integer(df$Octubre)
df$Noviembre <- as.integer(df$Noviembre)
df$Diciembre <- as.integer(df$Diciembre)
summary(df)## ID Año Territorio Sub Territorio
## Min. : 1 Min. :2016 Length:466509 Length:466509
## 1st Qu.:116628 1st Qu.:2017 Class :character Class :character
## Median :233255 Median :2018 Mode :character Mode :character
## Mean :233255 Mean :2018
## 3rd Qu.:349882 3rd Qu.:2019
## Max. :466509 Max. :2019
##
## CEDI Cliente Nombre Tamaño Cte Industria
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## Segmento Det Marca Presentacion Tamaño
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## Retornable_NR Enero Febrero Marzo
## Length:466509 Min. : -19.0 Min. : -11.00 Min. : -32.00
## Class :character 1st Qu.: 1.0 1st Qu.: 1.00 1st Qu.: 1.00
## Mode :character Median : 2.0 Median : 2.00 Median : 3.00
## Mean : 10.1 Mean : 9.76 Mean : 11.36
## 3rd Qu.: 6.0 3rd Qu.: 6.00 3rd Qu.: 6.00
## Max. :42736.0 Max. :42767.00 Max. :42795.00
## NA's :233480 NA's :231213 NA's :227420
## Abril Mayo Junio Julio
## Min. : -70.00 Min. : -106.00 Min. : -211.0 Min. : -60.00
## 1st Qu.: 1.00 1st Qu.: 1.00 1st Qu.: 1.0 1st Qu.: 1.00
## Median : 3.00 Median : 3.00 Median : 3.0 Median : 2.00
## Mean : 11.71 Mean : 12.75 Mean : 12.2 Mean : 11.75
## 3rd Qu.: 6.00 3rd Qu.: 7.00 3rd Qu.: 6.0 3rd Qu.: 6.00
## Max. :42826.00 Max. :42856.00 Max. :42887.0 Max. :42917.00
## NA's :224057 NA's :216910 NA's :215753 NA's :223411
## Agosto Septiembre Octubre Noviembre
## Min. : -211.00 Min. : -527.0 Min. : -38.0 Min. : -25.0
## 1st Qu.: 1.00 1st Qu.: 1.0 1st Qu.: 1.0 1st Qu.: 1.0
## Median : 3.00 Median : 3.0 Median : 3.0 Median : 3.0
## Mean : 11.98 Mean : 13.4 Mean : 13.7 Mean : 13.3
## 3rd Qu.: 6.00 3rd Qu.: 7.0 3rd Qu.: 7.0 3rd Qu.: 6.0
## Max. :42948.00 Max. :42979.0 Max. :43009.0 Max. :43040.0
## NA's :220242 NA's :337314 NA's :338386 NA's :338460
## Diciembre Febero
## Min. : -28.0 Min. : -11.00
## 1st Qu.: 1.0 1st Qu.: 1.00
## Median : 3.0 Median : 2.00
## Mean : 14.8 Mean : 9.76
## 3rd Qu.: 7.0 3rd Qu.: 6.00
## Max. :43070.0 Max. :42767.00
## NA's :341855 NA's :231213
Las ventas negativas pueden indicar devoluciones. (Asumido)
Cliente: Actualmente se encuentra en character pero tiene que ser
numerico por ser un ID.
Al final de la base de datos hay un renglón de totales. Este será
eliminado para mejorar la distribución de los datos y la integridad de
la base de datos.
#Para eliminar el registro de totales.
df <- df[df$Cliente != "Cliente", ]
#Para cambiar el tipo de dato a numerico
df$Cliente <- as.numeric(df$Cliente)
summary(df$Cliente)## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3 2509 5488 16768 9267 99998
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
## [1] 0
df$Ventas <- df$Enero + df$Febrero +df$Marzo+df$Abril+df$Mayo+df$Junio+df$Julio+df$Agosto+df$Septiembre+df$Octubre+df$Noviembre+df$Diciembre
summary(df)## ID Año Territorio Sub Territorio
## Min. : 1 Min. :2016 Length:466508 Length:466508
## 1st Qu.:116628 1st Qu.:2017 Class :character Class :character
## Median :233256 Median :2018 Mode :character Mode :character
## Mean :233255 Mean :2018
## 3rd Qu.:349882 3rd Qu.:2019
## Max. :466509 Max. :2019
## CEDI Cliente Nombre Tamaño Cte Industria
## Length:466508 Min. : 3 Length:466508 Length:466508
## Class :character 1st Qu.: 2509 Class :character Class :character
## Mode :character Median : 5488 Mode :character Mode :character
## Mean :16768
## 3rd Qu.: 9267
## Max. :99998
## Segmento Det Marca Presentacion Tamaño
## Length:466508 Length:466508 Length:466508 Length:466508
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Retornable_NR Enero Febrero Marzo
## Length:466508 Min. : -19.000 Min. : -11.000 Min. : -32.000
## Class :character 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000
## Mode :character Median : 0.000 Median : 0.000 Median : 0.000
## Mean : 4.951 Mean : 4.829 Mean : 5.729
## 3rd Qu.: 2.000 3rd Qu.: 2.000 3rd Qu.: 3.000
## Max. :5333.000 Max. :4995.000 Max. :5636.000
## Abril Mayo Junio Julio
## Min. : -70.000 Min. :-106.00 Min. :-211.000 Min. : -60.000
## 1st Qu.: 0.000 1st Qu.: 0.00 1st Qu.: 0.000 1st Qu.: 0.000
## Median : 0.000 Median : 0.00 Median : 0.000 Median : 0.000
## Mean : 5.992 Mean : 6.73 Mean : 6.464 Mean : 6.033
## 3rd Qu.: 3.000 3rd Qu.: 3.00 3rd Qu.: 3.000 3rd Qu.: 3.000
## Max. :6164.000 Max. :6759.00 Max. :6033.000 Max. :6735.000
## Agosto Septiembre Octubre Noviembre
## Min. :-211.000 Min. :-527.000 Min. : -38.000 Min. : -25.00
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.00
## Median : 0.000 Median : 0.000 Median : 0.000 Median : 0.00
## Mean : 6.235 Mean : 3.625 Mean : 3.674 Mean : 3.57
## 3rd Qu.: 3.000 3rd Qu.: 1.000 3rd Qu.: 1.000 3rd Qu.: 1.00
## Max. :6065.000 Max. :6509.000 Max. :6326.000 Max. :5319.00
## Diciembre Febero Ventas
## Min. : -28.000 Min. : -11.000 Min. : -527.00
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 2.00
## Median : 0.000 Median : 0.000 Median : 7.00
## Mean : 3.858 Mean : 4.829 Mean : 61.69
## 3rd Qu.: 0.000 3rd Qu.: 2.000 3rd Qu.: 26.00
## Max. :6182.000 Max. :4995.000 Max. :62161.00
En esta sección se contestarán las preguntas de la situación problema.
## Warning: package 'ggplot2' was built under R version 4.3.1
ggplot(df, aes(x = Año, y = Ventas)) +
geom_bar(stat="identity") +
labs(
title= "Ventas Anuales",
subtitle= "Arca Continental"
)Podemos ver que en los primeros 4 años de haber integrado el Proyecto Siglo XXI, las ventas anuales han incrementado generalmente
ggplot(df, aes(x = Año, y = Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat="identity") +
labs(
title= "Ventas Anuales",
subtitle= "Arca Continental"
)df2 <- df %>% filter(Tamaño.Cte.Industria=="Extra Grande")
ggplot(df2, aes(x = Año, y = Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat="identity") +
labs(
title= "Ventas Anuales",
subtitle= "Arca Continental"
)df3 <- df %>% filter(Tamaño.Cte.Industria=="Grande")
ggplot(df3, aes(x = Año, y = Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat="identity") +
labs(
title= "Ventas Anuales",
subtitle= "Arca Continental"
)df4 <- df %>% filter(Tamaño.Cte.Industria=="Micro")
ggplot(df4, aes(x = Año, y = Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat="identity") +
labs(
title= "Ventas Anuales",
subtitle= "Arca Continental"
)df5 <- df %>% filter(Tamaño.Cte.Industria=="Pequeño")
ggplot(df5, aes(x = Año, y = Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat="identity") +
labs(
title= "Ventas Anuales",
subtitle= "Arca Continental"
)Existió un incremento en ventas debido al incremento de clientes de empresas grandes, micro y pequeñas. En el 2019 se incorporaron empresas grandes y pequeñas
df6 <- df %>% filter(
Marca== "Coca-Cola"
)
ggplot(df6,aes(x=Año, y=Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat = "Identity") +
labs(
title = "Ventas Anuales de Coca Cola",
subtitle = "Arca Continental"
)df7 <- df %>% filter(Marca=="Sprite")
ggplot(df7, aes(x=Año, y= Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat = "Identity") +
labs(
title = "Ventas Anuales de Sprite",
subtitle = "Arca Continental"
)La marca mas vendida es Coca-Cola. Tuvo un incremento de ventas en el 2019.
df8 <- df %>% filter(Retornable_NR == "Retornable")
ggplot(df8, aes(x=Año, y= Ventas, colour=Tamaño.Cte.Industria)) +
geom_bar(stat = "Identity") +
labs(
title = "Ventas Anuales de Envases Retornables",
subtitle = "Arca Continental"
)No. Solo hubo un incremento en el último año.
colnames(df)[colnames(df) == "Segmento Det"] <- "Segmento.Det"
df9 <- df %>% filter( Segmento.Det=="Agua Purificada" | Segmento.Det=="Isotónicos Regular" | Segmento.Det=="Colas Regular")
ggplot(df9, aes(x=Año, y= Ventas, fill=Segmento.Det)) +
geom_bar(position="dodge", stat = "Identity") +
labs(
title = "Ventas Anuales",
subtitle = "Arca Continental"
)Las ventas de agua purificada y Coca-Cola regular han bajado en el último año. Sin embargo, las bebidas isotónicas han estado en aumento estos años.
df10 <- df %>% filter(Segmento.Det=="Agua Purificada" | Segmento.Det=="Colas Regular")
ggplot(df10, aes(x=Año, y= Ventas, fill=Segmento.Det)) +
geom_bar(position="dodge", stat = "Identity") +
labs(
title = "Ventas Anuales",
subtitle = "Arca Continental"
)No. Tienen diferentes comportamietos y no parece haber una relación.
df11 <- df %>% filter(Marca=="Coca-Cola" & Presentacion=="500 ml NR Vidrio")
df12 <- aggregate(Ventas ~ Año, df11, sum)
df12$Año <- as.integer(df12$Año)
regresion <- lm(Ventas ~ Año, data=df12)
summary(regresion)##
## Call:
## lm(formula = Ventas ~ Año, data = df12)
##
## Residuals:
## 1 2 3 4
## -28810 40146 6139 -17474
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -63451790 33667150 -1.885 0.200
## Año 31643 16688 1.896 0.198
##
## Residual standard error: 37310 on 2 degrees of freedom
## Multiple R-squared: 0.6426, Adjusted R-squared: 0.4639
## F-statistic: 3.596 on 1 and 2 DF, p-value: 0.1984
#Ecuacion de la recta y = -54,970,595 + 27,433*Año
datos <- data.frame(Año=2020)
predict(regresion,datos)## 1
## 467272.5
De acuerdo al modelo predictivo, las ventas esperadas para Coca Cola de 500ml NR Vidrio en 2020 es de 467273 unidades, con una porcentaje de precisión del 46%.