The function omega coefficient, which is a measure of measurement internal consistency based on factor analysis, based on the covariance or correlation matrix. psych::fa is used to preform factor analysis.
Omega(
C,
fm = "ml",
nfactors = 1,
covar = TRUE,
usePsych = TRUE,
returnFaRes = FALSE,
rotation = "none",
...
)By default just the value of the omega coefficient. If returnFaRes is TRUE, then a list with two elements:
omega - The value of the omega coefficient.
faRes - The result of factor analysis.
Covariance or correlation matrix.
Factor analysis method, maximum likelihood ("ml") by default. See psych::fa for details. Only used if usePsych is TRUE and psych package is available.
Number of factors, 1 by default, psych::fa for details.
Should the input C be treated as covariance matrix. Defaults to TRUE. If set to FALSE, the input C is converted to correlation matrix using stats::cov2cor.
Should psych package or more precisely psych::fa be used to perform factor analysis. Defaults to TRUE. If FALSE or psych package is not available, stats::factanal is used.
Should results of factor analysis be returned in addition to the computed omega coefficient. FALSE by default.
Rotation to be used in factor analysis. Defaults to "none", as it does not influence the Omega coefficient. Used only if returnFaRes is TRUE. Included if one wants to customize the results of factor analyisis. See psych::fa or stats::factanal for details (depending on which function is used, see usePsych).
Additional parameters to psych::fa or stats::factanal (depending on which function is used, see usePsych).
Ales Ziberna
Omega(C=cor(mtcars[,1:6]),nfactors=1)
Omega(C=cor(mtcars[,1:6]),nfactors=1,returnFaRes=TRUE)
Run the code above in your browser using DataLab