library(foreign)
library(dplyr) # data manipulation
library(forcats) # to work with categorical variables
library(ggplot2) # data visualization
library(janitor) # data exploration and cleaning
#install.packages("Hmisc")
library(Hmisc) # several useful functions for data analysis
#install.packages("psych")
library(psych) # functions for multivariate analysis
#install.packages("naniar")
library(naniar) # summaries and visualization of missing values NAs
#install.packages("dlookr")
library(dlookr) # summaries and visualization of missing values NAs
#install.packages("corrplot")
library(corrplot) # correlation plots
#install.packages("jtools")
library(jtools) # presentation of regression analysis
#install.packages("lmtest")
library(lmtest) # diagnostic checks - linear regression analysis
#install.packages("car")
library(car) # diagnostic checks - linear regression analysis
#install.packages("olsrr")
library(olsrr) # diagnostic checks - linear regression analysis
#install.packages("kableExtra")
library(kableExtra) # HTML table attributes
library(tidyverse)
file.choose()
produccion<-read.csv( "C:\\Users\\danyc\\Downloads\\Base produccion form - Base produccion form - Base produccion form - Base produccion form.csv.csv.csv")
library(dplyr)
#3988 registros y 15 variables
describe(produccion)
## # A tibble: 2 × 26
## describe…¹ n na mean sd se_mean IQR skewn…² kurto…³ p00 p01
## <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 Laminas.p… 3985 0 102. 134. 2.13 184 2.70 13.1 0 0
## 2 TIEMPO.MA… 496 3489 3.17 7.57 0.340 1 3.72 17.5 0 0
## # … with 15 more variables: p05 <dbl>, p10 <dbl>, p20 <dbl>, p25 <dbl>,
## # p30 <dbl>, p40 <dbl>, p50 <dbl>, p60 <dbl>, p70 <dbl>, p75 <dbl>,
## # p80 <dbl>, p90 <dbl>, p95 <dbl>, p99 <dbl>, p100 <dbl>, and abbreviated
## # variable names ¹described_variables, ²skewness, ³kurtosis
bdp<-produccion
bdp$Fecha<- as.Date(bdp$Fecha, format= "%d/%m/%Y")
summary(bdp)
## Fecha CLIENTE ID.FORM PRODUCTO
## Min. :2022-07-15 Length:3985 Length:3985 Length:3985
## 1st Qu.:2022-08-03 Class :character Class :character Class :character
## Median :2022-08-20 Mode :character Mode :character Mode :character
## Mean :2022-08-19
## 3rd Qu.:2022-09-06
## Max. :2022-09-21
##
## PIEZAS.PROG. TMO..MIN. HR..FIN ESTACION.ARRANQUE
## Length:3985 Length:3985 Length:3985 Length:3985
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## Laminas.procesadas INICIO.SEP.UP FIN.INICIO.DE.SEP.UP INICIO.de.PROCESO
## Min. : 0.0 Length:3985 Length:3985 Length:3985
## 1st Qu.: 0.0 Class :character Class :character Class :character
## Median : 51.0 Mode :character Mode :character Mode :character
## Mean : 102.1
## 3rd Qu.: 184.0
## Max. :1263.0
##
## FIN.de.PROCESO TIEMPO.CALIDAD TIEMPO.MATERIALES
## Length:3985 Length:3985 Min. : 0.000
## Class :character Class :character 1st Qu.: 0.000
## Mode :character Mode :character Median : 0.000
## Mean : 3.169
## 3rd Qu.: 1.000
## Max. :60.000
## NA's :3489
tibble(bdp)
## # A tibble: 3,985 × 15
## Fecha CLIENTE ID.FORM PRODU…¹ PIEZA…² TMO..…³ HR..FIN ESTAC…⁴ Lamin…⁵
## <date> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <int>
## 1 2022-07-16 TRMX 00-059… "TGTX.… 1 "10" "9:05" C1Y2 3
## 2 2022-07-22 STABILUS 3 00-00-… "MOTOR… 1 "10" "10:40" C1Y2 2
## 3 2022-07-28 STABILUS 3 00-00-… "MOTOR… 1 "10" "11:20" C1Y2 2
## 4 2022-08-12 TRMX TR-059… "TR137… 1 "10" "9:35" C1 1
## 5 2022-08-12 TRMX TR-059… "TR137… 1 "10" "9:45" C1 1
## 6 2022-09-10 DENSO DN-034… "MCV. … 1 "10" "8:45" c1y2 1
## 7 2022-07-23 DENSO DN-034… "TOYOT… 2 "" "" CELDAS 0
## 8 2022-08-05 HELLA HE-073… "SUDAF… 2 "10" "11:20" C1Y2 3
## 9 2022-08-05 HELLA HE-073… "SUDAF… 2 "10" "11:30" C1Y2 0
## 10 2022-08-05 HELLA HE-073… "SUDAF… 2 "10" "11:40" C1Y2 0
## # … with 3,975 more rows, 6 more variables: INICIO.SEP.UP <chr>,
## # FIN.INICIO.DE.SEP.UP <chr>, INICIO.de.PROCESO <chr>, FIN.de.PROCESO <chr>,
## # TIEMPO.CALIDAD <chr>, TIEMPO.MATERIALES <int>, and abbreviated variable
## # names ¹PRODUCTO, ²PIEZAS.PROG., ³TMO..MIN., ⁴ESTACION.ARRANQUE,
## # ⁵Laminas.procesadas
bdp1<-bdp
bdp1 <- subset(bdp1, select =-c (ID.FORM))
bdp1 <- subset(bdp1, select =-c (INICIO.SEP.UP,FIN.INICIO.DE.SEP.UP, TIEMPO.MATERIALES))
bdp1 <- subset(bdp1, select =-c (HR..FIN, INICIO.de.PROCESO, FIN.de.PROCESO))
colnames(bdp1)<-c('fecha','cliente','producto','piezas_prog','tiempo_min','esta_arranque','laminas_procesadas','tiempo_calidad')
bdp1$piezas_prog<-as.numeric(bdp1$piezas_prog)
## Warning: NAs introducidos por coerción
bdp1$tiempo_min<-as.numeric(bdp1$tiempo_min)
## Warning: NAs introducidos por coerción
bdp1$laminas_procesadas<-as.numeric(bdp1$laminas_procesadas)
bdp1$tiempo_calidad<-as.numeric(bdp1$tiempo_calidad)
## Warning: NAs introducidos por coerción
bdp2<-bdp1
bdp2$tiempo_min <- substr(bdp2$tiempo_min, start = 1, stop = 2)
tibble(bdp2)
## # A tibble: 3,985 × 8
## fecha cliente producto pieza…¹ tiemp…² esta_…³ lamin…⁴ tiemp…⁵
## <date> <chr> <chr> <dbl> <chr> <chr> <dbl> <dbl>
## 1 2022-07-16 TRMX "TGTX. CAJA RS… 1 10 C1Y2 3 1
## 2 2022-07-22 STABILUS 3 "MOTORGEAR. KI… 1 10 C1Y2 2 1
## 3 2022-07-28 STABILUS 3 "MOTORGEAR. KI… 1 10 C1Y2 2 2
## 4 2022-08-12 TRMX "TR13773. CAJA… 1 10 C1 1 1
## 5 2022-08-12 TRMX "TR13776. CAJA… 1 10 C1 1 1
## 6 2022-09-10 DENSO "MCV. VALVE. P… 1 10 c1y2 1 NA
## 7 2022-07-23 DENSO "TOYOTA. MCV. … 2 <NA> CELDAS 0 0
## 8 2022-08-05 HELLA "SUDAFRICA. TA… 2 10 C1Y2 3 1
## 9 2022-08-05 HELLA "SUDAFRICA. \"… 2 10 C1Y2 0 0
## 10 2022-08-05 HELLA "SUDAFRICA. PA… 2 10 C1Y2 0 0
## # … with 3,975 more rows, and abbreviated variable names ¹piezas_prog,
## # ²tiempo_min, ³esta_arranque, ⁴laminas_procesadas, ⁵tiempo_calidad
bdp2$tiempo_min <- as.integer(bdp2$tiempo_min)
str(bdp2)
## 'data.frame': 3985 obs. of 8 variables:
## $ fecha : Date, format: "2022-07-16" "2022-07-22" ...
## $ cliente : chr "TRMX" "STABILUS 3" "STABILUS 3" "TRMX" ...
## $ producto : chr "TGTX. CAJA RSC. ( 1 Pieza) con SOBRE. Kit: TR-059-19014" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "TR13773. CAJA RSC Imp. Negra con SOBRE ( 2 Partes). PC0048." ...
## $ piezas_prog : num 1 1 1 1 1 1 2 2 2 2 ...
## $ tiempo_min : int 10 10 10 10 10 10 NA 10 10 10 ...
## $ esta_arranque : chr "C1Y2" "C1Y2" "C1Y2" "C1" ...
## $ laminas_procesadas: num 3 2 2 1 1 1 0 3 0 0 ...
## $ tiempo_calidad : num 1 1 2 1 1 NA 0 1 0 0 ...
bdp2$piezas_prog <- substr(bdp2$piezas_prog, start = 1, stop = 2)
tibble(bdp2)
## # A tibble: 3,985 × 8
## fecha cliente producto pieza…¹ tiemp…² esta_…³ lamin…⁴ tiemp…⁵
## <date> <chr> <chr> <chr> <int> <chr> <dbl> <dbl>
## 1 2022-07-16 TRMX "TGTX. CAJA RS… 1 10 C1Y2 3 1
## 2 2022-07-22 STABILUS 3 "MOTORGEAR. KI… 1 10 C1Y2 2 1
## 3 2022-07-28 STABILUS 3 "MOTORGEAR. KI… 1 10 C1Y2 2 2
## 4 2022-08-12 TRMX "TR13773. CAJA… 1 10 C1 1 1
## 5 2022-08-12 TRMX "TR13776. CAJA… 1 10 C1 1 1
## 6 2022-09-10 DENSO "MCV. VALVE. P… 1 10 c1y2 1 NA
## 7 2022-07-23 DENSO "TOYOTA. MCV. … 2 NA CELDAS 0 0
## 8 2022-08-05 HELLA "SUDAFRICA. TA… 2 10 C1Y2 3 1
## 9 2022-08-05 HELLA "SUDAFRICA. \"… 2 10 C1Y2 0 0
## 10 2022-08-05 HELLA "SUDAFRICA. PA… 2 10 C1Y2 0 0
## # … with 3,975 more rows, and abbreviated variable names ¹piezas_prog,
## # ²tiempo_min, ³esta_arranque, ⁴laminas_procesadas, ⁵tiempo_calidad
bdp2$piezas_prog <- as.integer(bdp2$piezas_prog)
str(bdp2)
## 'data.frame': 3985 obs. of 8 variables:
## $ fecha : Date, format: "2022-07-16" "2022-07-22" ...
## $ cliente : chr "TRMX" "STABILUS 3" "STABILUS 3" "TRMX" ...
## $ producto : chr "TGTX. CAJA RSC. ( 1 Pieza) con SOBRE. Kit: TR-059-19014" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "TR13773. CAJA RSC Imp. Negra con SOBRE ( 2 Partes). PC0048." ...
## $ piezas_prog : int 1 1 1 1 1 1 2 2 2 2 ...
## $ tiempo_min : int 10 10 10 10 10 10 NA 10 10 10 ...
## $ esta_arranque : chr "C1Y2" "C1Y2" "C1Y2" "C1" ...
## $ laminas_procesadas: num 3 2 2 1 1 1 0 3 0 0 ...
## $ tiempo_calidad : num 1 1 2 1 1 NA 0 1 0 0 ...
bdp2$laminas_procesadas <- substr(bdp2$laminas_procesadas, start = 1, stop = 2)
tibble(bdp2)
## # A tibble: 3,985 × 8
## fecha cliente producto pieza…¹ tiemp…² esta_…³ lamin…⁴ tiemp…⁵
## <date> <chr> <chr> <int> <int> <chr> <chr> <dbl>
## 1 2022-07-16 TRMX "TGTX. CAJA RS… 1 10 C1Y2 3 1
## 2 2022-07-22 STABILUS 3 "MOTORGEAR. KI… 1 10 C1Y2 2 1
## 3 2022-07-28 STABILUS 3 "MOTORGEAR. KI… 1 10 C1Y2 2 2
## 4 2022-08-12 TRMX "TR13773. CAJA… 1 10 C1 1 1
## 5 2022-08-12 TRMX "TR13776. CAJA… 1 10 C1 1 1
## 6 2022-09-10 DENSO "MCV. VALVE. P… 1 10 c1y2 1 NA
## 7 2022-07-23 DENSO "TOYOTA. MCV. … 2 NA CELDAS 0 0
## 8 2022-08-05 HELLA "SUDAFRICA. TA… 2 10 C1Y2 3 1
## 9 2022-08-05 HELLA "SUDAFRICA. \"… 2 10 C1Y2 0 0
## 10 2022-08-05 HELLA "SUDAFRICA. PA… 2 10 C1Y2 0 0
## # … with 3,975 more rows, and abbreviated variable names ¹piezas_prog,
## # ²tiempo_min, ³esta_arranque, ⁴laminas_procesadas, ⁵tiempo_calidad
bdp2$laminas_procesadas <- as.integer(bdp2$laminas_procesadas)
str(bdp2)
## 'data.frame': 3985 obs. of 8 variables:
## $ fecha : Date, format: "2022-07-16" "2022-07-22" ...
## $ cliente : chr "TRMX" "STABILUS 3" "STABILUS 3" "TRMX" ...
## $ producto : chr "TGTX. CAJA RSC. ( 1 Pieza) con SOBRE. Kit: TR-059-19014" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "TR13773. CAJA RSC Imp. Negra con SOBRE ( 2 Partes). PC0048." ...
## $ piezas_prog : int 1 1 1 1 1 1 2 2 2 2 ...
## $ tiempo_min : int 10 10 10 10 10 10 NA 10 10 10 ...
## $ esta_arranque : chr "C1Y2" "C1Y2" "C1Y2" "C1" ...
## $ laminas_procesadas: int 3 2 2 1 1 1 0 3 0 0 ...
## $ tiempo_calidad : num 1 1 2 1 1 NA 0 1 0 0 ...
bdp3 <- bdp2
bdp3$tiempo_min[is.na(bdp3$tiempo_min)]<-mean(bdp3$tiempo_min, na.rm = TRUE)
summary (bdp3)
## fecha cliente producto piezas_prog
## Min. :2022-07-15 Length:3985 Length:3985 Min. : 1.0
## 1st Qu.:2022-08-03 Class :character Class :character 1st Qu.:12.0
## Median :2022-08-20 Mode :character Mode :character Median :20.0
## Mean :2022-08-19 Mean :27.2
## 3rd Qu.:2022-09-06 3rd Qu.:40.0
## Max. :2022-09-21 Max. :99.0
## NA's :179
## tiempo_min esta_arranque laminas_procesadas tiempo_calidad
## Min. : 0.00 Length:3985 Min. : 0.00 Min. : 0.0000
## 1st Qu.:15.00 Class :character 1st Qu.: 0.00 1st Qu.: 0.0000
## Median :22.13 Mode :character Median :19.00 Median : 1.0000
## Mean :22.13 Mean :21.42 Mean : 0.8628
## 3rd Qu.:25.00 3rd Qu.:32.00 3rd Qu.: 1.0000
## Max. :90.00 Max. :98.00 Max. :22.0000
## NA's :343
bdp4 <- bdp3
bdp4$laminas_procesadas[bdp4$laminas_procesadas < 1]<- NA
summary (bdp4)
## fecha cliente producto piezas_prog
## Min. :2022-07-15 Length:3985 Length:3985 Min. : 1.0
## 1st Qu.:2022-08-03 Class :character Class :character 1st Qu.:12.0
## Median :2022-08-20 Mode :character Mode :character Median :20.0
## Mean :2022-08-19 Mean :27.2
## 3rd Qu.:2022-09-06 3rd Qu.:40.0
## Max. :2022-09-21 Max. :99.0
## NA's :179
## tiempo_min esta_arranque laminas_procesadas tiempo_calidad
## Min. : 0.00 Length:3985 Min. : 1.00 Min. : 0.0000
## 1st Qu.:15.00 Class :character 1st Qu.:15.00 1st Qu.: 0.0000
## Median :22.13 Mode :character Median :21.00 Median : 1.0000
## Mean :22.13 Mean :30.08 Mean : 0.8628
## 3rd Qu.:25.00 3rd Qu.:41.00 3rd Qu.: 1.0000
## Max. :90.00 Max. :98.00 Max. :22.0000
## NA's :1148 NA's :343
bdp5 <- bdp4
bdp5 <- na.omit(bdp5)
str(bdp5)
## 'data.frame': 2679 obs. of 8 variables:
## $ fecha : Date, format: "2022-07-16" "2022-07-22" ...
## $ cliente : chr "TRMX" "STABILUS 3" "STABILUS 3" "TRMX" ...
## $ producto : chr "TGTX. CAJA RSC. ( 1 Pieza) con SOBRE. Kit: TR-059-19014" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "TR13773. CAJA RSC Imp. Negra con SOBRE ( 2 Partes). PC0048." ...
## $ piezas_prog : int 1 1 1 1 1 2 3 3 4 4 ...
## $ tiempo_min : num 10 10 10 10 10 10 10 10 10 10 ...
## $ esta_arranque : chr "C1Y2" "C1Y2" "C1Y2" "C1" ...
## $ laminas_procesadas: int 3 2 2 1 1 3 2 5 5 10 ...
## $ tiempo_calidad : num 1 1 2 1 1 1 0 1 1 1 ...
## - attr(*, "na.action")= 'omit' Named int [1:1306] 6 7 9 10 18 22 25 27 28 30 ...
## ..- attr(*, "names")= chr [1:1306] "6" "7" "9" "10" ...
colSums(is.na(bdp5))
## fecha cliente producto piezas_prog
## 0 0 0 0
## tiempo_min esta_arranque laminas_procesadas tiempo_calidad
## 0 0 0 0
summary(bdp5)
## fecha cliente producto piezas_prog
## Min. :2022-07-15 Length:2679 Length:2679 Min. : 1.00
## 1st Qu.:2022-08-02 Class :character Class :character 1st Qu.:13.00
## Median :2022-08-18 Mode :character Mode :character Median :20.00
## Mean :2022-08-18 Mean :26.53
## 3rd Qu.:2022-09-02 3rd Qu.:32.50
## Max. :2022-09-21 Max. :99.00
## tiempo_min esta_arranque laminas_procesadas tiempo_calidad
## Min. : 0.00 Length:2679 Min. : 1.00 Min. : 0.00
## 1st Qu.:15.00 Class :character 1st Qu.:16.00 1st Qu.: 1.00
## Median :20.00 Mode :character Median :21.00 Median : 1.00
## Mean :22.16 Mean :30.18 Mean : 1.16
## 3rd Qu.:25.00 3rd Qu.:41.00 3rd Qu.: 1.00
## Max. :90.00 Max. :98.00 Max. :22.00
str(bdp5)
## 'data.frame': 2679 obs. of 8 variables:
## $ fecha : Date, format: "2022-07-16" "2022-07-22" ...
## $ cliente : chr "TRMX" "STABILUS 3" "STABILUS 3" "TRMX" ...
## $ producto : chr "TGTX. CAJA RSC. ( 1 Pieza) con SOBRE. Kit: TR-059-19014" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "MOTORGEAR. KIT. TAPA GRAL. Grapada. 1 Pza/ Kit. ( Kit 19211)" "TR13773. CAJA RSC Imp. Negra con SOBRE ( 2 Partes). PC0048." ...
## $ piezas_prog : int 1 1 1 1 1 2 3 3 4 4 ...
## $ tiempo_min : num 10 10 10 10 10 10 10 10 10 10 ...
## $ esta_arranque : chr "C1Y2" "C1Y2" "C1Y2" "C1" ...
## $ laminas_procesadas: int 3 2 2 1 1 3 2 5 5 10 ...
## $ tiempo_calidad : num 1 1 2 1 1 1 0 1 1 1 ...
## - attr(*, "na.action")= 'omit' Named int [1:1306] 6 7 9 10 18 22 25 27 28 30 ...
## ..- attr(*, "names")= chr [1:1306] "6" "7" "9" "10" ...
summary(bdp5)
## fecha cliente producto piezas_prog
## Min. :2022-07-15 Length:2679 Length:2679 Min. : 1.00
## 1st Qu.:2022-08-02 Class :character Class :character 1st Qu.:13.00
## Median :2022-08-18 Mode :character Mode :character Median :20.00
## Mean :2022-08-18 Mean :26.53
## 3rd Qu.:2022-09-02 3rd Qu.:32.50
## Max. :2022-09-21 Max. :99.00
## tiempo_min esta_arranque laminas_procesadas tiempo_calidad
## Min. : 0.00 Length:2679 Min. : 1.00 Min. : 0.00
## 1st Qu.:15.00 Class :character 1st Qu.:16.00 1st Qu.: 1.00
## Median :20.00 Mode :character Median :21.00 Median : 1.00
## Mean :22.16 Mean :30.18 Mean : 1.16
## 3rd Qu.:25.00 3rd Qu.:41.00 3rd Qu.: 1.00
## Max. :90.00 Max. :98.00 Max. :22.00
Variable<-c("Fecha ","cliente","producto", "Piezas programadas","tiempo min","Estacion de arranque","Laminas procesadas", "Tiempo de calidad")
Type<-c("Cualitativa","Cualitativa","Cualitativa", "Cuantitativa(Discreta)", "Cuantitativa(Discreta)","Cualitativa", "Cuantitativa(Discreta)", "Cuantitativa discreta")
Medicion <-c("Nominal", "Nominal","Nominal", "Intervalo", "Intervalo","Nominal", "Intervalo", "Intervalo")
table<-data.frame(Variable,Type, Medicion)
knitr::kable(table)
| Variable | Type | Medicion |
|---|---|---|
| Fecha | Cualitativa | Nominal |
| cliente | Cualitativa | Nominal |
| producto | Cualitativa | Nominal |
| Piezas programadas | Cuantitativa(Discreta) | Intervalo |
| tiempo min | Cuantitativa(Discreta) | Intervalo |
| Estacion de arranque | Cualitativa | Nominal |
| Laminas procesadas | Cuantitativa(Discreta) | Intervalo |
| Tiempo de calidad | Cuantitativa discreta | Intervalo |
write.csv(bdp5,"C:\\Users\\danyc\\OneDrive - Instituto Tecnologico y de Estudios Superiores de Monterrey\\Desktop\\Form_produccionbaselimpia.csv", row.names=FALSE)
bdl<-read.csv("C:\\Users\\danyc\\OneDrive - Instituto Tecnologico y de Estudios Superiores de Monterrey\\Desktop\\Form_produccionbaselimpia.csv")
summary(bdl)
## fecha cliente producto piezas_prog
## Length:2679 Length:2679 Length:2679 Min. : 1.00
## Class :character Class :character Class :character 1st Qu.:13.00
## Mode :character Mode :character Mode :character Median :20.00
## Mean :26.53
## 3rd Qu.:32.50
## Max. :99.00
## tiempo_min esta_arranque laminas_procesadas tiempo_calidad
## Min. : 0.00 Length:2679 Min. : 1.00 Min. : 0.00
## 1st Qu.:15.00 Class :character 1st Qu.:16.00 1st Qu.: 1.00
## Median :20.00 Mode :character Median :21.00 Median : 1.00
## Mean :22.16 Mean :30.18 Mean : 1.16
## 3rd Qu.:25.00 3rd Qu.:41.00 3rd Qu.: 1.00
## Max. :90.00 Max. :98.00 Max. :22.00
Los datos aqui muestran una desviacion estandar y datos muy alejados entre los puntos variables lo cual nos indica una alteracion en la uniformidad de los datos lo cual nos puede indicar alguna falla en los datos o bien un detalle de productividad.
bd6<-bdl
table<-describe(bdl)
Recopilando la informacion me tope con estos datos lo cual nos informa acerca de los clientes mas destacados para form y el tiempo minimo de tardanza en el ensamblaje de los productos, en este caso el primer lugar con m’as eficiencia por cliente fue stabilus en la primera vuelta.
bd6<-bd6 %>% select(cliente,piezas_prog,tiempo_min) %>% group_by(cliente) %>%
summarise(piezas_prog=sum(piezas_prog),tiempo_min=sum(tiempo_min)) %>% arrange(desc(piezas_prog))
bd6<-bd6[-c(6,7,8,9,10,11),]
ggplot(bd6,aes(x=reorder(tiempo_min,piezas_prog), y=piezas_prog,fill=cliente)) +
geom_bar(stat="identity")
Dentro de esta segunda tabla de barras se puede ver desplegado la cantidad de piezas programadas que se tuvo por mes en los periodos de los meses julio, agosto y septiembre. Esto nos dice acerca de la mayor productividad de agosto, pero porque es esto?
datoscopia<-bdl
datoscopia$ano<-strftime(datoscopia$fecha, "%Y")
datoscopia$mes<-strftime(datoscopia$fecha, "%m")
data_agg<- aggregate(piezas_prog~mes + ano, datoscopia, FUN = sum)
data_agglamina<- aggregate(laminas_procesadas~mes + ano, datoscopia, FUN = sum)
ggplot(data_agg,aes(x=mes,y=piezas_prog)) +
geom_bar(stat="identity")
En esta grafica se puede visualizar la dependencia del tiempo minimo de produccion con las piezas programadas dependiendo de la estacion de arranque, C1 y 2 juntas hacen que se aumente la productividad por lo visto mayormente la estacion C1.
ggplot(datoscopia,aes(x=tiempo_min, y=piezas_prog,fill=esta_arranque)) +
geom_bar(stat="identity")
Viendo las series de tiempo se puede ver una inestabilidad dentro de las fechas y las piezas diciendonos que no es un proceso lineal.
ggplot(datoscopia,aes(x=fecha))+
geom_line(aes(y=piezas_prog),color="orange")+
labs(x="Fecha",y="piezas programadas", color="orange")+
ggtitle("Grafica de tasa de rendimiento")
#install.packages("forecast")
library(forecast)
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
#file.choose()
externo<- read.csv("C:\\Users\\danyc\\Downloads\\externa_bd3 csv3.csv")
produccion_mexico<- c(externo$MEX)
produccion_usa<- c(externo$USA)
produccionm<-ts(data=produccion_mexico, start=c(2016,1), frequency=1)
produccionu<-ts(data=produccion_usa, start=c(2016,1), frequency=1)
produccionm
## Time Series:
## Start = 2016
## End = 2021
## Frequency = 1
## [1] 103442.8 112230.6 120638.5 128470.9 129871.3 143560.9
produccionu
## Time Series:
## Start = 2016
## End = 2021
## Frequency = 1
## [1] 48847.2 51672.2 54005.8 55387.1 54651.0 59030.7
modelom<- auto.arima(produccionm)
modelou<- auto.arima(produccionu)
modelom
## Series: produccionm
## ARIMA(0,1,0) with drift
##
## Coefficients:
## drift
## 8023.620
## s.e. 1752.032
##
## sigma^2 = 19186921: log likelihood = -48.46
## AIC=100.92 AICc=106.92 BIC=100.14
modelou
## Series: produccionu
## ARIMA(0,1,0)
##
## sigma^2 = 7012061: log likelihood = -46.5
## AIC=95 AICc=96.34 BIC=94.61
pronosticom <- forecast(modelom, level=c(95), h=4)
pronosticom
## Point Forecast Lo 95 Hi 95
## 2022 151584.5 142999.3 160169.7
## 2023 159608.1 147466.8 171749.5
## 2024 167631.8 152761.7 182501.8
## 2025 175655.4 158485.0 192825.8
plot(pronosticom)
pronosticou <- forecast(modelou, level=c(95), h=4)
pronosticou
## Point Forecast Lo 95 Hi 95
## 2022 59030.7 53840.66 64220.74
## 2023 59030.7 51690.87 66370.53
## 2024 59030.7 50041.28 68020.12
## 2025 59030.7 48650.61 69410.79
plot(pronosticou)
#file.choose()
formproduccion<- read.csv("C:\\Users\\danyc\\OneDrive - Instituto Tecnologico y de Estudios Superiores de Monterrey\\Desktop\\Form_produccionbaselimpia.csv")
produccionform<- c(formproduccion$laminas_procesadas)
produccionf<-ts(data=produccionform, start=c(2022,7), end=c(2025, 12), frequency=12)
produccionf
## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 2022 3 2 2 1 1 3
## 2023 2 5 5 10 5 1 5 7 12 4 7 1
## 2024 15 9 9 9 10 18 22 22 9 45 22 11
## 2025 22 11 11 21 11 11 11 6 11 11 11 11
modelof<- auto.arima(produccionf)
modelof
## Series: produccionf
## ARIMA(0,1,1)
##
## Coefficients:
## ma1
## -0.6769
## s.e. 0.1024
##
## sigma^2 = 48.56: log likelihood = -137.57
## AIC=279.15 AICc=279.46 BIC=282.57
pronosticof <- forecast(modelof, level=c(95), h=3)
pronosticof
## Point Forecast Lo 95 Hi 95
## Jan 2026 10.93116 -2.726488 24.58882
## Feb 2026 10.93116 -3.421881 25.28421
## Mar 2026 10.93116 -4.085106 25.94743
plot(pronosticof)