supvar.MFAmix: Supplementary variables in MFAmix

View source: R/supvar.MFAmix.R

supvar.MFAmixR Documentation

Supplementary variables in MFAmix

Description

Performs the coordinates of supplementary variables and groups on the component of an object of class MFAmix.

Usage

## S3 method for class 'MFAmix'
supvar(obj, data.sup, groups.sup, name.groups.sup, rename.level = FALSE, ...)

Arguments

obj

an object of class MFAmix.

data.sup

a numeric matrix of data.

groups.sup

a vector which gives the groups of the columns in data.sup.

name.groups.sup

a vector which gives the names of the supplementary groups.

rename.level

boolean, if TRUE all the levels of the qualitative variables are renamed as follows: "variable_name=level_name". This prevents to have identical names of the levels.

...

further arguments passed to or from other methods.

Examples

data(wine)
X.quanti <- splitmix(wine)$X.quanti[,1:5]
X.quali <- splitmix(wine)$X.quali[,1,drop=FALSE]
X.quanti.sup <- splitmix(wine)$X.quanti[,28:29]
X.quali.sup <- splitmix(wine)$X.quali[,2,drop=FALSE]
data <- cbind(X.quanti,X.quali)
data.sup <- cbind(X.quanti.sup,X.quali.sup)
groups <-c(1,2,2,3,3,1)
name.groups <- c("G1","G2","G3")
groups.sup <- c(1,1,2)
name.groups.sup <- c("Gsup1","Gsup2")
mfa <- MFAmix(data,groups,name.groups,ndim=4,rename.level=TRUE,graph=FALSE)
mfa.sup <- supvar(mfa,data.sup,groups.sup,name.groups.sup,rename.level=TRUE)



chavent/PCAmixdata documentation built on Dec. 15, 2022, 5:56 p.m.