if (FALSE) {
### (These examples take a lot of time, so they are not run
### during testing.)
### This will prompt the user to select an SPSS file
scaleStructure();
### Load data from simulated dataset testRetestSimData (which
### satisfies essential tau-equivalence).
data(testRetestSimData);
### Select some items in the first measurement
exampleData <- testRetestSimData[2:6];
### Use all items (don't order confidence intervals to save time
### during automated testing of the example)
ufs::scaleStructure(dat=exampleData, ci=FALSE);
### Use a selection of three variables (without confidence
### intervals to save time
ufs::scaleStructure(
dat=exampleData,
items=c('t0_item2', 't0_item3', 't0_item4'),
ci=FALSE
);
### Make the items resemble an ordered categorical (ordinal) scale
ordinalExampleData <- data.frame(apply(exampleData, 2, cut,
breaks=5, ordered_result=TRUE,
labels=as.character(1:5)));
### Now we also get estimates assuming the ordinal measurement level
ufs::scaleStructure(ordinalExampleData, ci=FALSE);
}
Run the code above in your browser using DataLab