I finally added support for categorical omega to BifactorIndicesCalculator, and was testing it against semTools::reliability() and noticed that the results from semTools didn't make sense (they were unrealistically low). I figured out the problem:
lines 1185-1186 of Reliability.R read:
result <- lapply(ordnames,
function(nn) thresholds[grepl(nn, names(thresholds))])
When indicators have names like x1, x2, x3, ..., x10, x11, .... then the grepl give too many TRUE results. For example, when nn = x1, it will also catch thresholds for x10, x11, x12, etc.
The fix is simple:
result <- lapply(ordnames,
function(nn) thresholds[grepl(paste0(nn, "\\|"), names(thresholds))])
I finally added support for categorical omega to BifactorIndicesCalculator, and was testing it against semTools::reliability() and noticed that the results from semTools didn't make sense (they were unrealistically low). I figured out the problem:
lines 1185-1186 of Reliability.R read: result <- lapply(ordnames, function(nn) thresholds[grepl(nn, names(thresholds))])
When indicators have names like x1, x2, x3, ..., x10, x11, .... then the grepl give too many TRUE results. For example, when nn = x1, it will also catch thresholds for x10, x11, x12, etc.
The fix is simple: result <- lapply(ordnames, function(nn) thresholds[grepl(paste0(nn, "\\|"), names(thresholds))])
There is a similar issue with lines 1208-1209