---
title: "Untitled"
author: "Lizeth Sandoval"
date: "6/14/2021"
output: word_document
---

##Dataset Uso TIC#
```{r}
library(readxl)
BASEDATAJAM2021_baseCor2<-read_excel("Desktop/BASEDATAJAM2021-baseCor.xlsx", 
    sheet = "Utilización TIC", col_types = c("text", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric"))
View(BASEDATAJAM2021_baseCor2)
```

##Tabla de datos - Acceso TIC#
```{r}
head(BASEDATAJAM2021_baseCor2)
str(BASEDATAJAM2021_baseCor2)
```

##Resumen de las variables - Acceso TIC#
```{r}
summary(BASEDATAJAM2021_baseCor2)
```

##Correlación de las variables - Acceso TIC#
```{r}
round(cor(x =BASEDATAJAM2021_baseCor2[c(2,3,4,5)], method = "pearson"),2)
```


##Grafico de correlación - Acceso TIC#
```{r}
correlacion<-round(cor(BASEDATAJAM2021_baseCor2[c(2,3,4,5)]), 1) 
corrplot::corrplot(correlacion, method="circle", type="upper")
```

```{r}
library('psych')
pairs.panels(BASEDATAJAM2021_baseCor2, gap=0,5)
```

##Análisis de componentes principales#
```{r}
prcomp(BASEDATAJAM2021_baseCor2[c(2,3,4,5)])
```

```{r}
library('factoextra')
library('ggplot2')
PCA_UsoTIC<-prcomp(BASEDATAJAM2021_baseCor2[c(2,3,4,5)], scale = TRUE)
names(PCA_UsoTIC)
```

##Muestra de los primeros 6 elementos del vector de cargas de los 5 primeros componentes#
```{r}
head(PCA_UsoTIC$rotation)[, 1:4]
```

##Importancia de los componentes#
```{r}
summary(PCA_UsoTIC)
```

##Gráfico de PCA#
```{r}
fviz_pca_var(PCA_UsoTIC, col.var = "cos2", 
             geom.var = c("arrow", "text"),
             labelsize = 4, 
             repel = FALSE)
```


```{r}

```


