ANOVA Using Continuous CDFs I have a procedure for conducting ANOVA, the details of which can be viewed in this white paper.

I would like to be able to make the routine scalable to handle any number of groups. Below is the R code for a 2 group example.  Any insights or comments are appreciated.

Partial Moments:

LPM&lt;- function(degree,target,variable){
 sum((target - (variable[variable &lt; target]))^degree)/length(variable)
}

UPM&lt;- function(degree,target,variable){
 sum(((variable[variable &gt; target]) - target)^degree)/length(variable)
}


ANOVA:

VN_ANOVA&lt;- function(group1,group2){

  mean_of_means &lt;- mean(c(mean(group1),mean(group2)))

#Continuous CDF for each group from Mean of Means
  LPM_ratio_1 &lt;- LPM(1,mean_of_means,group1)/
    (LPM(1,mean_of_means,group1)+UPM(1,mean_of_means,group1))

  LPM_ratio_2 &lt;- LPM(1,mean_of_means,group2)/
    (LPM(1,mean_of_means,group2)+UPM(1,mean_of_means,group2))


#Continuous CDF Deviation from 0.5
  MAD_CDF&lt;- mean(c(abs(LPM_ratio_1 - 0.5),abs(LPM_ratio_2 - 0.5)))


#Certainty associated with samples
  VN_ANOVA_rho &lt;- (0.5 - MAD_CDF)/0.5


#Graphs  
  boxplot(list(group1,group2), las=2, names=c("Group 1","Group 2"), 
      xlab= "Means", horizontal = TRUE,
      col=c("grey","white"), main="ANOVA")

#For ANOVA Visualization      
  abline(v=mean_of_means,col="red",lwd=4)
  text(mean_of_means,pos=4, 2.5, "Mean of means", col = "red")


  return(c("Certainty of Same Population"=VN_ANOVA_rho))

}
Per the answer to this question, storing the variables into a matrix works.

VN_ANOVA&lt;- function(A){

  mean_of_means &lt;- mean(colMeans(A))
  n&lt;- ncol(A)

  LPM_ratio = numeric(0L)
  MAD_CDF = numeric(0L)


#Continuous CDF for each variable from Mean of Means  
  for (i in 1:n){
      LPM_ratio[i] &lt;- LPM(1,mean_of_means,A[,i])/
                 (LPM(1,mean_of_means,A[,i])+UPM(1,mean_of_means,A[,i]))

#Continuous CDF Deviation from 0.5
      MAD_CDF[i]&lt;- abs(LPM_ratio[i] - 0.5)
      }

  Mean_MAD_CDF &lt;- mean(MAD_CDF)


#Certainty associated with samples
  VN_ANOVA_rho &lt;- (0.5 - Mean_MAD_CDF)/0.5


#Graphs  
  boxplot(A, las=2, xlab= "Means", horizontal = TRUE,
       main="ANOVA", col=rainbow(n))


#For ANOVA Visualization      
  abline(v=mean_of_means,col="red",lwd=4)
  text(mean_of_means,pos=4, .25,"Mean of means", col = "red")


  return(c("Certainty of Same Population"=VN_ANOVA_rho))

}