cronbachmax <- function(dataset){ # get the number of questions Q = length(dataset) # get the number of categories categs <- c() for(q in 1:Q){ categs[q] <- max(dataset[,q]) + 1 } # get the priors for each category priors <- list() for(q in 1:Q){ priors[[q]] <- table(dataset[,q])/length(dataset[,q]) } # set up counters: rhoxymax <- matrix(NA,Q,Q) # work with pairwise correlations for(ql in 1:Q){ for(qr in ql:Q){ # check for non-repetition of correlations if(ql