anovabinom <- function(nj,pj,alpha=0.05) { a <- length(nj) mYj <- pj/nj # prumery ve skupinach mY <- sum(pj)/sum(nj) # celkovy prumer Q <- 1/(mY*(1-mY))*sum(nj*(mYj-mY)^2) kvantil <- qchisq(1-alpha,a-1) if (QMR detect <- detect*upper.tri(detect) anovabinom <- which(detect==1,arr.ind=T) n <- dim(anovabinom)[1] for (k in 1:n) { cat(c("different groups: ",as.character(anovabinom[k,]),"\n")) } } return(anovabinom) }