generate a \(I\) * \(K\) Q-matrix randomly, which consisted of one-attribute q-vectors (0.5), two-attribute q-vectors (0.25), and three-attribute q-vectors (0.25). This function ensures that the generated Q-matrix contains at least two identity matrices as a priority.

sim.Q(K, I)

Arguments

K

The number of attributes of each item.

I

The number of items.

Value

An object of class \(matrix\).

References

Najera, P., Sorrel, M. A., de la Torre, J., & Abad, F. J. (2021). Balancing fit and parsimony to improve Q-matrix validation. Br J Math Stat Psychol, 74 Suppl 1, 110-130. DOI: 10.1111/bmsp.12228.

Author

Haijiang Qin <Haijiang133@outlook.com>

Examples

library(Qval)

set.seed(123)

Q <- sim.Q(5, 10)
print(Q)
#>         A1 A2 A3 A4 A5
#> item 1   0  0  1  0  0
#> item 2   0  0  0  0  1
#> item 3   0  1  0  0  0
#> item 4   0  0  1  0  0
#> item 5   1  0  0  0  0
#> item 6   0  0  0  1  0
#> item 7   1  0  0  0  0
#> item 8   0  1  0  0  0
#> item 9   0  0  0  0  1
#> item 10  0  0  0  1  0