Regression · Shrinkage

Principal Components Regression

Regress a continuous outcome on the top principal components of the predictors (component count chosen by cross-validation), with a variance-explained scree, a CV curve, and back-transformed coeffi...

In the menus Regression › Shrinkage › Principal Components Regression

Also searched as pcr principal component regression

When to use it

Predict a continuous outcome when the predictors are many and/or highly correlated: PCR compresses them into a few uncorrelated components first, stabilizing the fit against multicollinearity and p-near-n instability.

When not to: You need sparse feature selection (PCR keeps every predictor, blended into components; use lasso instead), prediction accuracy is the primary goal and PLS's outcome-aware components would likely need fewer components for the same performance, or you need classical p-values on individual coefficients, which this cross-validated approach does not provide.

Step by step

  1. Open it from the menu

    Click Regression in the menu bar; under Shrinkage choose Principal Components Regression.

  2. Fill in the form

    Choose the columns: What you want to predict or explain, Columns that may explain it. The form lists only columns whose type fits each field.

  3. Check the options

    The options start at their defaults: Number of components, CV folds. Change one only when your question needs it.

  4. Run the analysis

    Press Run analysis. The Result Card opens on its Results tab.

What to choose in the form

Fields of the Principal Components Regression form
What you want to predict or explain Response requiredOne numeric column. Continuous outcome variable (Y / dependent).
Columns that may explain it Predictors requiredOne numeric column. Two or more numeric predictor columns (X).
Number of componentsComponents to keep. 0 = choose automatically by cross-validated RMSE. Default: 0.
CV foldsFolds for the cross-validation curve (seeded, auto-reduced if there are too few rows). Default: 5.

How to read the card

The Results tab starts with what to know first (rows left out, checks that did not pass), then the interpretation in words and the Key Results; charts and assumption checks follow further down. Learn More explains the method in plain words. Read a Result Card covers all four tabs.

What it assumes

No (severe) multicollinearity

If it does not hold: If the retained components still leave much of the original correlation structure unaddressed, correlated predictors can still destabilize the reconstructed coefficients on the original scale.

How to check: Checked directly: the number of orthogonal components retained is reported, and the card flags the degenerate case where every component was kept (all p of them), in which case PCR is numerically identical to ordinary least squares and provides no protection against collinearity at all.

A worked example

Predicting penguin body mass from three correlated measurements (bill length, bill depth, flipper length), with the component count chosen by 5-fold cross-validation (seed 42).

Result: The components explain 66.8%, 25.6% and 7.7% of predictor variance, but cross-validated RMSE is 475 g with one component, 471 g with two and 392 g with all three, so cross-validation keeps all three; R-squared = 0.76 and the back-transformed flipper-length coefficient is +50.3 g per mm. The card flags 'Dimension reduction active' as failed: with every component kept, PCR equals ordinary least squares.

The smallest component, carrying under 8% of the predictors' variance, is the one that predicts body mass best, a live demonstration that PCA ranks directions by predictor variance, blind to the outcome. Here PCR offers no compression; Partial Least Squares Regression, whose components are built with the outcome in view, or plain linear regression is the better choice.

From the Statistics Library.

The code tabs

Code gives this analysis as Python, R and MATLAB code (and SAS where the tab offers it), reading the data the way KernelStats did. Export sends the card to a report or to slides. See The Code tab.

Understand the statistics

Ask Oobi

Type one of these into Ask Oobi beside your data:

  • Using the correlated penguin bill and flipper measurements, how well can a two-component summary predict body mass?
  • Explain the principal components regression (PCR) in plain words.
  • What does no (severe) multicollinearity mean?

Last reviewed November 16, 2026.

Report an unclear step