Performs multiple factor analysis to analyze a set of individuals (observations) described by several groups of variables. Variables within a group can be a mixture of quantitative and qualitative variables.
MFAmix(data, groups, name.groups, ndim=5, rename.level=FALSE, graph = TRUE,
axes = c(1, 2))
a data frame with n
rows and p
columns containing all the variables. This data frame
will be split into G
groups according to the vector
groups
.
a vector which gives the groups of the columns in data
.
a vector of size G
which gives the names of the groups.
number of dimensions kept in the results (by default 5).
boolean, if TRUE all the levels of the qualitative variables are renamed as follows: "variable_name=level_name". This prevents to have identical names for the levels.
boolean, if TRUE the following graphics are displayed for the first two dimensions of PCAmix: plot of the individuals coordinates, plot of the squared loadings of variables, plot of the partial axes, plot of the correlation circle (if quantitative variables are available), plot of the levels component map (if qualitative variables are available).
a length 2 vector specifying the axes to plot.
a matrix containing the eigenvalues, the percentages of variance and the cumulative percentages of variance.
a list containing the results for the individuals (observations):
$coord
: factor coordinates (scores) of the individuals,
$contrib
: absolute contributions of the individuals,
$contrib.pct
: relative contributions of the individuals,
$cos2
: squared cosinus of the individuals.
a list containing the results for the quantitative variables:
$coord
: factor coordinates (scores) of the quantitative variables,
$contrib
: absolute contributions of the quantitative variables,
$contrib.pct
: relative contributions of the quantitative variables (in percentage),
$cos2
: squared cosinus of the quantitative variables.
a list containing the results for the levels of the qualitative variables:
$coord
: factor coordinates (scores) of the levels,
$contrib
: absolute contributions of the levels,
$contrib.pct
: relative contributions of the levels (in percentage),
$cos2
: squared cosinus of the levels.
a list containing the results for the qualitative variables:
$contrib
: absolute contributions of the qualitative variables (sum of absolute contributions of the levels of the qualitative variable),
$contrib.pct
: relative contributions (in percentage) of the qualitative variables (sum of relative contributions of the levels of the qualitative variable).
a matrix of dimension (p
, ndim
) containing the squared loadings of the quantitative and qualitative variables.
the coefficients of the linear combinations used to construct the principal components of MFAmix, and to predict coordinates (scores) of new observations in the function predict.MFAmix
.
a matrix containing the ndim
first eigenvalues of the separated analyses of each group.
the results for the separated analyses of each group.
a list containing the results for the groups:
$Lg
: Lg coefficients between groups,
$RV
: RV coefficients between groups,
$contrib
: contributions of the groups (sum of variable contributions belonging to the group)
$contrib.pct
: relative contributions of the groups times 100,
a matrix containing the coordinates of the partial axes.
a list of G
matrices containing the coordinates
of the partial individuals.
list the variables in each group. It is usefull to check the adequacy between the vector groups
and the vector name.groups
.
an object of class PCAmix
containing the results of MFAmix
considered as a unique PCAmix
.
Multiple Factor Analysis (MFA) developed by Escofier and Pages in 1983 is a method of factorial analysis to deal with multiple groups of variables collected on the same observations. The main idea of MFA is to normalize each group by dividing all the variables belonging to this group by the first eigenvalue coming from the Principal Component Analysis (PCA) of this group. Then, a usual PCA on all the weighted variables taken together is applied. Initially this method has been developed for groups only containing quantitative variables. Afterwards this method has been improved to deal simultaneously with groups of qualitative variables and groups of quantitative variables. The MFAmix
method allows to perform MFA method for groups containing a mixture of quantitative and qualitative variables
One of the outputs available in the MFAmix method are the squared loadings (sqload
). Squared loadings for a qualitative variable are correlation ratios between the variable and the principal components. For a quantitative variable, squared loadings are the squared correlation between the variable and the principal components.
Some others outputs are specific to MFA:
Coordinates of groups are the sum of the absolute contributions of variables belonging to the groups,
Partial individuals coordinates are factor coordinates of individuals according to a specific group. The partial coordinates can be achieved by projecting the data set of each group onto the principal component space of MFAmix,
Partial axes of a group are correlation between each principal components of the separated analyses of the group and the principal components of MFAmix.
Chavent M., Kuentz-Simonet V., Labenne A., Saracco J., Multivariate analysis of mixed data: The PCAmixdata R package, arXiv:1411.4911 [stat.CO].
Escofier, B. and Pages, J. (1994). Multiple factor analysis (afmult package). Computational statistics & data analysis, 18(1):121-140.
Le, S., Josse, J., and Husson, F. (2008). Factominer: an r package for multivariate analysis. Journal of statistical software, 25(1):1-18.
# NOT RUN {
data(gironde)
class.var<-c(rep(1,9),rep(2,5),rep(3,9),rep(4,4))
names <- c("employment","housing","services","environment")
dat<-cbind(gironde$employment[1:20,],gironde$housing[1:20,],
gironde$services[1:20,],gironde$environment[1:20,])
res<-MFAmix(data=dat,groups=class.var,
name.groups=names, rename.level=TRUE, ndim=3,graph=FALSE)
summary(res)
# }
Run the code above in your browser using DataLab