Exploratory Factor Analysis with R Annotated Syntax and Output The following document is supplemental material to Sakaluk and Short (in press). Below is selected annotated syntax and output for conducting exploratory factor analysis in R using the psych package (Revelle, 2015) from the supplementary file “R_EFA_syntax.R”. One Factor Model One factor EFA model with confidence intervals using the following code : > singfac <- fa(dat, nfactors = 1, rotate = "none", SMC = TRUE, fm = "ml", alpha = .05, n.iter=1000) > print(singfac) Output for one factor model Factor Analysis with confidence intervals using method = fa(r = dat, nfactors = 1, n.iter = 1000, rotate = "none", SMC = TRUE, fm = "ml", alpha = 0.05) Factor Analysis using method = ml Call: fa(r = dat, nfactors = 1, n.iter = 1000, rotate = "none", SMC = TRUE, fm = "ml", alpha = 0.05) Standardized loadings (pattern matrix) based upon correlation matrix ML1 h2 u2 com y1 0.57 0.327 0.67 1 y2 0.34 0.114 0.89 1 y3 0.43 0.182 0.82 1 y4 0.41 0.172 0.83 1 y5 0.31 0.098 0.90 1 y6 0.48 0.229 0.77 1 ML1 SS loadings 1.12 Proportion Var 0.19 Mean item complexity = 1 Test of the hypothesis that 1 factor is sufficient. The degrees of freedom for the null model are 15 and the objective function was 0.47 with Chi Square of 91.9 The degrees of freedom for the model are 9 and the objective function was 0.1 The root mean square of the residuals (RMSR) is 0.07 The df corrected root mean square of the residuals is 0.09 The harmonic number of observations is 200 with the empirical chi square 28.38 with prob < 0.00082 The total number of observations was 200 with MLE Chi Square = 18.6 with prob < 0.029 Tucker Lewis Index of factoring reliability = 0.791 RMSEA index = 0.074 and the 95 % confidence intervals are BIC = -29.09 Fit based upon off diagonal values = 0.88 Measures of factor score adequacy ML1 Correlation of scores with factors 0.77 Multiple R square of scores with factors 0.59 Minimum correlation of possible factor scores 0.18 NA 0.128 Coefficients and bootstrapped confidence intervals low ML1 upper y1 0.37 0.57 0.77 y2 0.13 0.34 0.54 y3 0.24 0.43 0.61 y4 0.21 0.41 0.62 y5 0.11 0.31 0.51 y6 0.28 0.48 0.67 Factor Analysis using method = ml Two Factor Model Two factor EFA model with confidence intervals using the following code: > twofac <- fa(dat, nfactors = 2, rotate = "promax", SMC = TRUE, fm = "ml", alpha = .05, n.iter = 1000) > print(twofac) Output for two factor model Factor Analysis with confidence intervals using method = fa(r = dat, nfactors = 2, n.iter = 1000, rotate = "promax", SMC = TRUE, fm = "ml", alpha = 0.05) Factor Analysis using method = ml Call: fa(r = dat, nfactors = 2, n.iter = 1000, rotate = "promax", SMC = TRUE, fm = "ml", alpha = 0.05) Standardized loadings (pattern matrix) based upon correlation matrix ML1 ML2 h2 u2 com y1 0.52 0.15 0.37 0.63 1.2 y2 0.62 -0.20 0.31 0.69 1.2 y3 0.36 y4 -0.02 y5 -0.11 y6 0.20 0.12 0.57 0.52 0.34 0.18 0.32 0.23 0.22 0.82 0.68 0.77 0.78 SS loadings Proportion Var Cumulative Var Proportion Explained Cumulative Proportion 1.2 1.0 1.1 1.6 ML1 0.83 0.14 0.14 0.51 0.51 ML2 0.79 0.13 0.27 0.49 1.00 With factor correlations of ML1 ML2 ML1 1.00 0.47 ML2 0.47 1.00 Mean item complexity = 1.2 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 15 and the objective function was 0.47 with Chi Square of 91.9 The degrees of freedom for the model are 4 and the objective function was 0.02 The root mean square of the residuals (RMSR) is 0.02 The df corrected root mean square of the residuals is 0.05 The harmonic number of observations is 200 with the empirical chi square 3.63 with prob < 0.46 The total number of observations was 200 with MLE Chi Square = 3.12 with prob < 0.54 Tucker Lewis Index of factoring reliability = 1.043 RMSEA index = 0 and the 95 % confidence intervals are NA 0.108 BIC = -18.07 Fit based upon off diagonal values = 0.98 Measures of factor score adequacy ML1 ML2 Correlation of scores with factors 0.76 0.74 Multiple R square of scores with factors 0.57 0.55 Minimum correlation of possible factor scores 0.14 0.10 Coefficients and bootstrapped confidence intervals low ML1 upper low ML2 upper y1 -0.35 0.52 1.57 -0.68 0.15 1.23 y2 0.11 0.62 1.11 -0.69 -0.20 0.52 y3 -0.28 0.36 1.13 -0.49 0.12 0.91 y4 -0.49 -0.02 0.64 0.01 0.57 1.22 y5 -0.69 -0.11 0.65 -0.09 0.52 1.17 y6 -0.36 0.20 0.96 -0.31 0.34 1.11 Interfactor correlations and bootstrapped confidence intervals lower estimate upper ML1-ML2 0.16 0.47 0.59 Conduct a Parallel Analysis and Produce a Scree Plot The psych package also allows for parallel analysis using the fa.parallel( ) function. A parallel analysis can be conducted using the below code. > parallel <- fa.parallel(dat, fm = "ml", fa = "fa", n.iter = 50, SMC = TRUE, show.legend = TRUE) This syntax will produce a scree plot that can be used to examine the eigenvalues from the actual dataset versus a simulated or resampled dataset. However, this plot is not quite APA publication standards. R has a variety of plotting packages, and we provide an example with the ggplot2 package because this package is incredibly powerful and flexible. The example syntax is omitted, but below is the final plot.
© Copyright 2026 Paperzz