Learn R Programming

factoextra (version 1.0.3)

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

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

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

References

http://www.sthda.com

Examples

Run this code

# 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
 
 

Run the code above in your browser using DataLab