Last data update: 2014.03.03

R: Coordinates of individuals and illustrative individuals for...
construct.axesR 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")

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)

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

MFA

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(SensoMineR)
Loading required package: FactoMineR
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/SensoMineR/construct.axes.Rd_%03d_medium.png", width=480, height=480)
> ### Name: construct.axes
> ### Title: Coordinates of individuals and illustrative individuals for PCA
> ###   or MFA
> ### Aliases: construct.axes
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> ## Example1: PCA 
> data(chocolates)
> donnee <- cbind.data.frame(sensochoc[,c(1,4,5:18)])
> axe <- construct.axes(donnee, scale.unit = TRUE)
Error in dev.new() : no suitable unused file name for pdf()
Calls: construct.axes -> dev.new
Execution halted