Tutorials › Multi-Omics Data Integration › MFA With Quantitative and Categorical Blocks

Multiple Factor Analysis and Joint PCA · Tutorial 172 of 597

MFA With Quantitative and Categorical Blocks

Learn how to encode and balance quantitative and categorical blocks in MFA, then interpret quantitative correlations and category positions in the shared global map.

Advanced 13 min read

What You'll Learn

  • Construct a mixed-data MFA from standardized quantitative variables and categorical indicators.
  • Explain how first-eigenvalue scaling balances blocks without making their total inertia equal.
  • Interpret quantitative variable correlations with global components.
  • Calculate and interpret category coordinates as barycentres of individual scores.
  • Diagnose sparse categories, weak representation and misleading map distances.
  • Distinguish mixed-data MFA from separate analyses and unbalanced concatenation.

Why Mixed-Data MFA Needs Careful Representation

A multi-omics study may contain continuous measurements, such as metabolite abundances, alongside categorical annotations, such as genotype class or clinical subtype. A global MFA map can represent both kinds of information, but only after each block is encoded in a way that respects its measurement scale. Treating category labels as numbers, or simply appending indicator columns to standardized measurements, can make the geometry depend on arbitrary coding choices.

The construction below combines two established ideas: quantitative variables are centered and scaled as in correlation-based PCA, while categorical variables are represented through complete disjunctive coding and the MCA chi-square metric. Each block is then balanced by its own first principal inertia before the global PCA. The earlier material on the MFA compromise space establishes how this block scaling produces the shared individual map; here the focus is on what the mixed representations mean and how to interpret their plotted variables and categories.

Definition: Suppose the same \(n\) individuals are observed in several blocks. A quantitative block contains numerical variables. A categorical block contains one or more categorical variables. For each categorical variable, complete disjunctive coding creates one indicator column per observed category, with entry 1 when an individual belongs to that category and 0 otherwise. Mixed-data MFA analyzes transformed blocks, scales each by the inverse square root of its first principal inertia, concatenates the scaled blocks, and performs a global PCA. Every block must have positive first principal inertia; remove or otherwise handle zero-inertia blocks before scaling (for example, a categorical variable with only one observed category produces a zero column).

Representing and Balancing the Blocks

For a quantitative variable \(x_j\) with nonzero variance, define its standardized value for individual \(i\) by \(z_{ij}=(x_{ij}-\bar{x}_j)/s_j\), where \(\bar{x}_j\) is its sample mean and \(s_j=\sqrt{\frac{1}{n}\sum_{i=1}^n(x_{ij}-\bar{x}_j)^2}\). Thus each variable is centered and has variance 1 under the \(1/n\) covariance convention. This makes the analysis depend on relative patterns rather than measurement units. A constant variable cannot be standardized and must be removed or handled separately.

For a categorical variable with categories \(1,\ldots,q\), let \(d_{ik}=1\) if individual \(i\) is in category \(k\), and 0 otherwise. Let \(p_k=n_k/n\) be the observed proportion in category \(k\). The MCA-scaled column is \(y_{ik}=(d_{ik}-p_k)/\sqrt{p_k}\). This centers the indicator and gives it the MCA chi-square weighting: rare categories receive a larger column scale than common ones. Every observed category has \(p_k>0\); an unobserved category contributes no information and is omitted. The columns for one variable are linearly dependent after centering, so the dependence is expected, not a computational error.

For each transformed block \(Y_g\), calculate its first principal inertia \(\lambda_{g1}\), the largest eigenvalue of \(Y_g^\mathsf{T}Y_g/n\). The global data matrix concatenates \(Y_g/\sqrt{\lambda_{g1}}\) across blocks. The definition of \(\lambda_{g1}\) must match the chosen row weights and variance convention; software conventions can differ, so use the same convention throughout.

Key result: Dividing a block by \(\sqrt{\lambda_{g1}}\) divides every eigenvalue of its covariance matrix by \(\lambda_{g1}\). Its first eigenvalue therefore becomes 1. This equalizes the leading inertia of the blocks, not their total inertia, number of columns, or influence on every global component.

Worked Example: Encoding and Scaling a Categorical Block

Consider four hypothetical individuals with one categorical annotation: A, A, B, B. The category proportions are \(p_A=p_B=2/4=0.5\). The centered indicator for A is \((0.5,0.5,-0.5,-0.5)\). Dividing by \(\sqrt{0.5}\) gives the MCA-scaled column \((0.7071,0.7071,-0.7071,-0.7071)\). The column for B is its negative.

Using covariance divisor \(n=4\), the block covariance matrix is \( \begin{pmatrix}0.5&-0.5\\-0.5&0.5\end{pmatrix}\). Its eigenvalues are 1 and 0: the first principal inertia is \(\lambda_{g1}=1\). The zero eigenvalue reflects the fact that the two indicator columns sum to zero after centering. This categorical block is therefore divided by \(\sqrt{1}=1\) before joining the other blocks.

Now suppose a separate quantitative block has two standardized variables with correlation 0.6. Its covariance matrix is \( \begin{pmatrix}1&0.6\\0.6&1\end{pmatrix}\), whose eigenvalues are 1.6 and 0.4. Its first inertia is 1.6, so both columns are multiplied by \(1/\sqrt{1.6}\approx0.7906\). The categorical and quantitative blocks now each have first eigenvalue 1. Their total inertias remain different: the quantitative block has total inertia 1.25 after scaling, whereas the one-variable categorical block has total inertia 1. The scaling balances the leading direction, not all aspects of the blocks.

Interpreting Quantitative Variables and Categories

Global individual scores are coordinates in the compromise space. A quantitative variable is commonly shown by its correlation with each global component. If \(F_\ell\) is the score on component \(\ell\), the plotted coordinate for original quantitative variable \(x_j\) on that axis is \(\operatorname{cor}(x_j,F_\ell)\). A large absolute correlation indicates a strong linear association with that component; its sign indicates direction relative to the chosen component orientation. Because eigenvector signs can be reversed without changing the solution, interpretations should focus on relative directions and relationships.

For categorical variables, the usual category coordinates in the global individual map are category barycentres: the mean global score among individuals in that category. If \(I_k\) is the set of individuals in category \(k\), then the coordinate on component \(\ell\) is \(n_k^{-1}\sum_{i\in I_k}F_{i\ell}\). Categories far apart have different average profiles on the displayed components. A category's distance from the origin is not itself a test of significance, and the map's Euclidean distances are meaningful only as approximations within the displayed dimensions.

These two kinds of points have different meanings. Quantitative coordinates are correlations with global axes; category coordinates are means of individual scores. They can be shown together in a global map, but they should not be described as if they were the same statistic or had the same scale.

Worked Example: Reading Quantitative Correlations and Category Positions

Suppose a hypothetical mixed MFA produces a first global component with variance 0.30, and the following summary for two standardized quantitative variables: \(\operatorname{cov}(x_1,F_1)=0.31304\) and \(\operatorname{cov}(x_2,F_1)=0.40248\). Each variable has variance 1. The correlation formula is covariance divided by the product of standard deviations.

For \(x_1\), \(\operatorname{cor}(x_1,F_1)=0.31304/\sqrt{1(0.30)}=0.31304/\sqrt{0.30}\approx0.5715\). For \(x_2\), \(\operatorname{cor}(x_2,F_1)=0.40248/\sqrt{1(0.30)}=0.40248/\sqrt{0.30}\approx0.7348\). Thus both variables are positively associated with the component, and \(x_2\) has the stronger displayed linear association. Neither value says that the variable causes the component scores.

For a category-coordinate calculation, suppose four hypothetical individuals have first-component scores \(-0.73485,-0.24495,0.24495,0.73485\), and the category A occurs for the first two. Its coordinate is their mean: \((-0.73485-0.24495)/2=-0.48990\). If category B occurs for the last two, its coordinate is \((0.24495+0.73485)/2=0.48990\). The two categories have opposite average positions on this component. The calculation describes their locations in this map; it does not establish that category membership caused the score difference.

Why Category Coordinates Are Barycentres

The barycentre interpretation follows directly from averaging scores within a category. For component scores \(F_{i\ell}\), the category mean is the conditional sample mean of those scores among members of category \(k\). In terms of the indicator, this can also be written as a covariance-like expression. Since the grand mean of the centered component scores is zero,

$$ \frac{1}{n_k}\sum_{i\in I_k}F_{i\ell} = \frac{1}{p_k}\frac{1}{n}\sum_{i=1}^n d_{ik}F_{i\ell} = \frac{1}{p_k}\frac{1}{n}\sum_{i=1}^n(d_{ik}-p_k)F_{i\ell}. $$

The first equality uses \(p_k=n_k/n\). The second holds because \(\sum_i F_{i\ell}=0\), so subtracting \(p_k\) from each indicator does not change the sum. This explains why category position reflects association between membership and the global score. MCA scaling affects the geometry used to fit the global axes; when plotting category barycentres in the individual map, the mean-score definition remains the same.

Worked Example: A Category Coordinate from an Indicator

In a hypothetical sample of five individuals, a category occurs for individuals 1 and 4, so \(n_k=2\) and \(p_k=2/5=0.4\). Their scores on one centered global component are 0.8 and \(-0.3\); the other three scores sum to \(-0.5\), making the total score sum zero. The category coordinate is \((0.8+(-0.3))/2=0.25\).

Using the centered-indicator form gives the same answer. The sum \(\sum_i(d_{ik}-p_k)F_i\) equals \(0.6(0.8)+0.6(-0.3)+(-0.4)\sum_{i\notin I_k}F_i=0.48-0.18+0.20=0.50\), since the other scores sum to \(-0.5\). Dividing by \(np_k=5(0.4)=2\) gives \(0.50/2=0.25\), the category mean. This agrees with the identity above, \((1/p_k)(1/n)\sum_i(d_{ik}-p_k)F_i=(1/0.4)(1/5)(0.50)=0.25\).

Diagnostics, Alternatives, and Limitations

Check the analysis before assigning biological meaning to the map. Confirm that quantitative variables have been centered and scaled as intended, categorical indicators use the observed category proportions, and every block's first inertia is computed using the same row weights and convention. Inspect category counts: a very rare level can have an unstable position and can exert substantial influence through MCA scaling. Check whether the first global components represent the blocks adequately; a point may appear close to the origin simply because its information lies on omitted dimensions. Use representation quality and block contributions alongside the map rather than judging importance by visual distance alone.

The main alternatives answer different questions. Separate PCA or MCA preserves each block's own geometry but does not give one compromise map. Concatenating standardized quantitative variables and unweighted indicator columns is simpler, but blocks with more columns or different coding can dominate. Mixed-data MFA retains the common map while balancing blocks by first inertia; it is not a guarantee that every block contributes equally to every axis, nor does it remove confounding, dependence among individuals, missing-data problems, or measurement error.

Results can also depend on category definitions. Combining or splitting levels changes the indicator table and may change the fitted axes. A category coordinate is descriptive, not a causal effect or a formal significance test. Likewise, a quantitative correlation with an axis is an association in the fitted sample, not evidence of a causal mechanism. Check sensitivity to defensible preprocessing and category choices, especially when the sample is small or levels are sparse.

  • Incorrect: “The category labels are coded 1, 2, and 3, so they can be treated as a quantitative variable.”
    Correction: Those values are labels unless their numerical spacing has a real measurement interpretation. Use indicator coding and the categorical-block metric.
  • Incorrect: “First-eigenvalue scaling makes all blocks equally influential.”
    Correction: It makes each block's leading eigenvalue equal to 1 before the global PCA. Contributions to a particular global component can still differ.
  • Incorrect: “A category far from the origin has a statistically significant effect.”
    Correction: The location is descriptive in the displayed map. It is not a hypothesis test, and its reliability depends on sample size, representation quality, and omitted dimensions.
Key takeaway: In mixed-data MFA, quantitative features are standardized and categorical variables are represented by centered, MCA-scaled indicators. First-inertia scaling balances the blocks' leading directions. Interpret quantitative correlations and category barycentres according to their distinct definitions, and treat the global map as a descriptive low-dimensional summary.

Check Your Understanding

Try each question, then compare with the solutions below.

  1. A categorical variable has category proportions 0.8 and 0.2. What are the MCA-scaled values for the first category indicator, for an individual in the first category and for an individual in the second?
  2. A quantitative block has first principal inertia 2.25. By what factor are its columns multiplied, and what is its first eigenvalue after scaling?
  3. On a global component, five members of category C have scores with mean \(-0.4\). What is the category coordinate, and what does it mean?
  4. Why should a category coordinate not be interpreted as a causal effect or as a significance test?

Solutions. (1) The centered indicator is \(d-p\). For the first category, its scaled value is \((1-0.8)/\sqrt{0.8}\approx0.2236\); for the second category it is \((0-0.8)/\sqrt{0.8}\approx-0.8944\). (2) Multiply by \(1/\sqrt{2.25}=1/1.5\approx0.6667\); the first eigenvalue becomes \(2.25/2.25=1\). (3) The coordinate is \(-0.4\), the mean component score among those five individuals. It describes their average position on that axis. (4) It is a descriptive barycentre in a fitted low-dimensional map, not an estimate from a causal design or a test statistic with a null distribution. Its apparent separation may also be affected by sample size and omitted dimensions.

Clinical Biostats