averagetable: Computes a (products,descriptors) matrix

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Returns the (products,descriptors) matrix with entries the means over panelists and sessions.
Computes analyses of variance automatically for a given model and a set of quantitative variables. Returns a data matrix where each row is associated with each category of a given categorical variable (in most cases, the categorical variable is the product variable), each column is associated with a quantitative variable, and each cell is the corresponding adjusted mean or mean.
Computes the average data table with respect to a categorical variable and a set of quantitative variables.

Usage

1
2
averagetable(donnee, formul, subset = NULL, method = "coeff", 
    firstvar, lastvar = ncol(donnee), file = NULL)

Arguments

donnee

a data frame made up of at least two qualitative variables (product, panelist) and a set of quantitative variables (sensory descriptors)

formul

the model with respect to which the factor levels of the categorical variable of interest are calculated

subset

an optional vector specifying a subset of observations to be used in the fitting process

method

two possibilities, "coeff" (by default) or "mean"

firstvar

the position of the first endogenous variable

lastvar

the position of the last endogenous variable (by default the last column of donnee)

file

the name of the output file (by default, NULL and results are not in a file)

Details

The 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.

Value

Return a matrix of dimension (p,q), where p is the number of categories of the qualitative variable of interest (in most cases, p is the number of products) and q is the number of (sensory) descriptors. If "coeff" is assigned to the 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.

Author(s)

Francois Husson [email protected]

References

P. Lea, T. Naes, M. Rodbotten. Analysis of variance for sensory data.
H. Sahai, M. I. Ageel. The analysis of variance.

See Also

aov

Examples

1
2
3
4
5
6
7
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)

SensoMineR documentation built on Dec. 13, 2017, 9:04 a.m.