MSF. Ademir Pérez
Importar la base de datos:
library(readxl)
datos <- read_excel("E:/Presentaciones Metodos/datos.xlsx")
##Quitar la columna de Nacionalidad
datos2<-datos[,-1]
head(datos2)
## # A tibble: 6 x 4
## `Nº Noches` `Nº visitas anteriores` `Gasto noche/persona` Edad
## <dbl> <dbl> <dbl> <dbl>
## 1 14 0 76.6 42
## 2 7 0 35.7 33
## 3 7 1 46.2 35
## 4 14 2 37.6 39
## 5 7 0 85.9 31
## 6 7 0 41.8 24.5
Nº Noches | Nº visitas anteriores | Gasto noche/persona | Edad | |
Nº Noches | 1 | 0.702 | -0.259 | 0.509 |
Nº visitas anteriores | 0.702 | 1 | -0.043 | 0.887 |
Gasto noche/persona | -0.259 | -0.043 | 1 | 0.209 |
Edad | 0.509 | 0.887 | 0.209 | 1 |
Gráficos:
library(corrplot)
library(grDevices)
corrplot(Mat_R$r,p.mat = Mat_R$r,type="lower",order="hclust",tl.col="black",tl.srt = 45,pch.col = "red",insig = "p-value", sig.level = -1,col = terrain.colors(100))
Prueba de Barlet
## $chisq
## [1] 32.26849
##
## $p.value
## [1] 0.00001449318
##
## $df
## [1] 6
KMO
## [1] 0.53075
## Importance of components:
## Comp.1 Comp.2 Comp.3 Comp.4
## Standard deviation 27.08825 17.30862 5.56783 3.0090959
## Proportion of Variance 0.68359 0.27910 0.02888 0.0084354
## Cumulative Proportion 0.68359 0.96268 0.99156 1.0000000