This function returns the restriction matrix (de la Torre, 2011; Ma & de la Torre, 2020) based on two q-vectors, where the two q-vectors can only differ by one attribute.

get.Rmatrix(Q.i, Q.i.k)

Arguments

Q.i

A q-vector

Q.i.k

Another q-vector

Value

A restriction matrix

References

de la Torre, J. (2011). The Generalized DINA Model Framework. Psychometrika, 76(2), 179-199. DOI: 10.1007/s11336-011-9207-7.

Ma, W., & de la Torre, J. (2020). An empirical Q-matrix validation method for the sequential generalized DINA model. British Journal of Mathematical and Statistical Psychology, 73(1), 142-163. DOI: 10.1111/bmsp.12156.

Examples

Q.i <- c(1, 1, 0)
Q.i.k <- c(1, 1, 1)

Rmatrix <- get.Rmatrix(Q.i, Q.i.k)

print(Rmatrix)
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,]    1    0    0   -1    0    0    0    0
#> [2,]    0    1    0    0    0   -1    0    0
#> [3,]    0    0    1    0    0    0   -1    0
#> [4,]    0    0    0    0    1    0    0   -1