> #6.2 Wine Example > x<-rbind( + c(2,3.5,3.5,2,2), + c(1.5,4,1.5,4,4), + c(2,3.5,2,3.5,2), + c(2,3.5,3.5,2,2), + c(4,4,4,1.5,1.5), + c(2,3.5,3.5,2,2), + c(2,3.5,3.5,2,2), + c(2.5,5,2.5,2.5,2.5), + c(2,3.5,3.5,2,2), + c(1.5,4,4,4,1.5)) > colnames(x)<-c("A","B","C","D","E") > > #Have to get ranks from x*10 as xtotab assumes integer > xtotab(x*10) 1 2 3 4 5 A 3.250000 3.250000 2.583333 0.5833333 0.3333333 B 0.000000 0.000000 1.000000 4.0000000 5.0000000 C 1.083333 1.083333 1.250000 3.4166667 3.1666667 D 2.416667 2.416667 2.583333 1.4166667 1.1666667 E 3.250000 3.250000 2.583333 0.5833333 0.3333333 > U(x*10) 1 2 3 4 5 1 3.75 3.75 2.25 0.25 0 2 3.75 3.75 2.25 0.25 0 3 2.25 2.25 3.25 1.25 1 4 0.25 0.25 1.25 4.25 4 5 0.00 0.00 1.00 4.00 5 > BlockAnalysis(x*10) $Cri Location Dispersion A -1.9965487 -0.2287173 B 3.2884332 0.9863435 C 1.5267726 0.2358648 D -0.8221083 -0.7647736 E -1.9965487 -0.2287173 $partition df SS pvalue Location 4 21.793103 0.0002203478 Dispersion 4 1.718008 0.7874439687 Residual 4 2.044444 0.7275844491 Total 12 25.555556 0.0123989048 > > #Note that 4 degrees of freedom have been lost - the total degrees of freedom > #is usually (number of products - 1)^2, which is (5-1)^2=16 here > > #This is because U(x*10) is not of full rank (see the discussion at the end of chapter 3.6) > eigen(U(x*10))$values [1] 1.000000e+01 8.085927e+00 1.335151e+00 5.789217e-01 -6.802794e-16 > det(U(x*10)) [1] 0 >