Two-variable principal components

Center two numeric columns and inspect covariance, principal directions, explained variance and row scores.

The example value has been entered. Check it immediately or change the value.

Input is processed in the browser. Refreshing returns a sample value.

Result

Instructions and example

C=XᵀX/(n−1); λ₁,₂=(C₁₁+C₂₂±hypot(C₁₁−C₂₂,2C₁₂))/2

For 1,2 / 2,4 / 3,6 the mean is 2,4, eigenvalues are 5,0 and the first component explains fraction 1.

Use 2–200 rows and exactly 2 columns, magnitude at most 1,000,000,000. Covariance PCA centers without scaling; zero-variance data are rejected. Small eigenvalues are precision-sensitive. Floating-point results display at most 12 significant digits.

Frequently asked questions

Should units be aligned before covariance PCA?

This tool subtracts means without rescaling. A column with a larger scale can dominate the direction, so review the units.

Is the opposite sign of a principal direction equivalent?

Yes. Reversing both axis and score signs describes the same subspace. Equal eigenvalues also make the direction non-unique.

Calculation criteria and reference materials

Verification of calculation criteria: · Calculation·verification principles · Report errors