knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The ItemRest package is designed to automate the process of evaluating item removal strategies in Exploratory Factor Analysis (EFA). It helps identify low-quality items (those with low factor loadings or significant cross-loadings) and assesses the impact of their removal on the model's overall fit and structure. This guide provides a step-by-step walkthrough of the package's core functionalities.
To begin the analysis, we first load the ItemRest library.
library(ItemRest)
For this demonstration, we will use the bfi (Big Five Inventory) dataset, which is available in the psych package. This dataset includes responses to 25 personality items. For a clean analysis, we will remove cases with missing data.
# Ensure the 'psych' package is available if (requireNamespace("psych", quietly = TRUE)) { data(bfi, package = "psych") # Select the personality items (first 25 columns) analysis_data <- bfi[, 1:25] # Omit rows with missing values for this example analysis_data <- na.omit(analysis_data) # View the first few rows of the prepared data head(analysis_data) }
With the data prepared, we can now run the main itemrest() function. Based on the Big Five model, we set the n_factors argument to 5.
# Run the analysis if (exists("analysis_data")) { results <- itemrest( data = analysis_data, n_factors = 5, min_loading = 0.30, loading_diff = 0.10 ) }
As itemrest() runs, it prints messages to the console, informing you about the initial EFA results, the problematic items it has identified, and the progress of testing different removal combinations.
After the analysis is complete, the results object contains all the output. We can use the print() method to display the summary tables.
By default, the print() function displays the "optimal" report. This table shows the strategies that resulted in a clean factor structure (no cross-loadings), sorted by the highest total explained variance.
if (exists("results")) { # Print the default optimal report print(results, report = "optimal") }
In the table above, a user should typically look for the row where "Cross_Loading" is "No" and the "Total_Explained_Var" is highest. This often represents the most statistically sound item removal strategy.
If you wish to see the results for every combination that was tested, you can set the report argument to "all".
if (exists("results")) { # Print the report for all tested strategies print(results, report = "all") }
This guide has demonstrated how to use the ItemRest package to automate and evaluate the item removal process in an EFA.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.