in the IRT software ConQuest you can use the command "score" to model multiple dimensions/latent variables using the same manifest variable/raw data, but different coding. For example:
score (1,2,3) (0,1,2) (0,1,0) ! items(1-3);
"recodes" the original scores from 1 to 3 in 0, 1, and 2 for the first dimension and to 0, 1, 0 for the second dimension (latent variable).
Do you know any way how to implement the same in the R package TAM (using the lavaan syntax or otherwise)? I am trying to run a PCM analysis.
Great thanks in advance!
KH
I didn't get an answer here, but I contacted Alexander Robitzsch, the author of the TAM package, and here's what he send me (published with his permission):
data(data.gpcm)
psych::describe(data.gpcm)
resp <- data.gpcm
# define three dimensions and different loadings
# of item categories on these dimensions
I <- 3 # 3 items
D <- 3 # 3 dimensions
# define loading matrix B
# 4 categories for each item (0,1,2,3)
B <- array( 0 , dim=c(I,4,D) )
for (ii in 1:I){
B[ ii , 1:4 , 1 ] <- 0:3
B[ ii , 1 ,2 ] <- 1
B[ ii , 4 ,3 ] <- 1
}
dimnames(B)[[1]] <- colnames(resp)
B[1,,]
## > B[1,,]
## [,1] [,2] [,3]
## [1,] 0 1 0
## [2,] 1 0 0
## [3,] 2 0 0
## [4,] 3 0 1
# test run
mod1 <- tam.mml( resp , B = B , control=list( snodes=1000 , maxiter=5) )
summary(mod1)
I had to edit the code for my needs, of course, but something in particular might be of interest for all of you: For some reason, the B matrix only worked if I had also defined a 0 category, although my ratings/data only included values from 1 to 5:
B <- array( 0 , dim=c(9,6,5) ) # 9 items, 5 response cat. + 1, 5 latent dimensions
for (ii in 1:I){
B[ ii , 1:6 , 1 ] <- 0:5
B[ ii , 2 ,2 ] <- 1
B[ ii , 2 ,3 ] <- 1
B[ ii , 6 ,3 ] <- 1
B[ ii , 6 ,4 ] <- 1
B[ ii , 4 ,5 ] <- 1
}
dimnames(B)[[1]] <- colnames(X)
B[1,,]
Cheers, KH