> #5.4 Whiskey Example > x<-matrix(c(1,3,1,3,5,1,5,2,5,3,7,1,7,1,7,2),ncol=2,byrow=T) > colnames(x)<-c("Age","Grade") > x Age Grade [1,] 1 3 [2,] 1 3 [3,] 5 1 [4,] 5 2 [5,] 5 3 [6,] 7 1 [7,] 7 1 [8,] 7 2 > > #The whiskey age ranks are inverted in this example (older whiskey is better ranked). > x[,1]<-(8-x[,1]) > > xtotab2(x) 2 4.5 7 2 2 1 0 5 1 1 1 7.5 0 0 2 > CorrelationAnalysis(x) $correlations [,1] [,2] [1,] 0.7333333 0.2666667 [2,] 0.1333333 0.2000000 $pvalues [,1] [,2] [1,] 0.03806261 0.4507008 [2,] 0.70608174 0.5716076 > 8*sum(CorrelationAnalysis(x)$correlations^2) [1] 5.333333 >