# Load candies data
data(candies)
# Basic MSCA model with a single factor
mod <- msca(assessment ~ candy, data=candies)
print(mod)
summary(mod)
# Result plotting for first factor
loadingplot(mod, scatter=TRUE, labels="names")
scoreplot(mod)
# Within scores
scoreplot(mod, factor="within")
# Within scores per factor level
par.old <- par(mfrow=c(3,2), mar=c(4,4,2,1), mgp=c(2,0.7,0))
for(i in 1:length(mod$scores.within))
scoreplot(mod, factor="within", within_level=i,
main=paste0("Level: ", names(mod$scores.within)[i]),
panel.first=abline(v=0,h=0,col="gray",lty=2))
par(par.old)
# Permutation testing
mod.perm <- asca(assessment ~ candy * assessor, data=candies, permute=TRUE)
summary(mod.perm)
Run the code above in your browser using DataLab