mdo: Calculate McDonald's Omega reliability-coefficient from...

View source: R/classification.R

mdoR Documentation

Calculate McDonald's Omega reliability-coefficient from supplied variables.

Description

Calculates McDonalds's Omega reliability-coefficient of the sum-score from the Spearman one-factor model using the procedure outlined in McDonald (1999).

Usage

mdo(x, fit = FALSE)

Arguments

x

A data-frame or matrix of numerical values where rows represent respondents, and columns represent items.

fit

Logical. Default is FALSE. If TRUE, the output changes from a vector containing the Omega reliability-estimate to a list containing additional detailed information concerning the fitted factor model.

Value

If fit = FALSE, A vector of length 1 containing the estimated McDonalds's Omega reliability-coefficient for the sum-score of the supplied variables. If fit = TRUE, a list containing the Omega-coefficient reliability-estimate as the first entry, followed by the goodness-of-fit index (GFI), a two-row matrix containing the estimated factor-loadings and error-variances, and the observed and fitted covariance-matrices and the discrepancy matrix.

Note

Missing values are treated by passing na.rm = TRUE to the var function call and use = "pairwise.complete.obs" to the cov function call.

The function terminates with an error if there are negative covariance-matrix entries.

References

McDonald, R. P. (1999). Test Theory: A Unified Treatment. Routledge.

Examples

# Generate some fictional data.
set.seed(1234)
rawdata <- matrix(rnorm(500), ncol = 5)
common <- rnorm(100)
rawdata <- apply(rawdata, 2, function(x) {x + common})

# To estimate McDonald's Omega from this data:
mdo(rawdata)

# To retrieve additional information such as the GFI fit-index and model-
# parameter estimates:
mdo(rawdata, fit = TRUE)

betafunctions documentation built on May 29, 2024, 1:13 a.m.