averagetable(donnee, formul, subset = NULL, method = "coeff", firstvar, lastvar = ncol(donnee), file = NULL)
donnee
)method
parameter then the function averagetable returns the matrix
of the adjusted means; if "mean" is assigned to the method
parameter
then the function averagetable returns the matrix of the means per category.
formul
parameter can be filled in for a given analysis of variance model.
The formul
parameter must begin with the categorical variable of interest (generally the product variable)
followed by the different other factors (and eventually their interactions) of interest. Classicially, one can used
formul = "~Product+Panelist+Product:Panelist"
.
In practise and in our type of applications, this function is very useful to obtain a data matrix
in which rows represent products and columns represent sensory descriptors.
If "mean" is assigned to the method
parameter, then the formul
parameter
can be restricted to the sole variable of interest (generally the product variable).
If data are balanced, the two options "mean" and "coeff" give the same results.
aov
data(chocolates)
resaverage<-averagetable(sensochoc, formul = "~Product+Panelist",
firstvar = 5)
coltable(magicsort(resaverage), level.upper = 6,level.lower = 4,
main.title = "Average by chocolate")
res.pca = PCA(resaverage, scale.unit = TRUE)
Run the code above in your browser using DataLab