construct.axes {SensoMineR} | R Documentation |
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"))
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 |
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 |
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" |
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.
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
Author(s)
Francois Husson
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
Examples
## 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)