Learn R Programming

SensoMineR (version 1.27)

construct.axes: Coordinates of individuals and illustrative individuals for PCA or MFA

Description

This function is especially designed to be used in a sensory data analysis context. Returns the coordinates of the products when performing either PCA or MFA and the coordinates of the "partial" products when performing MFA. Returns also the panelists' coordinates when projected as illustrative rows onto the products' space. Produces graphs of products and descriptors from the output of PCA or MFA.

Usage

construct.axes(matrice, coord = c(1,2), scale.unit = TRUE, group = NULL,
      name.group = NULL, centerbypanelist = FALSE, scalebypanelist = FALSE,
      method = "coeff", graph.type = c("ggplot","classic"))

Value

A list containing the following elements:

eig

a matrix with the component of the factor analysis (in row) and the eigenvalues, the inertia and the cumulative inertia for each component

moyen

the coordinates of the products with respect to the panel and to each panelists

partiel

the coordinates of the partial products with respect to the panel and to each panelists

Returns also a correlation circle as well as a graph of individuals

Arguments

matrice

a data.frame made up of at least two qualitative variables (the panelist and the product variables), the others are sensory descriptors used to perform an MFA or a PCA if group = NULL

coord

a length 2 vector specifying the components to plot

scale.unit

boolean, if TRUE the descriptors are scaled to unit variance

group

the number of variables in each group of variables when multiple factor analysis is performed (by default this parameter equals NULL and a PCA is performed)

name.group

the names of the groups of variables when mfa is performed (if group differs from NULL)

centerbypanelist

center the data by panelist before the construction of the axes

scalebypanelist

scale the data by panelist before the construction of the axes

method

the method to replace the missing values: "average" or "coeff" (coefficients of the product variable in the anova model)

graph.type

a character that gives the type of graph used: "ggplot" or "classic"

Author

Francois Husson

Details

The input data set is an object of class data.frame, for which the two first columns are qualitative variables (the first variable refers to the panelist variable and the second to the product variable) and the others are quantitative.

The ouptut of this function is a list with one element when performing PCA and two elements when performing MFA. The first element is the data frame of the coordinates of the products according to the whole panel (Panelist=0) and to the panelists. The second element is the data frame of the coordinates of the "partial products" according to the whole panel (Panelist=0) and to the panelists.

This function is necessary when calculating confidence ellipses for products.

References

Escofier, B. and Pages, J. (1990) Analyses factorielles simples et multiples: objectifs, methodes et interpretation Dunod, Paris. 1--267.

Escofier, B. and Pages, J. (1994) Multiple factor analysis (AFMULT package). Computational Statistics and Data Analysis, 18, 121--140.

See Also

MFA

Examples

Run this code
## Example1: PCA 
data(chocolates)
donnee <- cbind.data.frame(sensochoc[,c(1,4,5:18)])
axe <- construct.axes(donnee, scale.unit = TRUE)
 
## Example2: MFA (two groups of variables)
data(chocolates) 
donnee <- cbind.data.frame(sensochoc[,c(1,4,5:18)])
axe <- construct.axes(donnee, group = c(6,8), 
    name.group = c("A-F","T-S"),scale.unit = TRUE)

Run the code above in your browser using DataLab