library(tidyverse)
corr_matrix<- cor(personality20)
which(corr_matrix == max(corr_matrix[upper.tri(corr_matrix)], na.rm = TRUE), arr.ind = TRUE)
row col
Item18 18 9
Item9 9 18
which(corr_matrix == min(corr_matrix[upper.tri(corr_matrix)], na.rm = TRUE), arr.ind = TRUE)
row col
Item19 19 9
Item9 9 19
The strongest corr is items 9 and 18
library(psych)
Attaching package: ‘psych’
The following objects are masked from ‘package:ggplot2’:
%+%, alpha
KMO(personality20)
Kaiser-Meyer-Olkin factor adequacy
Call: KMO(r = personality20)
Overall MSA = 0.8
MSA for each item =
Item1 Item2 Item3 Item4 Item5 Item6 Item7 Item8 Item9 Item10 Item11 Item12 Item13
0.82 0.80 0.81 0.78 0.77 0.81 0.85 0.72 0.79 0.81 0.81 0.81 0.78
Item14 Item15 Item16 Item17 Item18 Item19 Item20
0.79 0.80 0.86 0.82 0.83 0.77 0.82
Kaiser-Meyer-Olkin (KMO) measure of sampling adequacy is 0.8, indicating that the correlation matrix is suitable for factor analysis. [1] 80; [2] the correlation matrix is suitable for factor analysis”.
parallel<- fa.parallel(personality20, fa = "fa", n.iter = 1000)
Parallel analysis suggests that the number of factors = 5 and the number of components = NA
Five factors should be extracted This is because Parallel analysis is used to determine the number of factors to extract from a dataset
Catells Scree test The plot is a graphical representation of the eigenvalues of the factors extracted from the correlation matrix. It helps to determine the number of factors to retain based on the point in the plot where the slope of the line changes from steep to shallow. The solid horizontal line at ‘1’ in the scree plot represents the point where eigenvalues equal 1, which is often used as a cutoff point to decide the number of factors to extract based on Cattell’s scree test.
# assuming "personality" is the name of your data frame
df <- fa(personality20 , nfactors = 5)
Loading required namespace: GPArotation
Failed with error: ‘there is no package called ‘GPArotation’’
Warning: I am sorry, to do these rotations requires the GPArotation package to be installed
print.psych(df, sort = TRUE)
Factor Analysis using method = minres
Call: fa(r = personality20, nfactors = 5)
Standardized loadings (pattern matrix) based upon correlation matrix
MR1 MR2 MR3 MR4 MR5
SS loadings 3.57 2.51 1.74 1.26 1.18
Proportion Var 0.18 0.13 0.09 0.06 0.06
Cumulative Var 0.18 0.30 0.39 0.45 0.51
Proportion Explained 0.35 0.24 0.17 0.12 0.12
Cumulative Proportion 0.35 0.59 0.76 0.88 1.00
Mean item complexity = 2.9
Test of the hypothesis that 5 factors are sufficient.
df null model = 190 with the objective function = 6.92 with Chi Square = 6209.71
df of the model are 100 and the objective function was 0.33
The root mean square of the residuals (RMSR) is 0.02
The df corrected root mean square of the residuals is 0.03
The harmonic n.obs is 906 with the empirical chi square 151.22 with prob < 0.00072
The total n.obs was 906 with Likelihood Chi Square = 293.32 with prob < 7e-21
Tucker Lewis Index of factoring reliability = 0.939
RMSEA index = 0.046 and the 90 % confidence intervals are 0.04 0.052
BIC = -387.58
Fit based upon off diagonal values = 0.99
Measures of factor score adequacy
MR1 MR2 MR3 MR4 MR5
Correlation of (regression) scores with factors 0.95 0.93 0.89 0.86 0.85
Multiple R square of scores with factors 0.89 0.86 0.80 0.74 0.72
Minimum correlation of possible factor scores 0.79 0.71 0.59 0.49 0.45
Item 20, Item 11, Item 17, and Item 1.
Neuroticism
There are both positive and negative correlations among the items The extracted factors measure the number of constructs they are expected to measure The extracted factors map onto the types of constructs they are expected to measure
.83 raw, and .82 standardized.