Principal Component Analysis (PCA) calculator
Run Principal Component Analysis (PCA) online. Calculate explained variance, eigenvalues, loading scores, and generate biplots.
What it does
You have too many variables and want to compress them — PCA finds a small number of components that capture most of the shared variance, giving you fewer, uncorrelated dimensions for modelling, visualisation, or an index.
When to use it
You get a handful of components, each a weighted combination of your original variables, ranked by how much of the total variance they capture, with loadings you can use to name what each component represents.
Worked example
You have 30 questionnaire items and suspect they really measure three or four underlying things. PCA finds the combinations that capture most of the variation, so you can plot 30 columns in two dimensions and see the structure. The components are mathematical, not conceptual — naming one "anxiety" is your interpretation, not the output.
Cautions
- Components are ordered by variance explained, not by relevance to any particular outcome — a component that captures a lot of variance may be irrelevant to what you actually care about, and PCA assumes linear structure, so a curved (nonlinear) manifold in your data will spread across many components instead of collapsing into a few.
- Features are scaled before PCA (otherwise the largest-unit variable would dominate the first component), the fit happens inside the same pipeline as any downstream split (fitting on all data before a supervised split is leakage), and linear vs curved structure is checked alongside variance explained per component.
Alternatives
- t-SNE or UMAP — Those are visualisation-only, non-parametric methods with no simple transform for new points and no interpretable loadings — PCA is the appropriate choice when components need to be named or fed into a downstream model.
- Keeping all original variables in the model — With many correlated variables, a downstream model becomes unstable or hard to interpret — PCA's components are ordered by variance and decorrelate the inputs first.
How to read the output
- Explained variance per component
- The share of total variation each axis carries. The scatter plots the first two, and their percentages are on the axis labels. If PC1 and PC2 together carry little of the variance, the picture is a shadow: points close together on screen may be far apart in the data, and apparent clusters in that shadow can be an artefact of the projection.
- Loadings (PC1 / PC2)
- How much each original variable contributes to each axis — what the axis is 'made of', and the only way to name a component. The SIGN of a component is arbitrary. PC1 can flip end for end between runs without anything changing; never read 'high PC1' as meaning anything on its own.
- Whether the data were scaled
- Every method here works on distances, and a distance adds up your columns' units. Standardizing puts each variable on the same footing before that sum is taken. Unscaled, the variable with the largest numeric range silently becomes the clustering. Income in pounds against age in years is a clustering of income. Turn scaling off only when the raw units are genuinely comparable and you mean to keep their relative weight.
- What PCA does not do
- It finds directions of maximum variance. Nothing more. Variance is not importance. A high-variance direction can be measurement noise, and the direction that matters for an outcome can sit in a component you dropped.
How this calculator is validated · Which statistical test should I use?