Computational Provenance & Reproducibility Record

RAISINS - R and AI Solutions for INferential Statistics · Online Statistical Analysis Platform for Agricultural Research

Computational Provenance & Reproducibility Record Exploratory Factor Analysis · 2.0.0 · DOI pending

Computational Provenance & Reproducibility Record

RAISINS · Exploratory Factor Analysis Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Exploratory Factor Analysis module. It is intended to support computational reproducibility and software transparency. Detailed statistical methodology, mathematical derivations, and user guidance are provided separately in the official module documentation.

Any issues or updates required please comment here

Go to the App from here

1 Module Metadata

Parameter Specification
Module Exploratory Factor Analysis
Module Version 2.0.0
DOI pending
Document Type Computational workflow
Statistical Engine R
R Version 4.5.2
Reproducibility Execution Environment: Posit Connect · GCR · renv-locked

2 Statistical Dependency Manifest

Package Version Repository Core Statistical Functions
stats 4.5.2 Base R cor(), eigen(), cov2cor()
psych 2.6.5 CRAN fa(), KMO(), cortest.bartlett(), fa.parallel(), VSS(), alpha(), fa.diagram()
GPArotation 2026.4-1 CRAN Gradient-projection rotation criteria used by psych::fa() for all non-varimax rotations

3 Statistical Function Registry

Analytical Role Primary Function(s)
Sampling adequacy psych::KMO()
Test of sphericity psych::cortest.bartlett()
Number of factors psych::fa.parallel(), psych::VSS() (Velicer’s MAP), stats::eigen() (Kaiser rule)
Factor extraction & rotation psych::fa(nfactors, fm, rotate)
Loadings, communality, uniqueness fit$loadings, fit$communality, fit$uniquenesses
Variance explained colSums(loadings^2) / nvar
Reliability of each factor psych::alpha(check.keys = TRUE)
Factor correlations (oblique only) fit$Phi
Model fit fit$dof, fit$rms, fit$RMSEA, fit$TLI, fit$STATISTIC, fit$PVAL, fit$BIC
Reproduced & residual matrices fit$model, fit$residual
Factor scores fit$scores (Bartlett method)

4 Default Methods & Parameters

Step Setting Notes
Input data Numeric variables matrix One row per observation, one column per variable; all analysis columns must be numeric
Standardisation scale(center = TRUE, scale = TRUE) Variables are z-standardised before the correlation matrix is formed
Missing values Complete cases only Rows containing missing values are excluded from the analysis
Correlation matrix stats::cor() (Pearson) The input to every subsequent step
Number of factors Pre-filled from psych::fa.parallel(), user-adjustable Kaiser (eigenvalue > 1), scree, parallel analysis and Velicer’s MAP are all reported for comparison
Extraction method fm = "pa" (Principal Axis) by default Also available: "ml", "minres", "wls", "gls", "minchi", "alpha"
Rotation rotate = "varimax" by default Orthogonal: "varimax", "quartimax", "equamax". Oblique: "promax", "oblimin", "simplimax", "cluster". Also "none"
SMC SMC = FALSE Avoids imaginary-eigenvalue failures on near-singular correlation matrices
Factor scores scores = "Bartlett" Exportable as CSV
Salient loading threshold abs(loading) >= 0.4 Used only for grouping variables under a factor when reporting reliability and written interpretation; it does not alter the fitted model
Display precision User-set, 1-5 decimal places (default 3) Display only; never affects computation

5 R Code for Key Analytical Steps

The code blocks below reproduce every statistical quantity reported by the RAISINS Exploratory Factor Analysis module, using the bfi dataset (25 personality self-report items, 2,800 respondents) supplied with the psych package. Only complete cases are retained, giving 2,436 respondents. No RAISINS-specific code or data is required.

5.1 Data, Standardisation and Correlation Matrix

library(psych)
library(GPArotation)

data(bfi, package = "psych")
X <- na.omit(bfi[, 1:25])        # 25 items; complete cases only

Xs <- scale(X, center = TRUE, scale = TRUE)   # z-standardise
R  <- cor(Xs)                                 # Pearson correlation matrix

5.2 Suitability of the Data

# Kaiser-Meyer-Olkin measure of sampling adequacy (overall and per variable)
kmo <- KMO(R)
kmo$MSA          # overall MSA
kmo$MSAi         # per-variable MSA

# Bartlett's test of sphericity
bart <- cortest.bartlett(R, n = nrow(Xs))
bart$chisq; bart$df; bart$p.value

5.3 Determining the Number of Factors

# Kaiser criterion: eigenvalues of the correlation matrix greater than 1
ev <- eigen(R)$values
sum(ev > 1)

# Parallel analysis (Horn, 1965)
pa <- fa.parallel(R, n.obs = nrow(Xs), fa = "both", plot = FALSE)
pa$nfact

# Very Simple Structure and Velicer's Minimum Average Partial
vss <- VSS(Xs, n = 8, rotate = "varimax", fm = "pa", plot = FALSE, SMC = FALSE)
which.min(vss$map)          # factor count minimising MAP
vss$vss.stats$cfit.1        # VSS complexity 1
vss$vss.stats$cfit.2        # VSS complexity 2

5.4 Factor Extraction and Rotation

nf  <- 5                                        # retained factors
fit <- fa(r        = Xs,
          nfactors = nf,
          fm       = "pa",                      # Principal Axis extraction
          rotate   = "varimax",                 # orthogonal rotation
          scores   = "Bartlett",
          SMC      = FALSE)

5.5 Loadings, Communalities, Uniqueness and Variance Explained

L <- as.matrix(fit$loadings)     # rotated factor loadings
fit$communality                  # h2, variance of each variable explained
fit$uniquenesses                 # u2 = 1 - h2

# Variance explained per factor, and cumulatively
prop_var <- colSums(L^2) / nrow(L)
cum_var  <- cumsum(prop_var)

5.6 Reliability of Each Factor

# Each variable is assigned to the factor carrying its largest loading,
# provided that loading is at least 0.4
dominant <- apply(abs(L), 1, function(z)
  if (max(z) >= 0.4) which.max(z) else NA_integer_)

alphas <- sapply(seq_len(nf), function(f) {
  items <- rownames(L)[which(dominant == f)]
  if (length(items) < 2) return(NA_real_)      # alpha needs >= 2 items
  psych::alpha(X[, items, drop = FALSE], check.keys = TRUE)$total$raw_alpha
})
alphas

5.7 Factor Correlations (Oblique Rotations Only)

fit_ob <- fa(r = Xs, nfactors = nf, fm = "pa",
             rotate = "oblimin", scores = "Bartlett", SMC = FALSE)

fit_ob$Phi        # factor correlation matrix; NULL under orthogonal rotation

5.8 Model Fit, Reproduced and Residual Matrices

fit$dof                 # degrees of freedom
fit$rms                 # root mean square residual (RMSR)
fit$RMSEA               # RMSEA and its confidence bounds
fit$TLI                 # Tucker-Lewis index
fit$STATISTIC; fit$PVAL # chi-square and its p-value
fit$BIC

fit$model               # reproduced (model-implied) correlation matrix
fit$residual            # observed minus reproduced

5.9 Factor Scores

scores <- fit$scores    # Bartlett factor scores, one row per observation
head(scores)

Rotation criteria other than varimax are fitted by the gradient-projection algorithms in GPArotation. These are iterative and are not guaranteed to return the factors in the same column order on repeated fits of identical data; the factors themselves, their loadings and the variance they explain are unaffected. Within a single RAISINS analysis every table, plot and written interpretation is generated from one shared fitted model, so all reported output is mutually consistent. When run-to-run stability of factor numbering is required, varimax should be used, or factors should be identified by their salient variables rather than by index.

Explore the entire Exploratory Factor Analysis module in preview mode using our demo datasets. To submit suggestions or report a workflow issue, please use the discussion section below, or visit the official RAISINS website.

6 RAISINS Native Statistical Framework

RAISINS uses R for all its statistical computations. Every package used to generate major results is listed and demonstrated with examples, so results can be reproduced independently. These results are then organized and formatted on the RAISINS website along with visualisation to make them easier to use and interpret. RAISINS also has its own custom-built statistical tools for managing workflows, validating results, and generating reports. Details of these are not fully covered here, they’re shared with outside researchers only on request, and are subject to licensing terms.

7 Package References

R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/

Revelle, W. (2025). psych: Procedures for Psychological, Psychometric, and Personality Research (R package version 2.6.5). Northwestern University, Evanston, Illinois. https://doi.org/10.32614/CRAN.package.psych

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient Projection Algorithms and Software for Arbitrary Rotation Criteria in Factor Analysis. Educational and Psychological Measurement, 65(5), 676-696. https://doi.org/10.1177/0013164404272507

Kaiser, H. F. (1974). An index of factorial simplicity. Psychometrika, 39(1), 31-36. https://doi.org/10.1007/BF02291575

Bartlett, M. S. (1951). The effect of standardization on a chi-square approximation in factor analysis. Biometrika, 38(3/4), 337-344. https://doi.org/10.2307/2332580

Horn, J. L. (1965). A rationale and test for the number of factors in factor analysis. Psychometrika, 30(2), 179-185. https://doi.org/10.1007/BF02289447

Velicer, W. F. (1976). Determining the number of components from the matrix of partial correlations. Psychometrika, 41(3), 321-327. https://doi.org/10.1007/BF02293557

Revelle, W., & Rocklin, T. (1979). Very Simple Structure: An alternative procedure for estimating the optimal number of interpretable factors. Multivariate Behavioral Research, 14(4), 403-414. https://doi.org/10.1207/s15327906mbr1404_2

Cronbach, L. J. (1951). Coefficient alpha and the internal structure of tests. Psychometrika, 16(3), 297-334. https://doi.org/10.1007/BF02310555

Allaire, J. J., Xie, Y., Dervieux, C., McPherson, J., Luraschi, J., Ushey, K., Atkins, A., Wickham, H., Cheng, J., Chang, W., & Iannone, R. (2026). rmarkdown: Dynamic Documents for R (R package version 2.31). https://github.com/rstudio/rmarkdown

Feedback & Discussion