-
Notifications
You must be signed in to change notification settings - Fork 0
/
Factor Analysis.Rmd
71 lines (55 loc) · 1.83 KB
/
Factor Analysis.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
let's import necessary packages
```{r}
library(psych)
library(dplyr)
```
let's import our dataset
```{r}
data=read.csv(file.choose(),header=TRUE)
data
```
we will check for missing values in our data
```{r}
is.null(data)
```
this will provide us the name of all the columns in the data
```{r}
names(data)
```
The KMO function in the psych package produces an overall measure of sampling adequacy and MSA for each item.
```{r}
KMO(data)
```
The overall KMO for data is 0.78, which is acceptable and this suggest that data is appropriate for factor analysis.
```{r}
cortest.bartlett(data)
```
Here the p value we get is very close to 0
In Bartlett’s Test the value obtained should be less than 0.05
So we can say that the Bartlett’s Test is statistically significant and we can proceed for Factor Analysis.
We plot a Scree plot to check how many factors to retain
```{r}
scree(data)
```
Here 3 factors have eigen value greater than 1
so based on eigen value criterion we decide to take 3 factors
```{r}
pca=pca(data,nfactors=3,rotate="varimax")
pca
```
```{r}
print(pca$loadings,cutoff=0.5,sort=TRUE)
```
We retained 3 factors
The first factor is something that is common to Dependable, Honest, Reliable, Trust-worthy, sincere & expert. It seems like a good name for this factor is “Personality”
The other two factors can be named as “Qualification” & “Looks”.
```{r}
colnames(pca$loadings)=c('Personality','Qualification','Looks')
print(pca$loadings,cutoff=0.5,sort=TRUE)
```
```{r}
fa.diagram(pca)
```
Conclusion:
Celebrity personality, qualification and looks are the three major qualities that have the greatest impact on advertising firms.
When hiring celebrities to endorse items, the advertising industry should take into consideration these three elements.