# NOT RUN {
#############################################################################
# EXAMPLE 1: Create dataset with group-specific item responses
#############################################################################
data(data.mg, package="CDM")
dat <- data.mg
#-- create dataset with group-specific item responses
dat0 <- CDM::item_by_group( dat=dat[,paste0("I",1:5)], group=dat$group )
#-- summary statistics
summary(dat0)
colnames(dat0)
#-- set some items to invariant
invariant_items <- c("I1","I4")
dat1 <- CDM::item_by_group( dat=dat[,paste0("I",1:5)], group=dat$group,
invariant=invariant_items)
colnames(dat1)
# }
Run the code above in your browser using DataLab