Package {FAfA}


Title: Factor Analysis for All
Version: 1.4.1
Date: 2026-10-01
Description: Provides a comprehensive Shiny-based graphical user interface for conducting a wide range of factor analysis procedures. 'FAfA' (Factor Analysis for All) guides users through data uploading, assumption checking (descriptive statistics, collinearity, multivariate normality, outliers), data wrangling (variable exclusion, data splitting), exploratory factor analysis (EFA) with various rotation and extraction methods, confirmatory factor analysis (CFA), reliability analysis (e.g., Cronbach's Alpha, McDonald's Omega), and measurement invariance testing across groups. Factor retention methods include parallel analysis following Horn (1965) <doi:10.1007/BF02289447>, optimized parallel analysis following Timmerman and Lorenzo-Seva (2011) <doi:10.1037/a0023353>, permutation parallel analysis for categorical variables following Lubbe (2019) <doi:10.1037/met0000171>, the Hull method following Lorenzo-Seva et al. (2011) <doi:10.1080/00273171.2011.564527>, minimum average partial criteria following Velicer (1976) <doi:10.1007/BF02293557> and O'Connor (2000) <doi:10.3758/BF03200807>, and the empirical Kaiser criterion following Braeken and van Assen (2017) <doi:10.1037/met0000074>. Exploratory graph analysis follows Golino and Epskamp (2017) <doi:10.1371/journal.pone.0174035>, with bootstrap stability assessment following Christensen and Golino (2021) <doi:10.3390/psych3030032>. Internal split-sample EFA replication follows Osborne and Fitzpatrick (2012) <doi:10.7275/h0bd-4d11>. Model-specific dynamic fit index cutoffs for CFA follow McNeish and Wolf (2023) <doi:10.1037/met0000425>. Item weighting follows Kılıç (2026) <doi:10.3758/s13428-026-03095-w>. Analyses use established R packages such as 'lavaan' and 'psych'. Results are presented in tables and plots with downloadable outputs. Analysis projects can be saved and restored, and reproducible R, HTML, and PDF workflow reports can be generated.
License: AGPL-3
Copyright: See file inst/COPYRIGHTS.
Depends: R (≥ 4.1.0)
URL: https://github.com/AFarukKILIC/FAfA
BugReports: https://github.com/AFarukKILIC/FAfA/issues
Imports: Amelia, EFA.MRFA, EGAnet (≥ 2.4.1), ItemRest, bsicons, bslib, ggplot2, golem, grDevices, graphics, haven, lavaan, mice, missForest, mvnormalTest, naniar, psych, qgraph, readxl, semPlot, shiny, shinycssloaders, stats, tools, utils
Suggests: flextable, officer, shinytest2, spelling, testthat (≥ 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Config/roxygen2/version: 8.1.0
NeedsCompilation: no
Packaged: 2026-10-01 12:42:24 UTC; Faruk
Author: Abdullah Faruk KILIC [aut, cre, cph], Ahmet Caliskan [aut, cph], Melissa G. Wolf [ctb, cph] (Dynamic Fit Index methodology and upstream implementation), Daniel McNeish [ctb, cph] (Dynamic Fit Index methodology and upstream implementation), Brian P. O'Connor [ctb, cph] (MAP and Empirical Kaiser Criterion upstream implementation)
Maintainer: Abdullah Faruk KILIC <afarukkilic@trakya.edu.tr>
Repository: CRAN
Date/Publication: 2026-10-01 15:41:09 UTC

About Server Module

Description

About Server Module

Usage

about_server(id)

Arguments

id

Module namespace ID.


Assumptions Server Logic

Description

Assumptions Server Logic

Usage

assumptions_server(id, data, error_recorder = NULL, language = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive).

error_recorder

Optional function used for anonymous diagnostics.

language

Optional reactive interface language.


Confirmatory Factor Analysis (CFA) Server Module

Description

Confirmatory Factor Analysis (CFA) Server Module

Usage

cfa_server(
  id,
  data,
  factor_dictionary = NULL,
  error_recorder = NULL,
  language = NULL
)

Arguments

id

Module namespace ID.

data

Reactive containing the input dataset.

factor_dictionary

Shared reactive value containing factor-to-item mappings.

error_recorder

Optional function used for anonymous diagnostics.

language

Optional reactive interface language.

Details

The Dynamic Fit Index workflow called by this module is adapted from version 1.1.0 of the dynamic R package under the GNU Affero General Public License, version 3 (AGPL-3). The integration was rewritten for FAfA's existing lavaan analysis flow rather than copied verbatim.

References

McNeish, D., & Wolf, M. G. (2023). Dynamic fit index cutoffs for confirmatory factor analysis models. Psychological Methods, 28(1), 61-88. doi:10.1037/met0000425


Confirmatory Factor Analysis (CFA) UI Module

Description

Confirmatory Factor Analysis (CFA) UI Module

Usage

cfa_ui(id)

Arguments

id

Module namespace ID.


Data Selection Server Logic

Description

Data Selection Server Logic

Usage

data_selection_server(id, data, language = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive).

language

Reactive or character interface language ("en" or "tr").


Conduct Internal Replication Analysis in EFA

Description

Randomly splits a data set into two halves, fits the same exploratory factor model in each half, aligns factor labels and signs, and compares item-level structure and loading magnitudes.

Usage

efa_replication_analysis(
  data,
  nfactors = 1L,
  rotate = "oblimin",
  fm = "minres",
  cor = "poly",
  seed = 2026L,
  volatility_cutoff = 0.04
)

Arguments

data

A data frame containing numeric analysis variables.

nfactors

Fixed number of factors extracted in both samples.

rotate

Rotation method passed to psych::fa().

fm

Extraction method passed to psych::fa().

cor

Correlation type: "cor" or "poly".

seed

Non-negative integer used for the random split.

volatility_cutoff

Squared loading-difference threshold. Osborne and Fitzpatrick (2012) suggest .04, corresponding to an absolute loading difference of .20.

Value

A list containing both fitted models, aligned loading comparisons, factor alignment information, and replication decisions.

References

Osborne, J. W., & Fitzpatrick, D. C. (2012). Replication analysis in exploratory factor analysis: What it is and why it makes your analysis better. Practical Assessment, Research, and Evaluation, 17, Article 15. doi:10.7275/h0bd-4d11


EFA Replication Analysis Server Module

Description

Runs the internal split-sample replication procedure described by Osborne and Fitzpatrick (2012) and reports item-level structural and loading-magnitude comparisons.

Usage

efa_replication_server(id, data, error_recorder = NULL, language = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive).

error_recorder

Optional function used for anonymous diagnostics.

language

Optional reactive interface language.

References

Osborne, J. W., & Fitzpatrick, D. C. (2012). Replication analysis in exploratory factor analysis: What it is and why it makes your analysis better. Practical Assessment, Research, and Evaluation, 17, Article 15. doi:10.7275/h0bd-4d11


EFA Analysis Server Module

Description

EFA Analysis Server Module

Usage

efa_server_analysis(id, data, error_recorder = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive).

error_recorder

Optional function used for anonymous diagnostics.


EFA Factor Retention Server Module

Description

EFA Factor Retention Server Module

Usage

efa_server_fac_ret(id, data, error_recorder = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive).

error_recorder

Optional function used for anonymous diagnostics.


EFA Reporting Server Module

Description

EFA Reporting Server Module

Usage

efa_server_report(
  id,
  data,
  efa_output_reactive,
  efa_settings_reactive,
  language = NULL
)

Arguments

id

Module namespace ID.

data

Input data (reactive).

efa_output_reactive

Reactive containing the EFA results.

efa_settings_reactive

Reactive containing the EFA settings.

language

Optional reactive interface language.


Measurement Invariance Server Module

Description

Measurement Invariance Server Module

Usage

inv_server(id, data, error_recorder = NULL, language = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive)

error_recorder

Optional function used for anonymous diagnostics.

language

Optional reactive interface language.


Item Weighting Server Module

Description

Item Weighting Server Module

Usage

item_weighting_server(id, data, error_recorder = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive)

error_recorder

Optional function used for anonymous diagnostics.


ItemRest Analysis Server Module

Description

ItemRest Analysis Server Module

Usage

mod_itemrest_server(id, data, error_recorder = NULL, language = NULL)

Arguments

id

Module namespace ID.

data

Reactive containing the input dataset.

error_recorder

Optional function used for anonymous diagnostics.

language

Optional reactive interface language.


ItemRest Analysis UI Module

Description

ItemRest Analysis UI Module

Usage

mod_itemrest_ui(id)

Arguments

id

Module namespace ID.


Missing Value Handling Server Module

Description

Missing Value Handling Server Module

Usage

mod_missing_server(
  id,
  data,
  project_state = NULL,
  restore_state = NULL,
  error_recorder = NULL,
  language = NULL
)

Arguments

id

Module namespace ID.

data

Reactive containing the input dataset.

project_state

Optional shared project-state object.

restore_state

Optional reactive used while loading a project.

error_recorder

Optional function used for anonymous diagnostics.

language

Optional reactive interface language.

Value

Reactive containing the processed (imputed) dataset.


Missing Value Handling UI Module

Description

Missing Value Handling UI Module

Usage

mod_missing_ui(id)

Arguments

id

Module namespace ID.


Default Value Operator

Description

Helper for default NULL values (coalesce)

Usage

x %||% y

Arguments

x

Left hand side

y

Right hand side


Reliability Analysis Server Module

Description

Reliability Analysis Server Module

Usage

reliability_server(id, data, factor_dictionary = NULL, error_recorder = NULL)

Arguments

id

Module namespace ID.

data

Input data (reactive)

factor_dictionary

Shared reactive value containing factor-to-item mappings.

error_recorder

Optional function used for anonymous diagnostics.


Run the Shiny Application

Description

This function launches the Shiny application. It uses default options for shinyApp and golem.

Usage

run_app()

Wrangling Server Modules

Description

Wrangling Server Modules

Usage

wrangling_server_ex_var(
  id,
  data,
  project_state = NULL,
  restore_state = NULL,
  error_recorder = NULL
)

Arguments

id

Module namespace ID.

data

Input data (reactive)

project_state

Optional shared project-state object.

restore_state

Optional reactive used while loading a project.

error_recorder

Optional function used for anonymous diagnostics.


Write an APA 7 Word report

Description

Write an APA 7 Word report

Usage

write_apa7_report(file, title, sections, subtitle = NULL, language = "en")

Arguments

file

Output .docx path.

title

Report title.

sections

List of report sections. Each section may contain title, text, table, and note fields.

subtitle

Optional subtitle.

language

Interface language ("en" or "tr").

Value

The output path, invisibly.