How to calculate categorical omega reliability coefficient when some items only have one value? From what I understand, running omega reliability in R is quite straightforward, even for binary responses. However, I've encountered a situation when running this command:
#### Load Libraries ####
library(lavaan)
library(psych)

#### Fit Variables ####
mod.abc <- '
ABC_Variable =~ ABC_01 + ABC_02 + ABC_03 + ABC_04 + ABC_05 +
ABC_06 + ABC_07 + ABC_08 + ABC_09 + ABC_10 +
ABC_11 + ABC_12 + ABC_13 + ABC_14 + ABC_15 +
ABC_16 + ABC_17 + ABC_18 + ABC_19 + ABC_20 
'

#### Run CFA for Omega ####
fit <- cfa(mod.abc,
             data=data,
             std.lv=T,
             ordered=T,
             estimator='WLSMV')

The function spits back an error:
Error in lav_data_full(data = data, group = group, cluster = cluster,  : 
  lavaan ERROR: ordered variable(s) has/have only 1 level

Checking the variables, the problem is quite clear. The data shows that two variables only have 1's, whereas every other variable has at least a 0 or 1 value. What should be done in this situation? Should the two variables be removed (I would think not)? Is there another option in lavaan that can bypass this issue?


two variables only have 1's

Then they are not variables, they are constants.  They cannot be modeled, and creating a composite that includes them would simply shift the value to the right by a constant.  The only solutions are to leave out the constants or gather a sufficiently large sample that some unlikely 0s are observed.
