# NOT RUN {
# }
# NOT RUN {
#--- 3 items from depression, anxiety, and stress scales
# for 250 cases out of possible 1000
data(dass)
inData <- dass[1:250,c("d1", "d2", "d3", "a1","a2","a3","s1","s2","s3")]
inTraitAdj <- matrix(1, nrow=1, ncol=1)
inItemTraitAdj <- matrix(1, nrow=9, ncol=1)
#--- nominal response model
n1 <- ple.lma(inData, model.type="nominal",inItemTraitAdj,inTraitAdj,tol=1e-03)
anchor <- c(1,0,0,0,0,0,0,0,0)
reScaleItem(model.fit=n1, anchor)
#--- Multidimensional models
inTraitAdj <- matrix(1, nrow=3, ncol=3)
dpress <- matrix(c(1,0,0), nrow=3, ncol=3, byrow=TRUE)
anxiety <- matrix(c(0,1,0), nrow=3, ncol=3, byrow=TRUE)
stress <- matrix(c(0,0,1), nrow=3, ncol=3, byrow=TRUE)
das <- list(dpress, anxiety, stress)
inItemTraitAdj <- rbind(das[[1]], das[[2]], das[[3]])
n3 <- ple.lma(inData, model.type="nominal", inItemTraitAdj, inTraitAdj, tol=1e-03)
anchor <- c(1,0,0, 0,1,0, 1,0,0)
reScaleItem(model.fit=n3, anchor)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab