### Load dataset `bfi`, originally from psychTools package
data(bfi, package= 'ufs');
### Specify scales
bfiScales <-
list(Agreeableness = paste0("Agreeableness_item_", 1:5),
Conscientiousness = paste0("Conscientiousness_item_", 1:5),
Extraversion = paste0("Extraversion_item_", 1:5),
Neuroticism = paste0("Neuroticism_item_", 1:5),
Openness = paste0("Openness_item_", 1:5));
names(bfi) <- c(unlist(bfiScales),
c('gender', 'education', 'age'));
### Only select first two and the first three items to
### keep it quick; just pass the full 'bfiScales'
### object to run for all five the full scales
# \donttest{
CIM(bfi,
scales=lapply(bfiScales, head, 3)[1:2],
n.iter=10);
# }
Run the code above in your browser using DataLab