Learn R Programming

factoextra (version 1.0.3)

get_hmfa: Extract the results for individuals/quantitative variables/qualitative variables/group/partial axes - HMFA

Description

Extract all the results (coordinates, squared cosine and contributions) for the active individuals/quantitative variable categories/qualitative variable categories/groups/partial axes from Hierarchical Multiple Factor Analysis (HMFA) outputs.
  • get_hmfa(): Extract the results for variables and individuals
  • get_hmfa_ind(): Extract the results for individuals only
  • get_hmfa_var_qanti(): Extract the results for quantitative variables only
  • get_hmfa_var_qali(): Extract the results for qualitative variables only
  • get_hmfa_group(): Extract the results for groups only

Usage

get_hmfa(res.hmfa, element = c("ind", "quanti.var", "quali.var", "group"))
get_hmfa_ind(res.hmfa)
get_hmfa_quanti_var(res.hmfa)
get_hmfa_quali_var(res.hmfa)
get_hmfa_group(res.hmfa)
get_hmfa_partial(res.hmfa)

Arguments

res.hmfa
an object of class HMFA [FactoMineR].
element
the element to subset from the output. Possible values are "ind", "quanti.var", "quali.var" or "group".

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(wine)
hierar <- list(c(2,5,3,10,9,2), c(4,2))
res.hmfa <- HMFA(wine, H = hierar, type=c("n",rep("s",5)), graph = FALSE)
 
 # Extract the results for qualitative variable categories
 var <- get_hmfa_quali_var(res.hmfa)
 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_hmfa_ind(res.hmfa)
 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_hmfa()
 get_hmfa(res.hmfa, "ind") # Results for individuals
 get_hmfa(res.hmfa, "quali.var") # Results for qualitative variable categories
 
 

Run the code above in your browser using DataLab