empresa<-read.csv("https://raw.githubusercontent.com/VictorGuevaraP/Mineria-de-datos/master/Perdida%20de%20clientes.csv", sep = ";")
head(empresa)
## Plan_Internacional Min_En_Dia Min_Internacionales Reclamos
## 1 no 265.1 10.0 1
## 2 no 161.6 13.7 1
## 3 no 243.4 12.2 0
## 4 si 299.4 6.6 2
## 5 si 166.7 10.1 3
## 6 si 223.4 6.3 0
## Llamadas_Internacionales Desafiliado
## 1 3 no
## 2 3 no
## 3 5 no
## 4 7 no
## 5 3 no
## 6 6 no
str(empresa)
## 'data.frame': 3333 obs. of 6 variables:
## $ Plan_Internacional : Factor w/ 2 levels "no","si": 1 1 1 2 2 2 1 2 1 2 ...
## $ Min_En_Dia : num 265 162 243 299 167 ...
## $ Min_Internacionales : num 10 13.7 12.2 6.6 10.1 6.3 7.5 7.1 8.7 11.2 ...
## $ Reclamos : int 1 1 0 2 3 0 3 0 1 0 ...
## $ Llamadas_Internacionales: int 3 3 5 7 3 6 7 6 4 5 ...
## $ Desafiliado : Factor w/ 2 levels "no","si": 1 1 1 1 1 1 1 1 1 1 ...
summary(empresa)
## Plan_Internacional Min_En_Dia Min_Internacionales Reclamos
## no:3010 Min. : 0.0 Min. : 0.00 Min. :0.000
## si: 323 1st Qu.:143.7 1st Qu.: 8.50 1st Qu.:1.000
## Median :179.4 Median :10.30 Median :1.000
## Mean :179.8 Mean :10.24 Mean :1.563
## 3rd Qu.:216.4 3rd Qu.:12.10 3rd Qu.:2.000
## Max. :350.8 Max. :20.00 Max. :9.000
## Llamadas_Internacionales Desafiliado
## Min. : 0.000 no:2850
## 1st Qu.: 3.000 si: 483
## Median : 4.000
## Mean : 4.479
## 3rd Qu.: 6.000
## Max. :20.000
#Diagrama de Dispercion
plot(empresa$Min_En_Dia,empresa$Min_Internacionales ,
main="GRAFICO DE CORRELACION ENTRE 2 VARIABLES",
xlab="MINUTOS INTERNACIONAES",
ylab = "MINUTOS AL DIA",
col=c(4,7))
###Segun el diagrama no hay correlacion entre las variables Min_En_Dia y Lamadas_Internacionales
pairs(empresa$Min_En_Dia ~ empresa$Min_Internacionale)
plot(empresa)
#COEFICIENTE DE CORELACION
str(empresa)
## 'data.frame': 3333 obs. of 6 variables:
## $ Plan_Internacional : Factor w/ 2 levels "no","si": 1 1 1 2 2 2 1 2 1 2 ...
## $ Min_En_Dia : num 265 162 243 299 167 ...
## $ Min_Internacionales : num 10 13.7 12.2 6.6 10.1 6.3 7.5 7.1 8.7 11.2 ...
## $ Reclamos : int 1 1 0 2 3 0 3 0 1 0 ...
## $ Llamadas_Internacionales: int 3 3 5 7 3 6 7 6 4 5 ...
## $ Desafiliado : Factor w/ 2 levels "no","si": 1 1 1 1 1 1 1 1 1 1 ...
cor(empresa[,2:4])
## Min_En_Dia Min_Internacionales Reclamos
## Min_En_Dia 1.00000000 -0.01015459 -0.01342319
## Min_Internacionales -0.01015459 1.00000000 -0.00963968
## Reclamos -0.01342319 -0.00963968 1.00000000
cov(empresa[,2:4])
## Min_En_Dia Min_Internacionales Reclamos
## Min_En_Dia 2966.6964865 -1.54414905 -0.96178959
## Min_Internacionales -1.5441490 7.79436806 -0.03540307
## Reclamos -0.9617896 -0.03540307 1.73051669
#install.packages("VIM")
#install.packages("corrplot")
library(VIM)
## Loading required package: colorspace
## Loading required package: grid
## Loading required package: data.table
## VIM is ready to use.
## Since version 4.0.0 the GUI is in its own package VIMGUI.
##
## Please use the package to use the new (and old) GUI.
## Suggestions and bug-reports can be submitted at: https://github.com/alexkowa/VIM/issues
##
## Attaching package: 'VIM'
## The following object is masked from 'package:datasets':
##
## sleep
library(corrplot)
## corrplot 0.84 loaded
corrplot(cor(empresa[,2:4]))
library(corrplot)
data(iris)
library(PerformanceAnalytics)
## Loading required package: xts
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
## Attaching package: 'xts'
## The following objects are masked from 'package:data.table':
##
## first, last
##
## Attaching package: 'PerformanceAnalytics'
## The following object is masked from 'package:graphics':
##
## legend
chart.Correlation(empresa[,2:4])
### Se aprecia que las variables min al dia y minutos internacionales tienen una distrubucion normal y tambien que en las otras variables hay muy poca relacion entre ellas