Closed bgall closed 6 years ago
Indeed, the way ltm::grm() works requires either that you work with factors or with consecutive integers starting from 1 (your first example). The reason is because internally these integers are used for indexing when calculating the likelihood of the model.
Regarding your second example, in the GRM you need to estimate a threshold parameter for each of the possible levels of each item. However, if for one level you have 0 frequency, you cannot actually estimate the threshold parameter for this level. Hence, you need to combine it with another level.
As shown in some posts on Stack Overflow, ltm::grm() does not work when values in the theoretical range of a variable are not observed. This is puzzling because I don't see why this should be true statistically. Some have suggested that the minimum value of the vectors must be 1, but this is not sufficient, as shown below:
For example (borrowing from Stack Overflow):