R+script+for+commercial+product+test

> ####color > sample.A <- c(7,7,9,8,8,9,8,8,9,6,7,9,8,8,8,8,8,9,9,7,9,8,9,5) > sample.B <- c(5,5,6,2,5,5,5,2,6,3,2,4,5,6,6,3,7,7,9,4,1,2,1,6) > sample.C <- c(2,5,7,6,6,5,4,6,7,7,9,4,8,8,5,6,8,9,7,3,3,2,3,6) > > mean (sample.A) [1] 7.958333 > mean (sample.B) [1] 4.458333 > mean (sample.C) [1] 5.666667 > > > > Assessors <- factor(rep(c(1:24),times=3)) > Samples <- factor(c(rep(c("0"),times=24),rep(c("1"),times=24),rep(c("2"),times=24))) > color <- c(7,7,9,8,8,9,8,8,9,6,7,9,8,8,8,8,8,9,9,7,9,8,9,5,5,5,6,2,5,5,5,2,6,3,2,4,5,6,6,3,7,7,9,4,1,2,1,6,2,5,7,6,6,5,4,6,7,7,9,4,8,8,5,6,8,9,7,3,3,2,3,6) > > dfc <- data.frame(Samples,Assessors,color) > > library (asbio) > tukey.add.test(dfc$color,dfc$Samples,dfc$Assessors)

Tukey's one df test for additivity

data: dfc$Samples and dfc$Assessors on dfc$color F = 12.1853, num.df = 1, denom.df = 45, p-value = 0.001091

> > color <-matrix(c(7,7,9,8,8,9,8,8,9,6,7,9,8,8,8,8,8,9,9,7,9,8,9,5,5,5,6,2,5,5,5,2,6,3,2,4,5,6,6,3,7,7,9,4,1,2,1,6,2,5,7,6,6,5,4,6,7,7,9,4,8,8,5,6,8,9,7,3,3,2,3,6),nrow=24,byrow=FALSE, dimnames=list(1:24,c("A","B","C"))) > result <- friedman.test(color) > result

Friedman rank sum test

data: color Friedman chi-squared = 25, df = 2, p-value = 3.727e-06

> > ##Calculate difference between rank sums > ##and critical distance for HSDRanks > Ranktotals <- c(abs(colSums (color)1 - colSums(color)2), + abs(colSums(color)1-colSums(color)3), + abs(colSums(color)2-colSums(color)3), + qtukey(0.95,9,999)*sqrt((24*3*(3+1))/12)) > ## Add sample labels > Comparisons <- c("A-B","A-C","B-C","critical distance for HSDRanks") > ## Create table of results > HSDRank.comparisons <- data.frame(Ranktotals, row.names=Comparisons) > HSDRank.comparisons Ranktotals A-B 84.00000 A-C 55.00000 B-C 29.00000 critical distance for HSDRanks 21.53689 > > > > > ###flavour > sample.A <- c(7,9,9,8,9,9,9,9,8,7,7,9,2,2,6,9,8,9,7,8,9,8,8,6) > sample.B <- c(5,3,4,3,6,5,6,8,8,3,6,1,8,7,6,2,2,7,8,3,2,1,1,6) > sample.C <- c(2,3,7,6,7,3,4,8,7,6,8,1,9,8,6,6,8,9,7,6,1,2,4,7) > > mean (sample.A) [1] 7.583333 > mean (sample.B) [1] 4.625 > mean (sample.C) [1] 5.625 > > Assessors <- factor(rep(c(1:24),times=3)) > Samples <- factor(c(rep(c("0"),times=24),rep(c("1"),times=24),rep(c("2"),times=24))) > flavour <- c(7,9,9,8,9,9,9,9,8,7,7,9,2,2,6,9,8,9,7,8,9,8,8,6,5,3,4,3,6,5,6,8,8,3,6,1,8,7,6,2,2,7,8,3,2,1,1,6,2,3,7,6,7,3,4,8,7,6,8,1,9,8,6,6,8,9,7,6,1,2,4,7) > > dfc <- data.frame(Samples,Assessors,flavour) > > library (asbio) > tukey.add.test(dfc$flavour,dfc$Samples,dfc$Assessors)

Tukey's one df test for additivity

data: dfc$Samples and dfc$Assessors on dfc$flavour F = 12.4783, num.df = 1, denom.df = 45, p-value = 0.0009646

> > flavour <-matrix(c(7,9,9,8,9,9,9,9,8,7,7,9,2,2,6,9,8,9,7,8,9,8,8,6,5,3,4,3,6,5,6,8,8,3,6,1,8,7,6,2,2,7,8,3,2,1,1,6,2,3,7,6,7,3,4,8,7,6,8,1,9,8,6,6,8,9,7,6,1,2,4,7),nrow=24,byrow=FALSE, dimnames=list(1:24,c("A","B","C"))) > result <- friedman.test(flavour) > result

Friedman rank sum test

data: flavour Friedman chi-squared = 15.1667, df = 2, p-value = 0.0005089

> > ##Calculate difference between rank sums > ##and critical distance for HSDRanks > Ranktotals <- c(abs(colSums (flavour)1 - colSums(flavour)2), + abs(colSums(flavour)1-colSums(flavour)3), + abs(colSums(flavour)2-colSums(flavour)3), + qtukey(0.95,9,999)*sqrt((24*3*(3+1))/12)) > ## Add sample labels > Comparisons <- c("A-B","A-C","B-C","critical distance for HSDRanks") > ## Create table of results > HSDRank.comparisons <- data.frame(Ranktotals, row.names=Comparisons) > HSDRank.comparisons Ranktotals A-B 71.00000 A-C 47.00000 B-C 24.00000 critical distance for HSDRanks 21.53689 > > > ###sweetness > sample.A <- c(7,9,8,7,8,9,8,8,8,7,8,8,3,2,8,8,9,9,7,9,9,8,8,7) > sample.B <- c(5,1,3,3,4,4,6,7,7,2,6,2,8,6,6,2,5,9,8,4,3,2,1,4) > sample.C <- c(1,8,6,5,5,3,6,7,7,6,7,7,8,8,8,7,8,9,6,7,1,2,3,7) > > mean (sample.A) [1] 7.583333 > mean (sample.B) [1] 4.5 > mean (sample.C) [1] 5.916667 > > > Assessors <- factor(rep(c(1:24),times=3)) > Samples <- factor(c(rep(c("0"),times=24),rep(c("1"),times=24),rep(c("2"),times=24))) > sweetness <- c(7,9,8,7,8,9,8,8,8,7,8,8,3,2,8,8,9,9,7,9,9,8,8,7,5,1,3,3,4,4,6,7,7,2,6,2,8,6,6,2,5,9,8,4,3,2,1,4,1,8,6,5,5,3,6,7,7,6,7,7,8,8,8,7,8,9,6,7,1,2,3,7) > > dfc <- data.frame(Samples,Assessors,sweetness) > > library (asbio) > tukey.add.test(dfc$sweetness,dfc$Samples,dfc$Assessors)

Tukey's one df test for additivity

data: dfc$Samples and dfc$Assessors on dfc$sweetness F = 6.2616, num.df = 1, denom.df = 45, p-value = 0.01604

> > sweetness <-matrix(c(7,9,9,8,9,9,9,9,8,7,7,9,2,2,6,9,8,9,7,8,9,8,8,6,5,3,4,3,6,5,6,8,8,3,6,1,8,7,6,2,2,7,8,3,2,1,1,6,2,3,7,6,7,3,4,8,7,6,8,1,9,8,6,6,8,9,7,6,1,2,4,7),nrow=24,byrow=FALSE, dimnames=list(1:24,c("A","B","C"))) > result <- friedman.test(sweetness) > result

Friedman rank sum test

data: sweetness Friedman chi-squared = 15.1667, df = 2, p-value = 0.0005089

> > ##Calculate difference between rank sums > ##and critical distance for HSDRanks > Ranktotals <- c(abs(colSums (sweetness)1 - colSums(sweetness)2), + abs(colSums(sweetness)1-colSums(sweetness)3), + abs(colSums(sweetness)2-colSums(sweetness)3), + qtukey(0.95,9,999)*sqrt((24*3*(3+1))/12)) > ## Add sample labels > Comparisons <- c("A-B","A-C","B-C","critical distance for HSDRanks") > ## Create table of results > HSDRank.comparisons <- data.frame(Ranktotals, row.names=Comparisons) > HSDRank.comparisons Ranktotals A-B 71.00000 A-C 47.00000 B-C 24.00000 critical distance for HSDRanks 21.53689 > > > ###creaminess > sample.A <- c(7,8,8,8,9,9,7,8,9,8,7,7,4,6,5,9,9,9,8,9,8,8,9,9) > sample.B <- c(5,1,5,2,6,4,6,5,6,2,3,2,6,6,6,3,2,7,9,3,3,2,1,3) > sample.C <- c(2,3,7,5,7,2,6,7,7,8,8,4,8,8,7,7,8,9,6,6,1,2,2,7) > > mean (sample.A) [1] 7.833333 > mean (sample.B) [1] 4.083333 > mean (sample.C) [1] 5.708333 > > Assessors <- factor(rep(c(1:24),times=3)) > Samples <- factor(c(rep(c("0"),times=24),rep(c("1"),times=24),rep(c("2"),times=24))) > creaminess <- c(7,8,8,8,9,9,7,8,9,8,7,7,4,6,5,9,9,9,8,9,8,8,9,9,5,1,5,2,6,4,6,5,6,2,3,2,6,6,6,3,2,7,9,3,3,2,1,3,2,3,7,5,7,2,6,7,7,8,8,4,8,8,7,7,8,9,6,6,1,2,2,7) > > dfc <- data.frame(Samples,Assessors,creaminess) > > library (asbio) > tukey.add.test(dfc$creaminess,dfc$Samples,dfc$Assessors)

Tukey's one df test for additivity

data: dfc$Samples and dfc$Assessors on dfc$creaminess F = 8.238, num.df = 1, denom.df = 45, p-value = 0.00623

> creaminess <-matrix(c(7,8,8,8,9,9,7,8,9,8,7,7,4,6,5,9,9,9,8,9,8,8,9,9,5,1,5,2,6,4,6,5,6,2,3,2,6,6,6,3,2,7,9,3,3,2,1,3,2,3,7,5,7,2,6,7,7,8,8,4,8,8,7,7,8,9,6,6,1,2,2,7),nrow=24,byrow=FALSE, dimnames=list(1:24,c("A","B","C"))) > result <- friedman.test(creaminess) > result

Friedman rank sum test

data: creaminess Friedman chi-squared = 21.1209, df = 2, p-value = 2.592e-05

> > ##Calculate difference between rank sums > ##and critical distance for HSDRanks > Ranktotals <- c(abs(colSums (creaminess)1 - colSums(creaminess)2), + abs(colSums(creaminess)1-colSums(creaminess)3), + abs(colSums(creaminess)2-colSums(creaminess)3), + qtukey(0.95,9,999)*sqrt((24*3*(3+1))/12)) > ## Add sample labels > Comparisons <- c("A-B","A-C","B-C","critical distance for HSDRanks") > ## Create table of results > HSDRank.comparisons <- data.frame(Ranktotals, row.names=Comparisons) > HSDRank.comparisons Ranktotals A-B 90.00000 A-C 51.00000 B-C 39.00000 critical distance for HSDRanks 21.53689 > > > > overall A B C 1 7 5 2 2 9 3 3 3 9 4 7 4 8 3 6 5 9 6 7 6 9 5 3 7 9 6 4 8 9 8 8 9 8 8 7 10 7 3 6 11 7 6 8 12 9 1 1 13 2 8 9 14 2 7 8 15 6 6 6 16 9 2 6 17 8 2 8 18 9 7 9 19 7 8 7 20 8 3 6 21 9 2 1 22 8 1 2 23 8 1 4 24 6 6 7 > sample.A <- c(7,9,9,8,9,9,9,8,9,8,7,8,2,2,6,9,9,9,9,8,8,8,9,7) > sample.B <- c(5,2,3,2,6,5,6,7,7,3,4,2,8,7,6,3,2,7,8,3,2,2,1,5) > sample.C <- c(1,3,7,5,6,4,5,7,7,6,8,3,9,8,7,6,8,9,7,6,1,2,2,7) > > > mean (sample.A) [1] 7.75 > mean (sample.B) [1] 4.416667 > mean (sample.C) [1] 5.583333 > > > Assessors <- factor(rep(c(1:24),times=3)) > Samples <- factor(c(rep(c("0"),times=24),rep(c("1"),times=24),rep(c("2"),times=24))) > overall <- c(7,9,8,7,8,9,8,8,8,7,8,8,3,2,8,8,9,9,7,9,9,8,8,7,5,1,3,3,4,4,6,7,7,2,6,2,8,6,6,2,5,9,8,4,3,2,1,4,1,8,6,5,5,3,6,7,7,6,7,7,8,8,8,7,8,9,6,7,1,2,3,7) > > dfc <- data.frame(Samples,Assessors,overall) > > library (asbio) > tukey.add.test(dfc$overall,dfc$Samples,dfc$Assessors)

Tukey's one df test for additivity

data: dfc$Samples and dfc$Assessors on dfc$overall F = 6.2616, num.df = 1, denom.df = 45, p-value = 0.01604

> > overall <-matrix(c(7,9,9,8,9,9,9,9,8,7,7,9,2,2,6,9,8,9,7,8,9,8,8,6,5,3,4,3,6,5,6,8,8,3,6,1,8,7,6,2,2,7,8,3,2,1,1,6,2,3,7,6,7,3,4,8,7,6,8,1,9,8,6,6,8,9,7,6,1,2,4,7),nrow=24,byrow=FALSE, dimnames=list(1:24,c("A","B","C"))) > result <- friedman.test(overall) > result

Friedman rank sum test

data: overall Friedman chi-squared = 15.1667, df = 2, p-value = 0.0005089

> > ##Calculate difference between rank sums > ##and critical distance for HSDRanks > Ranktotals <- c(abs(colSums (overall)1 - colSums(overall)2), + abs(colSums(overall)1-colSums(overall)3), + abs(colSums(overall)2-colSums(overall)3), + qtukey(0.95,9,999)*sqrt((24*3*(3+1))/12)) > ## Add sample labels > Comparisons <- c("A-B","A-C","B-C","critical distance for HSDRanks") > ## Create table of results > HSDRank.comparisons <- data.frame(Ranktotals, row.names=Comparisons) > HSDRank.comparisons Ranktotals A-B 71.00000 A-C 47.00000 B-C 24.00000 critical distance for HSDRanks 21.53689 > > UNIT IV