model <- mirt.model()
F1 = 1,2,3,4-10
F2 = 10-20
(F1*F2) = 1,2,3,4-10
COV = F1*F2
#Or alternatively
s <- 'F1 = 1,2,3,4-10
F2 = 10-20
(F1*F2) = 1,2,3,4-10
COV = F1*F2'
model <- mirt.model(s)
#Q-matrix specification
Q <- matrix(c(1,1,1,0,0,0,0,0,0,1,1,1), ncol=2, dimnames = list(NULL, c('Factor1', 'Factor2')))
COV <- matrix(c(FALSE, TRUE, TRUE, FALSE), 2)
model <- mirt.model(Q, COV=COV)
## constrain various items slopes and all intercepts in single group model to be equal,
# and use a log-normal prior for all the slopes
s <- 'F = 1-10
CONSTRAIN = (1-3, 5, 6, a1), (1-10, d)
PRIOR = (1-10, a1, lnorm, .2, .2)'
model <- mirt.model(s)
## constrain various items slopes and intercepts across groups for use in multipleGroup(),
# and constrain first two slopes within 'group1' to be equal
s <- 'F = 1-10
CONSTRAIN = (1-2, a1)
CONSTRAINB = (1-3, 5, 6, a1), (1-10, d)'
model <- mirt.model(s)
Run the code above in your browser using DataLab