SPSS command: SPSS LINEAR

Bagging and boosting linear models in your browser

Ensembles combine many models to make predictions more stable (bagging) or more accurate (boosting).

Free · No account · Files stay on your device · Updated 18 October 2026

What it tells you

Crosstabs runs the SPSS ensemble algorithms for linear models on your device and reports how the ensemble compares with a single linear model and with the mean.

  • The R² of the ensemble, of a single reference linear model and of the naive mean model.
  • The accuracy of every component model and, for boosting, its model weight.
  • For bagging, the diversity of the component predictions.

When to use it

Use it when

  • A linear model's coefficients shift a lot from sample to sample and you want steadier predictions.
  • You want to see whether reweighting hard-to-predict cases improves on a single linear model.

Use something else when

  • You need interpretable coefficients: use linear regression or automatic linear modeling.
  • Your target is categorical: these ensembles are for continuous targets.

How to run it in Crosstabs

  1. 01

    Open your data

    Open a .sav, CSV or Excel file in the workspace and switch to Statistics mode. The file is read in your browser and never uploaded.

  2. 02

    Choose Ensembles of linear models

    In the Regression group, pick Ensembles of linear models.

  3. 03

    Pick the target and predictors

    Choose the Target (continuous) and tick Continuous predictors and Categorical predictors.

  4. 04

    Choose the ensemble

    Set Method to Bagging or Boosting and the Number of component models; for bagging choose the Combining rule and the Random seed.

  5. 05

    Run and download

    Click Run, compare the accuracies, and download the ensemble predictions as CSV.

Output tables explained

Model Quality
R² of the ensemble, the reference model and the naive model on the training data, and the diversity for bagging.
Component Model Accuracy
Each component model's R², with its bootstrap sample size (bagging) or model weight (boosting).

Assumptions and notes

  • Each component is a least-squares linear model on all predictors; categorical predictors are indicator-coded.
  • Accuracy is computed on the training data, as in SPSS; it is not a holdout estimate.

How the results are validated

An independent NumPy/scikit-learn implementation reproduces the seeded bootstrap samples exactly and the component, ensemble, reference and naive R², diversity, AdaBoost.R2 model weights and every prediction within 1e-9, with and without frequency weights. Validation evidence

Questions

Bagging or boosting?

Bagging averages models fitted to bootstrap samples and mainly reduces variance; boosting reweights poorly predicted cases and can reduce bias but may chase outliers.

Why is the ensemble no better than one model?

Linear models are stable, so averaging them changes little; ensembles help most with unstable models such as trees.

Can I reproduce a bagged result?

Yes. The bootstrap samples come from the seeded generator, so the same seed gives the same result.

Why can diversity be negative?

The panel uses the SPSS formula for continuous targets, an average cross-product of component errors relative to the total sum of squares; errors that move together make it negative.

Run Ensembles of Linear Models (bagging, boosting) on your own data

Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.

Open the workspace

SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.