EFAindex: Various Indeces in EFA

View source: R/EFAindex.R

EFAindexR Documentation

Various Indeces in EFA

Description

A function performs clustering on items by calling VSS and fa. Apply the Very Simple Structure (VSS), Comparative Fit Index (CFI), MAP, and other criteria to determine the appropriate number of factors.

Usage

EFAindex(
  response,
  nfact.max = 10,
  cor.type = "cor",
  use = "pairwise.complete.obs"
)

Arguments

response

A required N × I matrix or data.frame consisting of the responses of N individuals to I items.

nfact.max

The maximum number of factors discussed by CD approach. (default = 10)

cor.type

How to find the correlations: "cor" is Pearson", "cov" is covariance, "tet" is tetrachoric, "poly" is polychoric, "mixed" uses mixed cor for a mixture of tetrachorics, polychorics, Pearsons, biserials, and polyserials, Yuleb is Yulebonett, Yuleq and YuleY are the obvious Yule coefficients as appropriate.

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.

Value

A matrix with the following components:

CFI

the Comparative Fit Index

RMSEA

Root Mean Square Error of Approximation (RMSEA) for each number of factors.

SRMR

Standardized Root Mean Square Residual.

MAP

Velicer's MAP values (lower values are better).

BIC

Bayesian Information Criterion (BIC) for each number of factors.

SABIC

Sample-size Adjusted Bayesian Information Criterion (SABIC) for each number of factors.

chisq

Chi-square statistic from the factor analysis output.

df

Degrees of freedom.

prob

Probability that the residual matrix is greater than 0.

eChiSq

Empirically found chi-square statistic.

eCRMS

Empirically found mean residual corrected for degrees of freedom.

eBIC

Empirically found BIC based on the empirically found chi-square statistic.

vss

VSS fit with complexity 1.

sqresid

Squared residual correlations.

fit

Factor fit of the complete model.

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


## Run EFAindex function with default parameters.

 EFAindex.matrix <- EFAindex(response)

 print(EFAindex.matrix)






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