EFAvote: Voting Method for Number of Factors in EFA

View source: R/EFAvote.R

EFAvoteR Documentation

Voting Method for Number of Factors in EFA

Description

This function implements a voting method to determine the most appropriate number of factors in exploratory factor analysis (EFA). The function accepts a vector of votes, where each value represents the number of factors suggested by different EFA approaches. If there is a clear winner (a single number of factors with the most votes), that number is returned. In case of a tie, the function returns the first value among the tied results and outputs a message. The result is returned as an object of class vote, which can be printed and plotted.

Usage

EFAvote(votes, vis = TRUE, plot = TRUE)

Arguments

votes

A vector of integers, where each element corresponds to the number of factors suggested by an EFA method.

vis

Logical, whether to print the results of the voting. Defaults to TRUE.

plot

Logical, whether to display a pie chart of the voting results. Defaults to TRUE.

Value

An object of class EFAvote, which is a list containing:

nfact

The number of factors with the most votes. If there is a tie, the first one in the order is returned.

votes

The original vector of votes.

See Also

plot.EFAvote

Examples

library(EFAfactors)

nfacts <- c(5, 5, 5, 6, 6, 4)
names(nfacts) <- c("Hull", "CD", "PA", "EKC", "XGB", "DNN")

EFAvote.obj <- EFAvote(votes = nfacts)

# Visualize the voting results
plot(EFAvote.obj)


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