fastMFA: FAST Multiple Factor Analysis (fastMFA)

Description Usage Arguments Value Examples

Description

Performs Multiple Factor Analysis in the sense of Escofier-Pages with supplementary individuals and supplementary groups of variables. Groups of variables can be quantitative, categorical or contingency tables. Missing values in numeric variables are replaced by the column mean. Missing values in categorical variables are treated as an additional level.

Usage

1
2
3
4
fastMFA(base, group, type = rep("s", length(group)), excl = NULL,
  ind.sup = NULL, ncp = 5, name.group = NULL, num.group.sup = NULL,
  graph = TRUE, weight.col.mfa = NULL, row.w = NULL, axes = c(1, 2),
  tab.comp = NULL)

Arguments

base

a data frame with n rows (individuals) and p columns (variables)

group

a vector with the number of variables in each group

type

the type of variables in each group; four possibilities: "c" or "s" for quantitative variables (the difference is that for "s" variables are scaled to unit variance), "n" for categorical variables and "f" for frequencies (from a contingency tables); by default, all variables are quantitative and scaled to unit variance

ind.sup

a vector indicating the indexes of the supplementary individuals

ncp

number of dimensions kept in the results (by default 5)

name.group

a vector containing the name of the groups (by default, NULL and the group are named group.1, group.2 and so on

num.group.sup

the indexes of the illustrative groups (by default, NULL and no group are illustrative)

graph

boolean, if TRUE a graph is displayed

weight.col.mfa

vector of weights, useful for HMFA method (by default, NULL and an MFA is performed)

row.w

an optional row weights (by default, a vector of 1 for uniform row weights)

axes

a length 2 vector specifying the components to plot

tab.comp

object obtained from the imputeMFA function of the missMDA package that allows to handle missing values

cores

IF missing serial implementation is performed, otherwise if specified, will implement parallel MFA function. Only perform on large datasets where parallel implementation is benficiary

Value

MFA Object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
load_pkg("FactoMineR")
data(wine)
res <- MFA(wine, group=c(2,5,3,10,9,2), type=c("n",rep("s",5)),
           ncp=5, name.group=c("orig","olf","vis","olfag","gust","ens"),
           num.group.sup=c(1,6), cores = 2)
summary(res)
barplot(res$eig[,1],main="Eigenvalues",names.arg=1:nrow(res$eig))

## Not run: 
#### Confidence ellipses around categories per variable
plotellipses(res)
plotellipses(res,keepvar="Label") ## for 1 variable

#### Interactive graph
#liste = plotMFApartial(res)
#plot(res,choix="ind",habillage = "Terroir")

###Example with groups of categorical variables
data (poison)
MFA(poison, group=c(2,2,5,6), type=c("s","n","n","n"),
    name.group=c("desc","desc2","symptom","eat"),
    num.group.sup=1:2)

###Example with groups of frequency tables
data(mortality)
res<-MFA(mortality,group=c(9,9),type=c("f","f"),
         name.group=c("1979","2006"))

## End(Not run)

HanjoStudy/quotidieR documentation built on May 5, 2019, 6:13 p.m.