Taller 2:

##Un Data scientest ha diseñado un modelo de analítica prescriptiva para reducir el tiempo de fallas de las máquinas de un proceso de elaboración de galletas. El científico ha validado efectivamente su modelo de analítica contra la información del sistema de mantenimiento empleado en el centro de atención por lo que ahora se encuentra concentrado en probar tres alternativas de mejora que ha diseñado para concluir cuál de ellas debería implementar.

##En la tabla siguiente se muestran 30 réplicas tanto del modelo de mantenimiento actual y las tres diferentes propuestas de mejora que ha logrado proponer. Con base en esta información y mostrando todo el procedimiento respectivo que sustente su respuesta indique cual debe ser la conclusión del científico. ¿Qué propuesta debería implementarse? (Considere un nivel de significancia de 5%)

Carga de datos

Se realiza la carga de las variables y sus datos.

arbol <-c(23.81,    22.13,  22.64,  21.69,  23.58,  22.14,  18.73,  21.59,
          20.36,    20.53,  20.11,  20.34,  19.19,  22.92,  18.65,  20.6,
          19.83,    20.09,  19.43,  22.06,  21.15,  19.26,  18.08,  20.24,
          18.75,    20.69,  21.62,  23.69,  23.93,  23.19)

redn <-c(23.24, 20.08,  18.01,  23.28,  19.23,  21.22,  21.47,  20.6,
         21.11, 21.27,  21.03,  17.34,  22.8,   21.85,  17.85,  23.15,
         19.57, 19.56,  20.79,  18.04,  20.95,  21.83,  18.17,  22.66,
         18.29, 18.89,  19.49,  19.19,  26.47,  25.25)

regresion <-c(16.13,    17.84,  18.28,  15.61,  17.62,  16.12,  17.29,  16.13,
              16.64,    15.03,  18.16,  16.82,  17.44,  16.76,  17.26,  15.55,
              17.49,    18.42,  17.54,  17.13,  15.5,    16.8,  18.47,  18.42, 
              18.43,    15.56,  16.03,  15.39,  15.12, 17.77)

actual <-c(17.09,   15.77,  18.45,  16.55,  22.23,  22.11,  18.26,  18.04,  
           19.66,   19.76,  18.74,  19.02,  18.54,  16.7,   17.57,  19.89,
           19.06,   18.7,   19.39,  19.68,  19.2,   16.85,  19.91,  19.82,  18.08,
           19.38,   20.3,   21.6,   23.39,  19.33)

data2  <- data.frame(ÁrbolC =arbol, Red_N = redn, Regresion = regresion, SActual = actual)

Analisis de variables

Se analisa el tipo de distribucion que siguen las variables:

summary(data2)
##      ÁrbolC          Red_N         Regresion        SActual     
##  Min.   :18.08   Min.   :17.34   Min.   :15.03   Min.   :15.77  
##  1st Qu.:19.89   1st Qu.:19.20   1st Qu.:16.05   1st Qu.:18.12  
##  Median :20.64   Median :20.87   Median :16.98   Median :19.13  
##  Mean   :21.03   Mean   :20.76   Mean   :16.89   Mean   :19.10  
##  3rd Qu.:22.14   3rd Qu.:21.84   3rd Qu.:17.73   3rd Qu.:19.80  
##  Max.   :23.93   Max.   :26.47   Max.   :18.47   Max.   :23.39
par(mfrow=c(2,2))
hist(arbol)
hist(redn)
hist(regresion)
hist(actual)

shapiro.test(actual)
## 
##  Shapiro-Wilk normality test
## 
## data:  actual
## W = 0.96408, p-value = 0.3921
shapiro.test(arbol)
## 
##  Shapiro-Wilk normality test
## 
## data:  arbol
## W = 0.9581, p-value = 0.2768
shapiro.test(redn)
## 
##  Shapiro-Wilk normality test
## 
## data:  redn
## W = 0.95783, p-value = 0.2723
shapiro.test(regresion)
## 
##  Shapiro-Wilk normality test
## 
## data:  regresion
## W = 0.93501, p-value = 0.0668
var.test(actual,arbol)
## 
##  F test to compare two variances
## 
## data:  actual and arbol
## F = 1.0284, num df = 29, denom df = 29, p-value = 0.9404
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.4894759 2.1606362
## sample estimates:
## ratio of variances 
##           1.028387
var.test(actual,redn)
## 
##  F test to compare two variances
## 
## data:  actual and redn
## F = 0.60466, num df = 29, denom df = 29, p-value = 0.1815
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.2877968 1.2703880
## sample estimates:
## ratio of variances 
##          0.6046599
var.test(actual,regresion)
## 
##  F test to compare two variances
## 
## data:  actual and regresion
## F = 2.4576, num df = 29, denom df = 29, p-value = 0.01817
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  1.169751 5.163496
## sample estimates:
## ratio of variances 
##           2.457642

Analisis de distribucion

Al ser una muestra pequeña de datos. y al seguir una normalidad, se usara la distribucion t-student. y se analisara la alternativa de solucion. Se considerara un H0: x1=X2, H1: x1<>x2 (x1: actual, x2: demas variables).

var.test(actual,arbol)
## 
##  F test to compare two variances
## 
## data:  actual and arbol
## F = 1.0284, num df = 29, denom df = 29, p-value = 0.9404
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.4894759 2.1606362
## sample estimates:
## ratio of variances 
##           1.028387
var.test(actual,redn)
## 
##  F test to compare two variances
## 
## data:  actual and redn
## F = 0.60466, num df = 29, denom df = 29, p-value = 0.1815
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.2877968 1.2703880
## sample estimates:
## ratio of variances 
##          0.6046599
var.test(actual,regresion)
## 
##  F test to compare two variances
## 
## data:  actual and regresion
## F = 2.4576, num df = 29, denom df = 29, p-value = 0.01817
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  1.169751 5.163496
## sample estimates:
## ratio of variances 
##           2.457642
t.test(actual,regresion, alternative="two.sided",conf.level=.95,var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  actual and regresion
## t = 5.902, df = 49.248, p-value = 3.26e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1.458045 2.963288
## sample estimates:
## mean of x mean of y 
##  19.10233  16.89167

Se analiza la variable regresión, ya que es la unica variable en la que se rechazo Ho, es decir que hay diferencia significativa.

t.test(actual,regresion, alternative="two.sided",conf.level=.95,var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  actual and regresion
## t = 5.902, df = 49.248, p-value = 3.26e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1.458045 2.963288
## sample estimates:
## mean of x mean of y 
##  19.10233  16.89167

Conclusiones

  1. La alternativa de solucion que presenta diferencia significativa es la de regresion, mostrando una reduccion en la media de tiempos de errores respecto a la actual.
  2. Las demas alternarnativas de solucion (arbol y redn) no mostraron una diferencia significativa (no se rechazo la hipótesis nula, p-value > 0.05).

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.