Generates a Q-matrix. The criteria from Chen, Liu, Xu, & Ying (2015) and Xu & Shang (2018) can be used to generate identifiable Q-matrices. Only binary Q-matrix are supported so far. Useful for simulation studies.
genQ(J, K, Kj, I = 2, min.JK = 3, max.Kcor = 1, Qid = "none", seed = NULL)genQ returns an object of class genQ.
gen.QThe generated Q-matrix (matrix).
JKNumber of items measuring each attribute (vector).
KcorTetrachoric correlations among the columns (matrix).
is.QidQ-matrix identifiability information (list).
specificationsFunction call specifications (list).
Number of items.
Number of attributes.
A vector specifying the number (or proportion, if summing up to 1) of items measuring 1, 2, 3, ..., attributes. The first element of the vector determines the number (or proportion) of items measuring 1 attribute, and so on. See Examples.
Number of identity matrices to include in the Q-matrix (up to column permutation). The default is 2.
Minimum number of items measuring each attribute. It can be overwritten by I, if I is higher than min.JK. The default is 3.
Maximum allowed tetrachoric correlation among the columns to avoid overlapping (Nájera, Sorrel, de la Torre, & Abad, 2020). The default is 1.
Assure that the generated Q-matrix is generically identifiable. It includes "none" (for no identifiability assurance), "DINA", "DINO", or "others" (for other CDMs identifiability). The default is "none".
A seed for obtaining consistent results. If NULL, no seed is used. The default is NULL.
Pablo Nájera, Universidad Pontificia Comillas
Chen, Y., Liu, J., Xu, G., & Ying, Z. (2015). Statistical analysis of Q-matrix based diagnostic classification models. Journal of the American Statistical Association, 110, 850-866. https://doi.org/10.1080/01621459.2014.934827
Nájera, P., Sorrel, M. A., de la Torre, J., & Abad, F. J. (2020). Balancing fit and parsimony to improve Q-matrix validation. British Journal of Mathematical and Statistical Psychology. https://doi.org/10.1111/bmsp.12228
Xu, G., & Shang, Z. (2018). Identifying latent structures in restricted latent class models. Journal of the American Statistical Association, 113, 1284-1295. https://doi.org/10.1080/01621459.2017.1340889
Kj <- c(15, 10, 0, 5) # 15 one-att, 10 2-atts, 0 3-atts, and 5 four-atts items
Q <- genQ(J = 30, K = 4, Kj = Kj, Qid = "others", seed = 123)
Run the code above in your browser using DataLab