Dear R Group
I was trying to use the triangle.test function in SensoMineR and strangely i
encounter a error in the output of preference matrix from the analysis.
To illustrate, pl see the following dataframe of a design with the response
and preference collected as shown below:

design<-structure(list(`Product X` = c(3, 1, 4, 2, 4, 2, 1, 3, 4, 2,
4, 2, 1, 3, 4, 2, 4, 2, 3, 1), `Product Y` = c(1, 1, 4, 4, 4,
3, 1, 1, 4, 4, 4, 3, 1, 1, 4, 4, 4, 3, 1, 1), `Product Z` = c(3,
2, 1, 2, 3, 3, 2, 3, 1, 2, 3, 3, 2, 3, 1, 2, 3, 3, 3, 2), Response =
structure(c(1L,
2L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L,
1L, 1L, 2L), .Label = c("X", "Z"), class = "factor"), Preference =
structure(c(1L,
3L, 1L, 1L, 1L, 2L, 3L, 1L, 1L, 1L, 1L, 2L, 3L, 1L, 1L, 1L, 1L,
2L, 1L, 2L), .Label = c("X", "Y", "Z"), class = "factor")), .Names =
c("Product X",
"Product Y", "Product Z", "Response", "Preference"), class = "data.frame",
row.names = c("Panelist1.Test1",
"Panelist1.Test2", "Panelist2.Test1", "Panelist2.Test2", "Panelist3.Test1",
"Panelist3.Test2", "Panelist4.Test1", "Panelist4.Test2", "Panelist5.Test1",
"Panelist5.Test2", "Panelist6.Test1", "Panelist6.Test2", "Panelist7.Test1",
"Panelist7.Test2", "Panelist8.Test1", "Panelist8.Test2", "Panelist9.Test1",
"Panelist9.Test2", "Panelist10.Test1", "Panelist10.Test2"))

If you were to investigate the above dataframe, you would find that for the
comparision of Product 2 Vs Product 3, the preference indicates product 3 is
preferred over product 2 all the time.

## Read output from the following script to see what i mean above:
subset(design,`Product X`==2&`Product Y`==3&`Product Z`==3)

##Output of above would be:
.                 Product X Product Y Product Z Response Preference
Panelist3.Test2         2         3         3        X          Y
Panelist6.Test2         2         3         3        X          Y
Panelist9.Test2         2         3         3        X          Y

However when I analyse the design with the answers and preferences using the
following script, I get the $pref output which shows that product 2 is
preferred over 3 all the time. Can somebody explain what is wrong in my
script?

answer<-as.vector(design$Response)
preference<-as.vector(design$Preference)
triangle.test (design[,1:3], answer,preference)

##$pref output from the triangle.test function shows as follows:

$pref
  1 2 3 4
1 0 0 0 0
2 4 0 3 0
3 0 0 0 0
4 0 0 0 0


Any help in helping me identify what is going wrong here would be highly
appreciated.
Regards
Vijayan Padmanabhan

	[[alternative HTML version deleted]]

