View source: R/itemrest_core.R
| itemrest | R Documentation |
This function automates the process of identifying low-quality items (those with low factor loadings or significant cross-loadings) in an Exploratory Factor Analysis (EFA). It systematically tests various combinations of removing these problematic items and evaluates the impact on model fit, returning a comprehensive summary of all tested strategies.
itemrest(
data,
cor_method = "pearson",
n_factors = NULL,
extract = "uls",
rotate = "oblimin",
min_loading = 0.3,
loading_diff = 0.1
)
data |
A numeric |
cor_method |
The correlation method to use, e.g., |
n_factors |
The number of factors. If |
extract |
The factor extraction (estimation) method. See |
rotate |
The rotation method. See |
min_loading |
Minimum factor loading threshold. Default is 0.30. |
loading_diff |
Threshold for cross-loading identification. Default is 0.10. Can be "howard". |
An object of class itemrest_result. This is a list containing the
following components:
descriptive_stats |
Basic descriptive statistics of the input data. |
initial_efa |
The results of the initial EFA before any items are removed. |
problem_items |
A list of items identified as low-loading or cross-loading. |
removal_summary |
A data.frame summarizing the results of all tested removal strategies. |
optimal_strategy |
The best-performing strategy that resulted in a clean factor structure (no cross-loadings). |
settings |
A list of the settings used for the analysis. |
# We will use the 'bfi' dataset from the 'psych' package.
# This requires the 'psych' package to be installed.
if (requireNamespace("psych", quietly = TRUE)) {
data(bfi, package = "psych")
# 1. Prepare the data: Select the personality items (first 25 columns)
# and remove rows with missing values for this example.
example_data <- bfi[, 1:25]
example_data <- na.omit(example_data)
# 2. Run the item removal analysis.
# Based on theory, the Big Five model has 5 factors.
results <- itemrest(
data = example_data,
n_factors = 5,
cor_method = "pearson" # Data is not ordinal, so pearson is appropriate
)
# 3. Print the report for optimal strategies (default).
print(results)
# 4. Print the report for all tested strategies.
print(results, report = "all")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.