missQ {cdmTools} | R Documentation |
Introduce random misspecifications in Q-matrix
Description
Introduces random misspecifications in a Q-matrix. Only binary Q-matrix are supported so far. Useful for simulation studies.
Usage
missQ(Q, qjk, retainJ = 0, Qid = "none", seed = NULL)
Arguments
Q |
A J items x K attributes Q-matrix ( |
qjk |
Number (or proportion, if lower than 1) of q-entries to modify in the Q-matrix. |
retainJ |
Number of items to retain (i.e., not modify) in the Q-matrix. It will retain the first |
Qid |
Assure that the generated Q-matrix is generically identifiable. It includes |
seed |
A seed for obtaining consistent results. If |
Value
missQ
returns an object of class missQ
.
miss.Q
The misspecified Q-matrix (
matrix
).Q
The input (true) Q-matrix (
matrix
).JK
Number of items measuring each attribute (
vector
).Kcor
Tetrachoric correlations among the columns (
matrix
).is.Qid
Q-matrix identifiability information (
list
).specifications
Function call specifications (
list
).
Author(s)
Pablo Nájera, Universidad Pontificia Comillas
References
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
Examples
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)
miss.Q <- missQ(Q = Q$gen.Q, qjk = .20, retainJ = 4, seed = 123)