View source: R/classification.R
mdo | R Documentation |
Calculates McDonalds's Omega reliability-coefficient of the sum-score from the Spearman one-factor model using the procedure outlined in McDonald (1999).
mdo(x, fit = FALSE)
x |
A data-frame or matrix of numerical values where rows represent respondents, and columns represent items. |
fit |
Logical. Default is |
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.
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.
McDonald, R. P. (1999). Test Theory: A Unified Treatment. Routledge.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.