# Principal Component Analysis (PCA) Explained Simply, With a Worked Example

Principal component analysis (PCA) is a method that rewrites a table of correlated measurements as a smaller set of new, uncorrelated variables called principal components, ordered so that the first component captures as much of the original variation as possible. Each component is a weighted sum of the original variables, and the weights are chosen so that every component is perpendicular (orthogonal) to all the others.

That single idea does a lot of work in biology. Modern experiments produce tables with thousands of columns: 20,000 genes per RNA sample, 64 electrodes per EEG recording, hundreds of metabolites per plasma sample, millions of genotype positions per person. Most of those columns move together, so the table carries far less independent information than its width suggests. PCA finds the small number of directions in which the data actually spreads out, which makes it possible to draw a two-dimensional picture of a 20,000-dimensional dataset, to remove redundancy before regression, to check for batch effects, and to build features for clustering or classification. It is one of the most widely used exploratory tools in the life sciences, and it is also one of the most widely misunderstood.

## What Is PCA? The Problem It Solves

Imagine measuring the expression of 15,000 genes in 80 tissue samples. Each sample is a point in 15,000-dimensional space. Two problems appear immediately. First, no plot can show 15,000 dimensions. Second, many genes are strongly correlated because they belong to the same pathway, cell type or technical artifact, so distances between samples are dominated by a handful of large, shared patterns rather than by the many small independent ones.

PCA attacks both problems at once. It asks a geometric question: in which direction does this cloud of points spread out the most? That direction becomes the first principal component (PC1). The method then looks for the next direction of greatest spread that is perpendicular to the first, and calls it PC2. It continues until the number of possible components is exhausted, which is the smaller of the number of samples minus one and the number of variables.

The result is a rotation of the coordinate system. The data are not changed, only described from a better angle. In the new coordinate system, the first few axes usually carry most of the variance, so the remaining axes can be dropped with modest loss of information.

### The Geometric Picture

Put two variables on a scatterplot. If the variables are correlated, the points form an elongated ellipse tilted away from both axes. The long axis of that ellipse is PC1. The short axis, at right angles to it, is PC2. The length of each axis is proportional to the variance captured by that component. For a dataset with strong correlation, the ellipse is long and thin, so PC1 alone describes almost everything and PC2 describes almost nothing.

With three variables, the cloud becomes an ellipsoid with three perpendicular axes. With 15,000 variables, you cannot picture it, but the algebra is identical. PCA finds the axes of the ellipsoid, longest first.

### Why Orthogonality Matters

Orthogonal components are statistically uncorrelated. That property is the reason PCA is used to treat [multicollinearity](/blog/data-analysis/multicollinearity-definition-detection), the situation in which predictor variables overlap so heavily that regression coefficients become unstable. A clinical statistics tutorial describes PCA as an orthogonal transformation that represents a set of correlated variables with principal components that are linearly uncorrelated, allowing the variable space to be reduced [1]. If you replace ten overlapping blood markers with two uncorrelated components, a downstream model no longer has to untangle the overlap.

## The Vocabulary of a PCA Analysis

Most confusion about PCA comes from mixing up five objects: the original variables, the components, the scores, the loadings and the eigenvalues. The table below fixes the definitions before the worked example uses them.

| Term | Plain meaning | Where you see it |
|--|--|--|
| Variable (feature) | One measured column, such as a gene, electrode or metabolite | The raw data table |
| Observation (sample) | One row, such as a patient, cell or trial | The raw data table |
| Standardization | Converting each column to z-scores by subtracting its mean and dividing by its standard deviation | [Preprocessing](/blog/data-analysis/what-is-data-preprocessing) step |
| Principal component | A new axis defined as a weighted sum of the original variables | PC1, PC2, PC3 |
| Score | The coordinate of one sample along one component | The PCA plot |
| Loading | The weight of one original variable in one component | The loadings table or biplot arrows |
| Eigenvalue | The amount of variance carried by one component | The scree plot |
| Scree plot | A bar or line chart of variance explained by component number | Choosing how many components to keep |
| Biplot | A single plot showing sample scores and variable loadings together | Interpretation of both at once |

### Scores, Loadings and Eigenvalues in One Sentence Each

A score tells you where a sample sits. A loading tells you which variables define that position. An eigenvalue tells you how much of the total variance that component accounts for.

If PC1 has high positive loadings for variables A, B and C, then samples with large positive PC1 scores tend to have high values of A, B and C. If PC2 has a positive loading for A and a negative loading for B, then PC2 separates samples that are high in A but low in B from samples that are low in A but high in B.

## How PCA Works, Step by Step

The full procedure is short enough to state as six steps. Each step is a small, checkable operation, which is why PCA can be reproduced exactly from a methods section.

### Step 1: Arrange the data as a matrix

Build a matrix with samples as rows and variables as columns. Call it **X**, with n rows and p columns. In the running example below, n is 6 samples and p is 2 genes.

### Step 2: Center, and usually scale

Subtract the mean of each column so that every variable has mean zero. This moves the cloud of points to the origin, which is required for the geometry to work.

Then decide whether to divide each column by its standard deviation. This converts the data to z-scores:

`z = (x - column mean) / column standard deviation`

Scaling is essential when variables have different units or wildly different ranges. A variable measured in thousands (gene counts) will otherwise dominate a variable measured in single digits (a clinical score) purely because of its numerical size. Scaling is optional when all variables share one unit and you want large-variance variables to count more. In R, `prcomp()` centers by default but does not scale unless you set `scale. = TRUE`. In Python, scikit-learn's `PCA` centers but does not scale, so you must apply `StandardScaler` yourself.

### Step 3: Build the covariance or correlation matrix

With centered data, the covariance between two variables is the average product of their deviations:

`cov(x, y) = sum((xi - mean x) * (yi - mean y)) / (n - 1)`

Collecting every pair of variables gives a p by p [covariance matrix](/blog/data-analysis/what-is-covariance-matrix). If the data were standardized in step 2, this matrix is the correlation matrix, with 1s on the diagonal and correlations elsewhere. This small matrix is where the interesting structure lives, because it summarizes how variables move together rather than how large they are.

### Step 4: Find the eigenvectors and eigenvalues

An eigenvector of the covariance matrix is a direction that the matrix does not rotate, only stretches. The amount of stretching is its eigenvalue. In PCA terms, each eigenvector is a component (the loadings) and each eigenvalue is the variance that component explains.

Most software computes this through singular value decomposition (SVD) rather than by solving the eigenvector equation directly, because SVD is numerically more stable. The results are equivalent. The total variance in the data equals the sum of all eigenvalues, so the fraction of variance explained by component k is its eigenvalue divided by that sum.

### Step 5: Compute the scores

Project each sample onto each retained component:

`score(i, k) = loading(1, k) * z(i, 1) + loading(2, k) * z(i, 2) + ... + loading(p, k) * z(i, p)`

The scores are the coordinates of the samples in the new space. A PCA plot is simply a scatterplot of PC1 scores against PC2 scores.

### Step 6: Decide how many components to keep

The first few components usually carry most of the variance. How many to retain depends on the purpose. For visualization, two or three are enough. For regression or clustering, common rules of thumb are to keep components with eigenvalues above 1 (the Kaiser rule, applied to correlation-based PCA), or to keep enough components to reach roughly 70 to 95 percent cumulative variance, or to look for the elbow in the scree plot where additional components stop adding much.

## A Worked Example With Six Samples and Two Genes

The arithmetic is easiest to follow with two variables, because the components can be drawn on paper. The same steps apply unchanged to thousands of variables.

### The Data

Six tissue samples, two genes, expression values already normalized:

| Sample | Gene A | Gene B |
|--|--|--|
| S1 | 1 | 3 |
| S2 | 2 | 7 |
| S3 | 3 | 6 |
| S4 | 4 | 9 |
| S5 | 5 | 8 |
| S6 | 6 | 9 |

Gene A has a mean of 3.5 and a sample standard deviation of 1.871. Gene B has a mean of 7.0 and a sample standard deviation of 2.280.

### Standardize and Correlate

Convert each value to a z-score. For S1, Gene A becomes (1 - 3.5) / 1.871 = -1.336 and Gene B becomes (3 - 7.0) / 2.280 = -1.754. Doing this for all six samples gives the standardized table.

The correlation between the two genes is 0.844. The correlation matrix is therefore:

| | Gene A | Gene B |
|--|--|--|
| Gene A | 1.000 | 0.844 |
| Gene B | 0.844 | 1.000 |

### Eigenvalues and Loadings

For a two-variable correlation matrix, the eigenvalues are 1 + r and 1 - r, where r is the correlation. Here they are 1.844 and 0.156, which sum to 2.000, matching the total variance of two standardized variables. The variance explained is 1.844 / 2.000 = 92.2 percent for PC1 and 7.8 percent for PC2.

The corresponding loadings are:

| Variable | PC1 loading | PC2 loading |
|--|--|--|
| Gene A | 0.707 | 0.707 |
| Gene B | 0.707 | -0.707 |

Equal loadings on PC1 mean the component weights the two genes equally. That makes PC1 an "overall expression" axis. Opposite signs on PC2 mean that component contrasts the two genes, so it separates samples where Gene A is unusually high relative to Gene B from samples where Gene B is unusually high relative to Gene A.

### Scores

Applying the loadings to the z-scores gives each sample's coordinates:

| Sample | PC1 score | PC2 score |
|--|--|--|
| S1 | -2.19 | 0.30 |
| S2 | -0.57 | -0.57 |
| S3 | -0.50 | 0.12 |
| S4 | 0.81 | -0.43 |
| S5 | 0.88 | 0.26 |
| S6 | 1.57 | 0.33 |

These numbers can be checked. The variance of the six PC1 scores is 1.844, the first eigenvalue. The variance of the PC2 scores is 0.156, the second eigenvalue. The sums of squared scores divided by n - 1 reproduce the eigenvalues exactly, which is a useful sanity check when you are learning the method.

### Reading the Result

S1 has the lowest PC1 score, meaning it is low on both genes. S6 has the highest, meaning it is high on both. That is the overall expression pattern.

PC2 tells a different story. S2 sits at -0.57 on PC2 even though its PC1 score is only moderately low. Looking back at the raw data, S2 has Gene A at 2 (well below average) and Gene B at 7 (right at the average), so Gene B is unusually high relative to Gene A. That is exactly what a negative PC2 score represents. S4 shows the mirror case: Gene A at 4 (slightly above average) and Gene B at 9 (well above average), which produces a positive PC1 score but a negative PC2 score.

With only two variables, PCA has merely rotated the plot. With 15,000 genes, the same rotation concentrates the shared biology into a few axes and pushes technical noise and idiosyncratic variation into the many small components you discard.

## How to Read a PCA Plot

A PCA plot, also called a scores plot, places each sample at its PC1 and PC2 coordinates. In biology it is usually drawn with points colored by [experimental group](/blog/guides/experimental-group), donor, batch or cluster label.

Three things are worth looking for. The first is separation between groups. If treated samples sit on one side of the plot and controls on the other, that axis is capturing the treatment effect. The second is outliers. A single sample sitting far from everything else may be a failed library, a mislabeled tube or a genuine biological extreme, and either way it deserves a look before it drives the analysis. The third is batch structure. If samples cluster by sequencing run rather than by condition, the dominant source of variance is technical, and correction is needed before biological interpretation.

A widely used open RNA-seq pipeline generates interactive PCA plots and hierarchical clustering as standard early outputs, precisely because this visual check catches problems that summary statistics miss [2]. A high-throughput single-cell tutorial makes the same point in a different setting: PCA is the appropriate covariance-based model when the question is about coordinated cell activation, while other methods suit cell-type discovery [3].

Two cautions apply to every PCA plot. The axes are linear combinations chosen to maximize variance, not to maximize group separation, so a clean split does not by itself prove a statistically significant difference. And the fraction of variance shown on each axis matters: if PC1 explains 12 percent and PC2 explains 9 percent, the picture is a low-resolution summary of a noisy dataset, and small visual gaps mean little.

## PCA Loadings and the Biplot

Loadings answer the question "what does this axis mean?" A loading is the weight each original variable contributes to a component. Large positive and negative loadings identify the variables that shape the axis. Loadings near zero identify variables that are irrelevant to it.

A common mistake is to read a loading as a correlation between a variable and a component. Some software reports loadings scaled by the square root of the eigenvalue, some reports raw eigenvector entries, and some reports correlations. The raw eigenvector entries are not correlations unless the data were standardized and the loadings are rescaled. Check the documentation of whatever produced your output before quoting a loading as a correlation.

### What a Biplot Shows

A biplot overlays sample scores (points) and variable loadings (arrows) on the same two axes. It lets you see, in one view, which samples are extreme and which variables push them there.

Under the scaling convention that preserves correlations (arrows multiplied by the square root of their component's eigenvalue), the cosine of the angle between two arrows approximates the correlation between those variables. Arrows pointing in nearly the same direction indicate positively correlated variables. Arrows at right angles indicate variables that are close to uncorrelated. Arrows pointing in opposite directions indicate negative correlation.

In the worked example, PC1 has eigenvalue 1.844 and PC2 has eigenvalue 0.156, so the scaling factors are 1.358 and 0.395. Gene A's scaled coordinates become (0.707 × 1.358, 0.707 × 0.395) = (0.960, 0.279), and Gene B's become (0.960, -0.279). The cosine of the angle between them is 0.844, which matches the correlation computed from the raw data. Arrows are therefore not decorative. They carry quantitative information, provided you know how they were scaled.

A practical caution: many plotting libraries rescale arrows by an arbitrary factor so that they fit on the same canvas as the points. In those plots, arrow lengths are not comparable across figures, and only the direction and relative angle carry meaning.

## The Scree Plot and Choosing the Number of Components

A scree plot shows variance explained, or eigenvalue size, on the vertical axis and component number on the horizontal axis. It is the standard tool for deciding how many components to keep.

The plot usually falls steeply and then flattens. The point where the curve bends, the elbow, is a common stopping rule. In the worked example the drop from 1.844 to 0.156 is dramatic, so one component would be a defensible choice. A second rule keeps components with eigenvalues greater than 1, which for standardized data means keeping components that explain more variance than a single original variable. A third rule keeps enough components to reach a target cumulative variance, often in the 70 to 95 percent range depending on how much noise the data contain.

None of these rules is a law. They are heuristics, and choosing the number of components is a judgment call that should be reported and, ideally, tested for sensitivity. A pipeline that reports how the downstream result changes when you keep three versus five versus ten components is more persuasive than one that silently picks a number.

## PCA in R

R has two common routes: base `prcomp()` and the `factoextra` package for plotting. The example below uses the same six-sample dataset.

```r
df <- data.frame(
  GeneA = c(1, 2, 3, 4, 5, 6),
  GeneB = c(3, 7, 6, 9, 8, 9)
)

pca_fit <- prcomp(df, center = TRUE, scale. = TRUE)
summary(pca_fit)
pca_fit$rotation
pca_fit$x
```

`summary(pca_fit)` returns the standard deviation, proportion of variance and cumulative proportion for each component. `pca_fit$rotation` holds the loadings, with variables in rows and components in columns. `pca_fit$x` holds the scores. The `scale.` argument, complete with the trailing dot, is what standardizes the columns. Leaving it out is one of the most common silent errors in R-based PCA.

For plots, `factoextra` provides a consistent set of helpers:

```r
library(factoextra)
fviz_eig(pca_fit, addlabels = TRUE)     # scree plot
fviz_pca_ind(pca_fit)                    # scores plot
fviz_pca_var(pca_fit)                    # loadings plot
fviz_pca_biplot(pca_fit)                 # biplot
```

Base R also has `biplot(pca_fit)`, which is adequate for quick checks. `FactoMineR::PCA()` is a third option, and it adds features such as supplementary individuals and variables.

## PCA in Python

In Python, the standard route is scikit-learn. Standardization is a separate step, and this is the main practical difference from R.

```python
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA

df = pd.DataFrame({"GeneA": [1, 2, 3, 4, 5, 6],
                   "GeneB": [3, 7, 6, 9, 8, 9]})

X = StandardScaler().fit_transform(df)
pca = PCA(n_components=2)
scores = pca.fit_transform(X)

print(np.round(pca.explained_variance_ratio_, 3))
print(np.round(pca.components_, 3))
```

`explained_variance_ratio_` returns the variance fraction per component, here approximately 0.922 and 0.078. `components_` holds the loadings with components in rows and variables in columns, which is the transpose of R's `rotation`. The sign of a component is arbitrary and can differ between the two languages, or between two runs of the same code after a change in numerical libraries. A component and its negative are equally valid, so compare the pattern of loadings rather than their absolute signs.

Setting `n_components` to a float between 0 and 1, for example `PCA(n_components=0.95)`, tells scikit-learn to retain enough components to reach that fraction of explained variance. For large single-cell or genotype matrices, `TruncatedSVD` is a faster alternative when the data are sparse, and it is the approach used by the DAPCy implementation of discriminant analysis of principal components [4].

## Where PCA Is Used in Life Science

PCA turns up in nearly every quantitative corner of biology, but the purpose is not always the same. Four broad uses cover most cases.

### Visualization and Quality Control

The simplest use is to compress a wide table into two or three axes and look at it. RNA-seq pipelines plot samples in PC1 and PC2 space to reveal batch effects, outliers and unexpected groupings before differential expression begins [2]. The same logic applies to proteomics, metabolomics and single-cell data.

### Removing Redundancy Before Modeling

Clinical datasets often contain a dozen correlated measurements of the same underlying process. A tutorial on PCA in clinical research points out that correlated independent variables create multicollinearity in regression, and that replacing them with a few uncorrelated components solves the problem while reducing dimensionality [1]. A dental research tutorial makes the same case for implant studies, where many clinical variables must be condensed into a manageable number before analysis [5].

### Discovering Latent Structure

In population genetics, PCA of genotype data is routine for inferring ancestry and for controlling population structure in association studies. A best-practice toolkit documents the pitfalls: components can capture linkage disequilibrium structure rather than ancestry, projected samples suffer from shrinkage bias, and uneven population sizes distort the picture. In the UK Biobank, components 19 through 40 were found to capture complex linkage disequilibrium structure rather than population structure, and the authors recommend using only 16 to 18 components to account for confounding [6].

In single-cell RNA-seq, PCA is the default first reduction step before clustering. A random matrix theory approach addresses a known weakness, the bias of PCA in high dimensions, by guiding sparse principal components with a data-driven criterion, and it improves reconstruction of the principal subspace across seven sequencing technologies [7]. A related method ranks genes for downstream clustering by using the PCA rotations themselves as a variability score, avoiding the arbitrary mean-to-variance cutoffs used in conventional highly variable gene selection [8].

### Separating Overlapping Signals in Time

Temporal PCA is widely used on event-related potentials, where the observed waveform is a mixture of latent components and the analysis windows are otherwise chosen by hand. A developmental tutorial explains that the component structure itself can differ between age groups, a problem called measurement non-invariance, and shows how separate PCAs per group can be rescaled to original units so that results remain comparable and testable [9]. A companion tutorial extends the approach to time-frequency representations of EEG, reducing data without strong prior assumptions about timing or frequency boundaries [10]. Pupillometry researchers make a similar argument: the underlying physiological processes begin hundreds of milliseconds before an observable change, and dimensionality reduction recovers a low-dimensional pupillary manifold that captures them [11].

### Beyond These Four Uses

The range is broad. Molecular dynamics tutorials use PCA to extract collective variables that describe slow motions in protein trajectories, and pair it with time-lagged independent component analysis for slow, time-dependent structure [12]. Structural biologists have built a PCA framework for NMR chemical shift perturbation data that standardizes shifts with z-scores and filters stochastic noise to identify binding hotspots [13]. Statistical shape analysis uses PCA on covariance structures to describe variation in leaf outlines, arteries, brain tumors and vertebrae [14]. Agronomists use PCA alongside structural equation modeling to prioritize heat tolerance traits in wheat, with the first two components explaining 53.1 percent and 56.3 percent of total variance in the two study years [15]. Environmental scientists used PCA on the insoluble elemental fraction of particulate matter to identify which green wall species retained traffic-derived particles most consistently [16].

## How PCA Is Checked and Reported in Practice

A PCA result is only as good as its documentation. Reviewers and collaborators need enough detail to reproduce the axes, because a PCA computed on scaled data and a PCA computed on raw data can tell different stories.

Report the preprocessing. State whether columns were centered only or centered and scaled, how missing values were handled, and whether any samples were removed before the analysis. State the software and version.

Report the variance explained by each retained component. A PCA plot without axis percentages is hard to interpret, because a 40 percent axis and a 4 percent axis look identical on screen.

Report the loadings for the components you interpret. The claim "PC1 separates responders from non-responders" is incomplete without the loadings that show which variables drive PC1.

Check sensitivity. Rerun the analysis without the most extreme sample, or with a different scaling choice, and see whether the main pattern survives. For predictive models, fit the scaler and the PCA on the training fold only, then apply that same transformation to the test fold. Fitting on the full dataset before splitting leaks information and inflates apparent performance.

For inference rather than exploration, rescale components back to original units. The developmental ERP tutorial shows why this matters, since separate PCAs per age group produce components that are not directly comparable until they are expressed in the original measurement scale [9]. The same tutorial warns that data-driven analysis decisions, such as choosing windows or components after looking at the data, can inflate false positive rates unless the procedure accounts for them.

## Common Myths and Misconceptions Students Hold

**Myth 1: PCA is a clustering method.** PCA does not assign samples to groups. It rotates axes. Clustering is a separate step, and points that look separated on a PCA plot may not form distinct clusters under any formal test.

**Myth 2: PC1 always represents the biology of interest.** PC1 represents the largest source of variance, which may be batch, library size, sex, age or a technical artifact. In the UK Biobank example, high-numbered components captured linkage disequilibrium rather than ancestry, which is the opposite of the usual assumption that early components are the meaningful ones [6].

**Myth 3: Principal components are real measured quantities.** A component is a weighted sum chosen by an algorithm. The weights are not unique in sign, and they can shift when samples or variables are added. Treat components as summaries, not as new biomarkers, until they are validated.

**Myth 4: PCA finds nonlinear structure.** PCA is a linear method. A Swiss-roll-shaped dataset can have uninformative principal components even though its structure is obvious to the eye. Methods such as time-lagged independent component analysis and autoencoder-based approaches exist because linear projection misses slow, curved manifolds [12].

**Myth 5: A clean separation on a PCA plot is a statistical result.** It is a visualization. Group differences need a test, and the test should account for how the components were chosen.

**Myth 6: More components always means more information.** Components beyond the signal rank mostly capture noise. Retaining 50 components from 80 samples may describe the training data beautifully and generalize poorly.

## Common Mistakes and Limitations

**Forgetting to scale when units differ.** A variable ranging from 0 to 100,000 will dominate a variable ranging from 0 to 10. Standardize, or justify not standardizing.

**Scaling when it destroys meaningful variance.** If all variables are log-expression values from the same platform, scaling gives low-variance genes as much weight as high-variance ones, which can amplify noise. The right choice depends on the question.

**Letting one outlier define PC1.** A single extreme sample can pull the first axis toward itself. Inspect the data before and after removing suspicious samples.

**Assuming PCA handles missing data.** It does not. You must impute, drop, or use a method designed for incomplete matrices, and the choice affects the axes.

**Interpreting loadings as correlations without checking the scaling.** Software conventions differ. Verify before you quote a number as a correlation.

**Using all components in a downstream regression.** If you keep every component, you have not reduced anything, and you have lost the interpretability of the original variables.

**Data leakage in cross-validation.** Fitting the scaler or the PCA on the full dataset before splitting inflates performance. Fit inside the training fold.

**Ignoring high-dimensional bias.** When variables greatly outnumber samples, the leading components can reflect noise structure. A random matrix theory framework was developed specifically to address this bias in single-cell data [7].

**Ignoring linkage disequilibrium in genetic PCA.** Components may capture correlation between nearby markers rather than ancestry, a documented problem with practical solutions [6].

**Ignoring projection shrinkage.** When new samples are projected onto components computed from a reference panel, the projected coordinates are biased toward the origin, which distorts ancestry inference for samples unlike the reference [6].

**Ignoring group differences in component structure.** In developmental work, the same electrode or time window can load differently in children and adults, so a single pooled PCA may blur real effects, and separate analyses need rescaling before comparison [9].

**Treating PCA output as a hypothesis test.** PCA is exploratory. Confirmatory claims need an independent dataset or a properly designed inferential procedure. For applied projects where decisions depend on the result, have a statistician review the design before the final analysis.

## Quick Review

1. PCA rotates a data table onto new, orthogonal axes ordered by how much variance they explain.
2. Scores are sample coordinates, loadings are variable weights, and eigenvalues are the variances attached to each component.
3. Standardize when variables have different units, and document that choice.
4. A scree plot, the eigenvalue-above-1 rule and a cumulative variance target are heuristics, not laws.
5. A PCA plot is exploratory, so a visible separation is not proof of a statistical difference.
6. Biplot arrow angles carry correlation information only under the scaling convention that preserves it.
7. Report preprocessing, variance explained, loadings and sensitivity checks so the analysis can be reproduced.

## Frequently Asked Questions

### What is PCA in simple terms?

PCA is a way of summarizing a wide table of correlated measurements with a few new variables, called components, that capture most of the variation. The first component is the direction in which the data vary the most, and each later component is perpendicular to the ones before it.

### Does PCA require normally distributed data?

No. The rotation itself is a linear transformation and does not assume normality. Normality matters for some downstream tests and for some interpretations, but the components can be computed from any numeric matrix.

### What is the difference between PCA and clustering?

PCA reduces and rotates variables, while clustering groups samples. PCA does not assign labels or decide how many groups exist, and clusters visible on a PCA plot still need a formal clustering method and validation.

### How many principal components should I keep?

It depends on the purpose. Two or three suit visualization, while modeling often uses the elbow of the scree plot, eigenvalues above 1, or a cumulative variance target such as 70 to 95 percent. Report the rule you used and test how much the conclusion depends on it.

### Can principal component scores be negative?

Yes. Scores are coordinates relative to the mean of the data, so values on either side of zero are expected. A negative score simply means a sample lies on the opposite side of the component from samples with positive scores.

### What is the difference between PCA loadings and scores?

Scores describe samples and loadings describe variables. A score is where a sample sits on a component, and a loading is how strongly an original variable contributes to that component.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is PCA in simple terms?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "PCA is a way of summarizing a wide table of correlated measurements with a few new variables, called components, that capture most of the variation. The first component is the direction in which the data vary the most, and each later component is perpendicular to the ones before it."
      }
    },
    {
      "@type": "Question",
      "name": "Does PCA require normally distributed data?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "No. The rotation itself is a linear transformation and does not assume normality. Normality matters for some downstream tests and for some interpretations, but the components can be computed from any numeric matrix."
      }
    },
    {
      "@type": "Question",
      "name": "What is the difference between PCA and clustering?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "PCA reduces and rotates variables, while clustering groups samples. PCA does not assign labels or decide how many groups exist, and clusters visible on a PCA plot still need a formal clustering method and validation."
      }
    },
    {
      "@type": "Question",
      "name": "How many principal components should I keep?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "It depends on the purpose. Two or three suit visualization, while modeling often uses the elbow of the scree plot, eigenvalues above 1, or a cumulative variance target such as 70 to 95 percent. Report the rule you used and test how much the conclusion depends on it."
      }
    },
    {
      "@type": "Question",
      "name": "Can principal component scores be negative?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. Scores are coordinates relative to the mean of the data, so values on either side of zero are expected. A negative score simply means a sample lies on the opposite side of the component from samples with positive scores."
      }
    },
    {
      "@type": "Question",
      "name": "What is the difference between PCA loadings and scores?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Scores describe samples and loadings describe variables. A score is where a sample sits on a component, and a loading is how strongly an original variable contributes to that component."
      }
    }
  ]
}
</script>

## Sources

1. [Principal components analysis in clinical studies.](https://pubmed.ncbi.nlm.nih.gov/28936445/)
2. [An open RNA-Seq data analysis pipeline tutorial with an example of reprocessing data from a recent Zika virus study.](https://pubmed.ncbi.nlm.nih.gov/27583132/)
3. [High-throughput single cell data analysis - A tutorial.](https://pubmed.ncbi.nlm.nih.gov/34711307/)
4. [DAPCy: a Python package for the discriminant analysis of principal components method for population genetic analyses.](https://pubmed.ncbi.nlm.nih.gov/40630499/)
5. [Principal Component Analysis in Dental Research.](https://pubmed.ncbi.nlm.nih.gov/39928897/)
6. [Efficient toolkit implementing best practices for principal component analysis of population genetic data.](https://pubmed.ncbi.nlm.nih.gov/32415959/)
7. [Random Matrix Theory-Guided Sparse Principal Component Analysis for Single-Cell RNA-Seq Data.](https://pubmed.ncbi.nlm.nih.gov/42842483/)
8. [Principal Genes: A PCA-based approach to highly variable genes selection for scRNA-Seq analysis.](https://pubmed.ncbi.nlm.nih.gov/42845314/)
9. [A tutorial on the use of temporal principal component analysis in developmental ERP research - Opportunities and challenges.](https://pubmed.ncbi.nlm.nih.gov/35123341/)
10. [A practical introduction to EEG Time-Frequency Principal Components Analysis (TF-PCA).](https://pubmed.ncbi.nlm.nih.gov/35636345/)
11. [Dimensionality reduction techniques in pupillometry research: A primer for behavioral scientists.](https://pubmed.ncbi.nlm.nih.gov/41214224/)
12. [A Tutorial on Dimensionality Reduction and Clustering for Molecular Dynamics Trajectories: From Linear Algorithms to Deep Learning.](https://pubmed.ncbi.nlm.nih.gov/42454650/)
13. [Principal Component Analysis Based Deconvolution of NMR Chemical Shifts for Objective Biomolecular Interaction Mapping.](https://pubmed.ncbi.nlm.nih.gov/42915229/)
14. [Elastic Statistical Shape Analysis of Biological Structures with Case Studies: A Tutorial.](https://pubmed.ncbi.nlm.nih.gov/31069599/)
15. [Trait prioritization and genotype selection for heat stress tolerance in wheat via structural equation modeling and principal component analysis (PCA).](https://pubmed.ncbi.nlm.nih.gov/42369750/)
16. [Urban Green Walls under Traffic Stress: Linking the Elemental Composition of Particulate Matter Deposition to Plant Physiological and Gene Expression Responses.](https://pubmed.ncbi.nlm.nih.gov/42916451/)

## Related Articles

- [Eigenvalues and Eigenvectors: Definition and Examples](/blog/data-analysis/eigenvalues-eigenvectors-definition-examples)
- [What Is Correlation? Definition, Formula and Examples](/blog/data-analysis/what-is-correlation)
- [R vs Python: Differences and When to Use Each](/blog/data-analysis/r-vs-python-data-analysis)
- [What Is Biostatistics? Methods, Examples and Careers](/blog/data-analysis/what-is-biostatistics)
- [What Are SHAP Values? Definition and Examples](/blog/data-analysis/shap-values-explained)