Let us assume we have \(J=5\) items in a test measuring \(K=2\) attributes and the Q-matrix is given below:
Q <- matrix(c(1, 0, 1, 0, 0, 1, 0, 1, 1, 1), ncol = 2, byrow = TRUE)
Also assume that we have item responses from \(N=10\) students:
y <- matrix(c(1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1), ncol = 5, byrow = TRUE)