plot.CD: Plot Comparison Data for Factor Analysis

View source: R/plot.R

plot.CDR Documentation

Plot Comparison Data for Factor Analysis

Description

This function generates a Comparison Data plot to visualize the Root Mean Square Error (RMSE) of eigenvalues for various numbers of factors. This plot helps in evaluating the fit of different factor models and identifying the optimal number of factors based on RMSE values.

Usage

## S3 method for class 'CD'
plot(x, ...)

Arguments

x

An object of class CD, representing the results to be plotted.

...

Additional arguments to be passed to the plotting function.

Value

None. This function is used for side effects (plotting).

See Also

CD

Examples

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


CD.obj <- CD(response)

## CD plot
plot(CD.obj)




EFAfactors documentation built on Sept. 30, 2024, 1:06 a.m.