---
title: "Factor Analysis"
author: "Murat Koptur"
date: "`r format(Sys.time(), '%d %B %Y')`"
output: rmarkdown::github_document
---

```{r echo=FALSE}
knitr::opts_chunk$set(fig.path='figures/factor-')
```

```{r}
library(readr)
library(knitr)
library(psych)
```

```{r results='asis'}
bfi <- read_csv("../data/bfi.csv", 
    col_types = cols(X1 = col_skip(), age = col_skip(), 
        education = col_skip(), gender = col_skip()))
kable(head(bfi))
```
```{r}
KMO(bfi)
```
```{r}
fa.parallel(bfi)
```
```{r}
bfi.fa <- fa(bfi, nfactors = 6, fm="pa", max.iter = 100)
fa.diagram(bfi.fa)
```

