# Obtain SAPA items
items <- psychTools::spi[,c(11:20)]
# Draw random samples
sample1 <- items[sample(1:nrow(items), 1000),]
sample2 <- items[sample(1:nrow(items), 1000),]
if (FALSE) {
# Estimate EGAs
ega1 <- EGA(sample1)
ega2 <- EGA(sample2)
# Compare EGAs via plot
compare.EGA.plots(
ega1, ega2,
base.plot = 1, # use "ega1" as base for comparison
labels = c("Sample 1", "Sample 2"),
rows = 1, columns = 2
)}
Run the code above in your browser using DataLab