Extract the results for individuals/quantitative variables/qualitative variables/group/partial axes - MFA

Share:

Description

Extract all the results (coordinates, squared cosine and contributions) for the active individuals/quantitative variable categories/qualitative variable categories/groups/partial axes from Multiple Factor Analysis (MFA) outputs.

  • get_mfa(): Extract the results for variables and individuals

  • get_mfa_ind(): Extract the results for individuals only

  • get_mfa_var_qanti(): Extract the results for quantitative variables only

  • get_mfa_var_qali(): Extract the results for qualitative variables only

  • get_mfa_group(): Extract the results for groups only

  • get_mfa_partial_axes(): Extract the results for partial axes only

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
get_mfa(res.mfa, element = c("ind", "quanti.var", "quali.var", "group",
  "partial.axes"))

get_mfa_ind(res.mfa)

get_mfa_quanti_var(res.mfa)

get_mfa_quali_var(res.mfa)

get_mfa_group(res.mfa)

get_mfa_partial_axes(res.mfa)

Arguments

res.mfa

an object of class MFA [FactoMineR].

element

the element to subset from the output. Possible values are "ind", "quanti.var", "quali.var", "group" or "partial.axes".

Value

a list of matrices containing the results for the active individuals/quantitative variable categories/qualitative variable categories/groups/partial axes including :

coord

coordinates for the individuals/quantitative variable categories/qualitative variable categories/groups/partial axes

cos2

cos2 for the individuals/quantitative variable categories/qualitative variable categories/groups/partial axes

contrib

contributions of the individuals/quantitative variable categories/qualitative variable categories/groups/partial axes

inertia

inertia of the individuals/quantitative variable categories/qualitative variable categories/groups/partial axes

Author(s)

Alboukadel Kassambara alboukadel.kassambara@gmail.com

Fabian Mundt f.mundt@inventionate.de

References

http://www.sthda.com

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
# Multiple Factor Analysis
# ++++++++++++++++++++++++
# Install and load FactoMineR to compute MFA
# install.packages("FactoMineR")
library("FactoMineR")
data(poison)
res.mfa <- 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,
graph = FALSE)
 
 # Extract the results for qualitative variable categories
 var <- get_mfa_quali_var(res.mfa)
 print(var)
 head(var$coord) # coordinates of qualitative variables
 head(var$cos2) # cos2 of qualitative variables
 head(var$contrib) # contributions of qualitative variables
 
 # Extract the results for individuals
 ind <- get_mfa_ind(res.mfa)
 print(ind)
 head(ind$coord) # coordinates of individuals
 head(ind$cos2) # cos2 of individuals
 head(ind$contrib) # contributions of individuals
 
 # You can also use the function get_mfa()
 get_mfa(res.mfa, "ind") # Results for individuals
 get_mfa(res.mfa, "quali.var") # Results for qualitative variable categories
 
 

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.