averagetable           package:SensoMineR           R Documentation

_C_o_m_p_u_t_e_s _a (_p_r_o_d_u_c_t_s,_d_e_s_c_r_i_p_t_o_r_s) _m_a_t_r_i_x

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

  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)

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

     Franois Husson Franois.Husson@agrocampus-rennes.fr

_R_e_f_e_r_e_n_c_e_s:

     P. Lea, T. Naes, M. Rodbotten. _Analysis of variance for sensory
     data_. 
      H. Sahai, M. I. Ageel. _The analysis of variance_.

_S_e_e _A_l_s_o:

     'aov'

_E_x_a_m_p_l_e_s:

     data(chocolates)
     resaverage<-averagetable(sensochoc, formul = "~Product+Panelist",
         firstvar = 5)
     coltable(magicsort(resaverage), level.upper = 6,level.lower = 4,
         main.title = "Average by chocolate")

     resdecat<-decat(sensochoc, formul = "~Product+Panelist", firstvar = 5,
         graph = FALSE)
     resaverage.sort = resaverage[rownames(magicsort(resdecat$tabT)),
         colnames(magicsort(resdecat$tabT))]
     coltable(resaverage.sort, magicsort(resdecat$tabT), 
         level.lower = -1.96, level.upper = 1.96,
         main.title = "Average by chocolate")

     res.pca = PCA(resaverage, scale.unit = TRUE)

