Desarrollo

El archivo ā€œfallos.csvā€ contiene la información de las caracterĆ­sticas fĆ­sicas y del comportamiento de las terminales transaccionales, ademĆ”s, se encuentra la variable denominada ā€œfalloā€ que indica si la terminal transaccional falló en su funcionamiento

fallos <- read.csv2("~/Downloads/Pruebas Cientifico de Datos y PO/fallos.csv")

require(ggplot2)
require(plotly)
require(ggpubr)
require(CGPfunctions)
require(gmodels)
require(CGPfunctions)
library(devtools)
install_github("vqv/ggbiplot")
require(factoextra)
require(dplyr)
require(corrplot)
require(tidyverse)
require(caret)

pillar::glimpse(fallos)
## Rows: 199,998
## Columns: 40
## $ mcodes                       <dbl> 33377982, 40596786, 47126784, 35334915, 4…
## $ terminal                     <chr> "1062A26IO473", "1383G8382195", "1257A3QL…
## $ estado_terminal              <chr> "Activo", "Activo", "Activo", "Activo", "…
## $ producto_red                 <chr> "g", "e", "g", "u", "g", "g", "g", "u", "…
## $ tecnologiapp                 <chr> "b", "b", "b", "b", "b", "b", "b", "b", "…
## $ modelopp                     <chr> "l", "l", "l", "l", "l", "l", "l", "l", "…
## $ tecnologiaaf                 <chr> "c", "c", "c", "c", "c", "c", "c", "c", "…
## $ modeloaf                     <chr> "j", "j", "j", "j", "j", "j", "j", "j", "…
## $ browser                      <chr> "j", "j", "j", "i", "j", "j", "j", "j", "…
## $ nombretipoter                <chr> "g", "d", "g", "g", "g", "g", "g", "g", "…
## $ grupo_version                <chr> "h", "j", "h", "g", "h", "h", "h", "h", "…
## $ mcc                          <chr> "aaaaaj", "aaad", "aab", "p", "aaaaf", "a…
## $ grupo_version_ant            <chr> "k", "g", "g", "e", "k", "k", "k", "k", "…
## $ ciudadfin                    <chr> "C\xdaCUTA", "VILLAVICENCIO", "BARRANQUIL…
## $ trx_dia_cero                 <int> 63, 39, 3, 9, 18, 12, 0, 0, 78, 0, 30, 9,…
## $ trx_dia_uno                  <int> 0, 57, 9, 30, 21, 3, 0, 0, 81, 0, 33, 6, …
## $ trx_dia_dos                  <int> 0, 54, 6, 21, 3, 0, 0, 0, 51, 0, 24, 3, 3…
## $ trx_dia_tres                 <int> 0, 48, 3, 18, 21, 3, 0, 0, 105, 0, 6, 6, …
## $ trx_dia_cuatro               <int> 0, 24, 9, 12, 3, 0, 0, 0, 72, 15, 15, 6, …
## $ trx_dia_cinco                <int> 3, 6, 12, 24, 9, 6, 3, 3, 27, 3, 12, 3, 3…
## $ trx_dia_seis                 <int> 57, 0, 0, 0, 6, 0, 12, 0, 81, 0, 33, 0, 1…
## $ trx_mes_tres                 <int> 186, 855, 186, 495, 117, 30, 123, 18, 72,…
## $ trx_mes_dos                  <int> 660, 960, 300, 390, 180, 87, 252, 33, 156…
## $ trx_mes_uno                  <int> 66, 228, 42, 114, 75, 24, 3, 3, 414, 18, …
## $ prom_mes_tres                <dbl> 2.0666667, 9.5000000, 2.0666667, 5.500000…
## $ prom_mes_dos                 <dbl> 7.3333333, 10.6666667, 3.3333333, 4.33333…
## $ prom_mes_uno                 <dbl> 3.6666667, 12.6666667, 2.3333333, 6.33333…
## $ total_terminales             <int> 21, 12, 36, 3, 33, 3, 3, 3, 12, 3, 6, 48,…
## $ cantidad_falla_m3            <int> 9, 0, 0, 0, 3, 0, 0, 0, 9, 0, 0, 21, 3, 3…
## $ cantidad_falla_m2            <int> 6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 18, 6, 6…
## $ cantidad_falla_mes1          <int> 9, 6, 0, 0, 3, 0, 0, 0, 3, 0, 0, 12, 3, 3…
## $ antiguedad_creacion_terminal <int> 670, 2123, 372, 2216, 463, 51, 466, 1388,…
## $ antiguedad_version           <int> 131, 199, 372, 379, 75, 42, 74, 92, 702, …
## $ antiguedad_compra_pos        <int> 1068, 1068, 785, 1298, 837, 894, 894, 102…
## $ antiguedad_puesta_pos        <int> 49, 0, 0, 0, 75, 42, 74, 72, 0, 269, 0, 4…
## $ clase_falla                  <chr> "a", "a", "a", "a", "a", "a", "a", "a", "…
## $ fallo                        <int> 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ fecha_fallo                  <chr> "", "25/10/18 10:12", "", "22/10/18 17:45…
## $ fecha_observacion            <chr> "6/10/18", "6/10/18", "6/10/18", "6/10/18…
## $ fallo.name                   <chr> "Sin fallo", "Fallo", "Sin fallo", "Fallo…

Variables Categoricas AnÔlisis univariado (caracterización)

Variable categórica Tecnología App

Variable categórica Modelo App

Variable categórica Browser

Variable categórica Nombretipoter

# h1 = ggplot(fallos,aes(fallos$producto_red))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Atributo del tipo de servicio",y="Frecuencia") + ggtitle("Producto Red")

ud1 = ggplot(fallos,aes(fallos$tecnologiapp))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Tecnologƭa soportada por datƔfono ",y="Frecuencia") + ggtitle("Tecnologiapp")  + geom_text(aes(label=..count..), stat='count',position=position_dodge(0.9),vjust=-0.9,hjust=0.5, size=3)

ud2 = ggplot(fallos,aes(fallos$modelopp))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Modelo del datƔfono ",y="Frecuencia") + ggtitle("Modelopp")
# 
# h4 = ggplot(fallos,aes(fallos$tecnologiaaf))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="TecnologĆ­a leĆ­da en el monitoreo remoto",y="Frecuencia") + ggtitle("Tecnologiaaf")  + geom_text(aes(label=..count..), stat='count',position=position_dodge(0.9),vjust=-0.9,hjust=0.5, size=3)
# 
# h5 = ggplot(fallos,aes(fallos$modeloaf))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Modelo leĆ­da en el monitoreo",y="Frecuencia") + ggtitle("Modeloaf")

ud3 = ggplot(fallos,aes(fallos$browser))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Browser de la arquitectura del datafono",y="Frecuencia") + ggtitle("Browser")

ud4 = ggplot(fallos,aes(fallos$nombretipoter))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Tipo de terminal configurada lógicamente",y="Frecuencia") + ggtitle("Nombretipoter")

# h8 = ggplot(fallos,aes(fallos$grupo_version))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Versión de arquitectura",y="Frecuencia") + ggtitle("Grupo Versión")
# 
# h9 = ggplot(fallos,aes(fallos$mcc))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Segmento económico",y="Frecuencia") + ggtitle("MCC") 
# 
# h10 = ggplot(fallos,aes(fallos$grupo_version))+geom_bar(width=0.5, colour="coral3", fill="coral3") + labs(x="Versión de arquitectura datÔfono agrupada por el número y el parche, ",y="Frecuencia") + ggtitle("Grupo Versión")
# 
# h11= ggplot(fallos,aes(fallos$trx_dia_cero))+geom_boxplot(width=0.5, colour="coral3", fill="coral3") + labs(x="Versión de arquitectura datÔfono agrupada por el número y el parche, ",y="Frecuencia") + ggtitle("Grupo Versión")

# ggarrange(ud1,ud2,ud3,ud4,common.legend = TRUE,nrow = 4,ncol = 2)

ggplotly(ud1)
ggplotly(ud2)
ggplotly(ud3)
ggplotly(ud4)

Variables Númericas AnÔlisis univariado (caracterización)

colnames(fallos)
##  [1] "mcodes"                       "terminal"                    
##  [3] "estado_terminal"              "producto_red"                
##  [5] "tecnologiapp"                 "modelopp"                    
##  [7] "tecnologiaaf"                 "modeloaf"                    
##  [9] "browser"                      "nombretipoter"               
## [11] "grupo_version"                "mcc"                         
## [13] "grupo_version_ant"            "ciudadfin"                   
## [15] "trx_dia_cero"                 "trx_dia_uno"                 
## [17] "trx_dia_dos"                  "trx_dia_tres"                
## [19] "trx_dia_cuatro"               "trx_dia_cinco"               
## [21] "trx_dia_seis"                 "trx_mes_tres"                
## [23] "trx_mes_dos"                  "trx_mes_uno"                 
## [25] "prom_mes_tres"                "prom_mes_dos"                
## [27] "prom_mes_uno"                 "total_terminales"            
## [29] "cantidad_falla_m3"            "cantidad_falla_m2"           
## [31] "cantidad_falla_mes1"          "antiguedad_creacion_terminal"
## [33] "antiguedad_version"           "antiguedad_compra_pos"       
## [35] "antiguedad_puesta_pos"        "clase_falla"                 
## [37] "fallo"                        "fecha_fallo"                 
## [39] "fecha_observacion"            "fallo.name"
fallos_numerical_des_1 = fallos[,c(15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37)]
des_1 = round(cor(fallos_numerical_des_1), digits = 2)
corrplot(des_1, order = 'hclust', addrect = 2)

summary(fallos_numerical_des_1)
##   trx_dia_cero      trx_dia_uno       trx_dia_dos       trx_dia_tres    
##  Min.   :   0.00   Min.   :   0.00   Min.   :   0.00   Min.   :   0.00  
##  1st Qu.:   0.00   1st Qu.:   0.00   1st Qu.:   0.00   1st Qu.:   0.00  
##  Median :   3.00   Median :   3.00   Median :   6.00   Median :   3.00  
##  Mean   :  15.63   Mean   :  15.29   Mean   :  19.06   Mean   :  18.02  
##  3rd Qu.:  15.00   3rd Qu.:  15.00   3rd Qu.:  18.00   3rd Qu.:  15.00  
##  Max.   :1605.00   Max.   :1539.00   Max.   :2031.00   Max.   :1866.00  
##  trx_dia_cuatro    trx_dia_cinco      trx_dia_seis      trx_mes_tres    
##  Min.   :   0.00   Min.   :   0.00   Min.   :   0.00   Min.   :    3.0  
##  1st Qu.:   0.00   1st Qu.:   0.00   1st Qu.:   0.00   1st Qu.:   60.0  
##  Median :   6.00   Median :   6.00   Median :   3.00   Median :  174.0  
##  Mean   :  20.26   Mean   :  17.68   Mean   :  16.09   Mean   :  532.8  
##  3rd Qu.:  18.00   3rd Qu.:  15.00   3rd Qu.:  15.00   3rd Qu.:  510.0  
##  Max.   :1590.00   Max.   :1998.00   Max.   :2175.00   Max.   :39150.0  
##   trx_mes_dos       trx_mes_uno      prom_mes_tres       prom_mes_dos     
##  Min.   :    3.0   Min.   :    3.0   Min.   :  0.0333   Min.   :  0.0333  
##  1st Qu.:   63.0   1st Qu.:   24.0   1st Qu.:  0.6667   1st Qu.:  0.7000  
##  Median :  180.0   Median :   66.0   Median :  1.9333   Median :  2.0000  
##  Mean   :  542.9   Mean   :  209.9   Mean   :  5.9200   Mean   :  6.0316  
##  3rd Qu.:  525.0   3rd Qu.:  198.0   3rd Qu.:  5.6667   3rd Qu.:  5.8333  
##  Max.   :41121.0   Max.   :19074.0   Max.   :435.0000   Max.   :456.9000  
##   prom_mes_uno      total_terminales  cantidad_falla_m3 cantidad_falla_m2
##  Min.   :  0.0667   Min.   :   3.00   Min.   :  0.000   Min.   :  0.000  
##  1st Qu.:  0.6250   1st Qu.:   3.00   1st Qu.:  0.000   1st Qu.:  0.000  
##  Median :  1.9000   Median :   3.00   Median :  0.000   Median :  0.000  
##  Mean   :  5.8628   Mean   :  11.54   Mean   :  2.439   Mean   :  2.562  
##  3rd Qu.:  5.5333   3rd Qu.:   9.00   3rd Qu.:  3.000   3rd Qu.:  0.000  
##  Max.   :466.2000   Max.   :9333.00   Max.   :153.000   Max.   :171.000  
##  cantidad_falla_mes1 antiguedad_creacion_terminal antiguedad_version
##  Min.   :  0.000     Min.   :   5                 Min.   :    0     
##  1st Qu.:  0.000     1st Qu.: 468                 1st Qu.:  168     
##  Median :  0.000     Median :1169                 Median :  423     
##  Mean   :  2.051     Mean   :1642                 Mean   : 2006     
##  3rd Qu.:  0.000     3rd Qu.:2315                 3rd Qu.:  699     
##  Max.   :123.000     Max.   :9416                 Max.   :43387     
##  antiguedad_compra_pos antiguedad_puesta_pos     fallo        
##  Min.   :  18          Min.   :   0.0        Min.   :0.00000  
##  1st Qu.: 656          1st Qu.:  54.0        1st Qu.:0.00000  
##  Median :1307          Median : 164.0        Median :0.00000  
##  Mean   :1345          Mean   : 164.7        Mean   :0.03934  
##  3rd Qu.:1996          3rd Qu.: 273.0        3rd Qu.:0.00000  
##  Max.   :2743          Max.   :1211.0        Max.   :1.00000
fallos_numerical_des_2 = fallos[,c(15,16,17,18,19,20,21,37)]
des_2 = round(cor(fallos_numerical_des_2), digits = 2)
corrplot(des_2, method = 'square', order = 'FPC', type = 'lower', diag = FALSE)

fallos_numerical_des_3 = fallos[,c(29,30,31,37)]
des_3 = round(cor(fallos_numerical_des_3), digits = 2)
corrplot.mixed(des_3, lower = 'shade', upper = 'pie', order = 'hclust')

fallos_numerical_des_4 = fallos[,c(32,33,34,35,37)]
des_4 = round(cor(fallos_numerical_des_4), digits = 2)
corrplot.mixed(des_4, lower = 'shade', upper = 'pie', order = 'hclust')

Prueba de independencia chi-cuadrado y validación cruzada

Para las variables cualitativas seleccinadas dentro de la hipotesis se procede a la generación de las tablas cruzadas y las pruebas de independencia mediante chi-square

Analisis Univariado Se identifica la variable de fallos en el cual la variable de respuesta esta dado por 0 y 1, en los cuales se evidencia que las transacciones fallan en un \(3,9%\) respecto al \(96,1%\) de las transacciones limpias.

sjPlot::tab_xtab(var.row = fallos$fallo , var.col = fallos$tecnologiapp, title = " Tecnologƭa soportada respecto al fallo del datƔfono ", show.row.prc = TRUE)
Tecnologƭa soportada respecto al fallo del datƔfono
fallo tecnologiapp Total
a b c d
0 147024
76.5Ā %
44963
23.4Ā %
23
0Ā %
121
0.1Ā %
192131
100Ā %
1 4085
51.9Ā %
3782
48.1Ā %
0
0Ā %
0
0Ā %
7867
100Ā %
Total 151109
75.6Ā %
48745
24.4Ā %
23
0Ā %
121
0.1Ā %
199998
100Ā %
χ2=2498.560 Ā· df=3 Ā· Cramer’s V=0.112 Ā· Fisher’s p=0.000
sjPlot::tab_xtab(var.row = fallos$fallo , var.col = fallos$modelopp, title = " Modelo asociado a una terminal respecto al fallo del datƔfono ", show.row.prc = TRUE)
Modelo asociado a una terminal respecto al fallo del datƔfono
fallo modelopp Total
a b c d e f g h i j k l m n o p q r
0 7561
3.9Ā %
23
0Ā %
23136
12Ā %
6664
3.5Ā %
105
0.1Ā %
192
0.1Ā %
48
0Ā %
8
0Ā %
8488
4.4Ā %
114014
59.3Ā %
4039
2.1Ā %
17038
8.9Ā %
1189
0.6Ā %
7451
3.9Ā %
347
0.2Ā %
121
0.1Ā %
369
0.2Ā %
1338
0.7Ā %
192131
100Ā %
1 477
6.1Ā %
0
0Ā %
484
6.2Ā %
523
6.6Ā %
2
0Ā %
18
0.2Ā %
0
0Ā %
2
0Ā %
127
1.6Ā %
3446
43.8Ā %
358
4.6Ā %
1584
20.1Ā %
59
0.7Ā %
708
9Ā %
21
0.3Ā %
0
0Ā %
30
0.4Ā %
28
0.4Ā %
7867
100Ā %
Total 8038
4Ā %
23
0Ā %
23620
11.8Ā %
7187
3.6Ā %
107
0.1Ā %
210
0.1Ā %
48
0Ā %
10
0Ā %
8615
4.3Ā %
117460
58.7Ā %
4397
2.2Ā %
18622
9.3Ā %
1248
0.6Ā %
8159
4.1Ā %
368
0.2Ā %
121
0.1Ā %
399
0.2Ā %
1366
0.7Ā %
199998
100Ā %
χ2=2750.070 Ā· df=17 Ā· Cramer’s V=0.117 Ā· Fisher’s p=0.000
sjPlot::tab_xtab(var.row = fallos$fallo , var.col = fallos$browser, title = "Browser por el que corre la aplicación de Arquitectura flexible en un datÔfono", show.row.prc = TRUE)
Browser por el que corre la aplicación de Arquitectura flexible en un datÔfono
fallo browser Total
a b c d e f g h i j k l m n
0 6
0Ā %
2
0Ā %
113
0.1Ā %
13
0Ā %
135
0.1Ā %
1856
1Ā %
44666
23.2Ā %
24769
12.9Ā %
9624
5Ā %
103960
54.1Ā %
1
0Ā %
12
0Ā %
12
0Ā %
6962
3.6Ā %
192131
100Ā %
1 0
0Ā %
0
0Ā %
2
0Ā %
0
0Ā %
5
0.1Ā %
41
0.5Ā %
1075
13.7Ā %
812
10.3Ā %
664
8.4Ā %
5081
64.6Ā %
0
0Ā %
0
0Ā %
0
0Ā %
187
2.4Ā %
7867
100Ā %
Total 6
0Ā %
2
0Ā %
115
0.1Ā %
13
0Ā %
140
0.1Ā %
1897
0.9Ā %
45741
22.9Ā %
25581
12.8Ā %
10288
5.1Ā %
109041
54.5Ā %
1
0Ā %
12
0Ā %
12
0Ā %
7149
3.6Ā %
199998
100Ā %
χ2=719.649 Ā· df=13 Ā· Cramer’s V=0.060 Ā· Fisher’s p=0.000
sjPlot::tab_xtab(var.row = fallos$fallo , var.col = fallos$nombretipoter, title = " Tipo de terminal configurada lógicamente  respecto al fallo", show.row.prc = TRUE)
Tipo de terminal configurada lógicamente respecto al fallo
fallo nombretipoter Total
a b c d e f g h i j k l m n
0 707
0.4Ā %
673
0.4Ā %
2
0Ā %
121216
63.1Ā %
2745
1.4Ā %
832
0.4Ā %
41768
21.7Ā %
96
0Ā %
22575
11.7Ā %
64
0Ā %
1337
0.7Ā %
91
0Ā %
4
0Ā %
21
0Ā %
192131
100Ā %
1 13
0.2Ā %
10
0.1Ā %
0
0Ā %
3016
38.3Ā %
78
1Ā %
15
0.2Ā %
3473
44.1Ā %
5
0.1Ā %
1219
15.5Ā %
7
0.1Ā %
31
0.4Ā %
0
0Ā %
0
0Ā %
0
0Ā %
7867
100Ā %
Total 720
0.4Ā %
683
0.3Ā %
2
0Ā %
124232
62.1Ā %
2823
1.4Ā %
847
0.4Ā %
45241
22.6Ā %
101
0.1Ā %
23794
11.9Ā %
71
0Ā %
1368
0.7Ā %
91
0Ā %
4
0Ā %
21
0Ā %
199998
100Ā %
χ2=2574.145 Ā· df=13 Ā· Cramer’s V=0.113 Ā· Fisher’s p=0.000

AnƔlisis Bivariado

 object <- table(fallos$tecnologiapp, fallos$fallo)
        mosaicplot(object, main = "Tecnologƭa soportada respecto al fallo del datƔfono", xlab = " Tecnologƭa Soportada ", ylab = " Fallo del dƔtafono ", color = TRUE)

hu1 = sjPlot::plot_xtab(fallos$modelopp, fallos$fallo, margin = "row", bar.pos = "stack", coord.flip = TRUE)
ggplotly(hu1)     

Analisis de componentes principales

colnames(fallos)
##  [1] "mcodes"                       "terminal"                    
##  [3] "estado_terminal"              "producto_red"                
##  [5] "tecnologiapp"                 "modelopp"                    
##  [7] "tecnologiaaf"                 "modeloaf"                    
##  [9] "browser"                      "nombretipoter"               
## [11] "grupo_version"                "mcc"                         
## [13] "grupo_version_ant"            "ciudadfin"                   
## [15] "trx_dia_cero"                 "trx_dia_uno"                 
## [17] "trx_dia_dos"                  "trx_dia_tres"                
## [19] "trx_dia_cuatro"               "trx_dia_cinco"               
## [21] "trx_dia_seis"                 "trx_mes_tres"                
## [23] "trx_mes_dos"                  "trx_mes_uno"                 
## [25] "prom_mes_tres"                "prom_mes_dos"                
## [27] "prom_mes_uno"                 "total_terminales"            
## [29] "cantidad_falla_m3"            "cantidad_falla_m2"           
## [31] "cantidad_falla_mes1"          "antiguedad_creacion_terminal"
## [33] "antiguedad_version"           "antiguedad_compra_pos"       
## [35] "antiguedad_puesta_pos"        "clase_falla"                 
## [37] "fallo"                        "fecha_fallo"                 
## [39] "fecha_observacion"            "fallo.name"
fallos_active = fallos[98000:102000,c(32,33,34,35,37)]
head(fallos_active)
##       antiguedad_creacion_terminal antiguedad_version antiguedad_compra_pos
## 98000                         1961                 62                  1996
## 98001                          740                735                  1014
## 98002                         1317              43382                  1014
## 98003                         1317              43382                  1014
## 98004                          222                 75                   258
## 98005                          370                 54                   650
##       antiguedad_puesta_pos fallo
## 98000                     0     1
## 98001                   273     0
## 98002                   262     0
## 98003                   262     0
## 98004                    75     0
## 98005                    54     0
res.pca = prcomp(fallos_active, scale = TRUE)

i1=fviz_eig(res.pca)
ggplotly(i1)
fviz_pca_ind(res.pca, col.ind = "cos2", gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),repel = TRUE)

fviz_pca_var(res.pca, col.var = "contrib",gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),repel = TRUE)

fallos_active_1 = fallos[150000:154000,c(29,30,31,37)]
head(fallos_active_1)
##        cantidad_falla_m3 cantidad_falla_m2 cantidad_falla_mes1 fallo
## 150000                 0                 0                   0     0
## 150001                 0                 0                   0     0
## 150002                 0                 0                   0     0
## 150003                 0                 0                   0     0
## 150004                 0                 0                   0     0
## 150005                 3                 0                   0     0
res.pca_2 = prcomp(fallos_active_1, scale = TRUE)
i2=fviz_eig(res.pca_2)
ggplotly(i2)
fviz_pca_ind(res.pca_2,
             col.ind = "cos2", 
             gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
             repel = TRUE     
             )

fviz_pca_var(res.pca_2,
             col.var = "contrib", 
             gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
             repel = TRUE  
             )

pairs(fallos[,c("trx_dia_cero","trx_dia_uno","trx_dia_dos","trx_dia_tres","trx_dia_cuatro","trx_dia_cinco","trx_dia_seis")])

fit_1 = lm(fallos$fallo~fallos$trx_dia_cero+fallos$trx_dia_uno, data=fallos)
summary(fit_1)
## 
## Call:
## lm(formula = fallos$fallo ~ fallos$trx_dia_cero + fallos$trx_dia_uno, 
##     data = fallos)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.36691 -0.03871 -0.03649 -0.03581  0.96419 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         3.581e-02  4.694e-04  76.279  < 2e-16 ***
## fallos$trx_dia_cero 1.025e-04  2.057e-05   4.985 6.19e-07 ***
## fallos$trx_dia_uno  1.261e-04  2.115e-05   5.960 2.53e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1942 on 199995 degrees of freedom
## Multiple R-squared:  0.001959,   Adjusted R-squared:  0.001949 
## F-statistic: 196.3 on 2 and 199995 DF,  p-value: < 2.2e-16
qqnorm(fallos$trx_dia_cero, pch = 1, frame = FALSE)

qqnorm(fallos$trx_dia_uno, pch = 1, frame = FALSE)

# Normalización de Variables
# Regression Logistics
# SVM