EFAscreet | R Documentation |
This function generates a scree plot to display the eigenvalues of the correlation matrix computed from the given response data. The scree plot helps in determining the number of factors to retain in exploratory factor analysis by examining the point at which the eigenvalues start to level off, indicating less variance explained by additional factors.
EFAscreet(
response,
fa = "pc",
nfact = 1,
cor.type = "pearson",
use = "pairwise.complete.obs"
)
response |
A required |
fa |
A string that determines the method used to obtain eigenvalues. If 'pc', it represents
Principal Component Analysis (PCA); if 'fa', it represents Principal Axis Factoring (a widely
used Factor Analysis method; @seealso |
nfact |
A numeric value that specifies the number of factors to extract, only effective when |
cor.type |
A character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman". @seealso cor. |
use |
An optional character string giving a method for computing covariances in the presence of missing values. This must be one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs" (default). @seealso cor. |
An object of class EFAscreet
is a list
containing the following components:
eigen.value |
A vector containing the empirical eigenvalues |
plot.EFAscreet
library(EFAfactors)
set.seed(123)
##Take the data.bfi dataset as an example.
data(data.bfi)
response <- as.matrix(data.bfi[, 1:25]) ## loading data
response <- na.omit(response) ## Remove samples with NA/missing values
## Transform the scores of reverse-scored items to normal scoring
response[, c(1, 9, 10, 11, 12, 22, 25)] <- 6 - response[, c(1, 9, 10, 11, 12, 22, 25)] + 1
## Run EFAscreet function with default parameters.
EFAscreet.obj <- EFAscreet(response)
plot(EFAscreet.obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.