SPSS command: SPSS TREE

CHAID and CRT decision trees in your browser

A decision tree splits cases into segments that differ as much as possible on a target, one predictor at a time.

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

What it tells you

Crosstabs runs the SPSS TREE procedure with three growing methods: CHAID and Exhaustive CHAID, which make multiway splits backed by Bonferroni-adjusted tests, CRT, which makes binary splits by impurity reduction and can be pruned, and QUEST, which picks the split variable with ANOVA F, chi-square and Levene tests and places binary splits by quadratic discriminant analysis.

  • Which predictor separates the target best at each step, and which categories or value ranges belong together (the split values on every branch).
  • The profile of every node: the target distribution or mean, its size and the predicted category.
  • Which terminal nodes concentrate the target category, through Gain %, Response % and Index % in the gains table.
  • How often the tree misclassifies cases, by resubstitution and, optionally, V-fold cross-validation.
  • For CRT, how important each predictor is, counting both primary and surrogate splits.

When to use it

Use it when

  • Segmenting customers or respondents into rule-based groups you can describe in a sentence, such as Basic plan and under a year of tenure.
  • Screening many categorical and scale predictors for the few that matter, including their interactions, before building a regression model.
  • Targeting: ranking nodes by response rate to decide which segments to contact first.
  • Nominal, ordinal or scale targets: CHAID uses chi-square, likelihood-ratio or F tests, CRT uses Gini, twoing or least squares.

Use something else when

  • You need effect sizes with confidence intervals for each predictor: use binary or multinomial logistic regression.
  • The sample is small: with the default minimum of 100 cases per parent and 50 per child node, a few hundred cases may give only one or two splits.
  • You want groups without a target variable: that is cluster analysis (TwoStep, k-means or hierarchical).
  • You need custom misclassification costs or profits: the panel uses equal costs and empirical priors.

How to run it in Crosstabs

  1. 01

    Open the decision tree panel

    Open your file in the workspace, switch to Statistics mode and choose Decision tree (TREE) in the Classify group. The data stays in your browser.

  2. 02

    Set the dependent variable and its level

    Choose the Dependent variable and confirm its Measurement level (Nominal, Ordinal or Scale); the level decides which tests and impurity measures are offered.

  3. 03

    Tick the independent variables

    Tick the Independent variables and set each one's measurement level in the dropdown beside it. Scale predictors are binned for CHAID and split at thresholds for CRT.

  4. 04

    Pick the growing method and stopping rules

    Under Growing method and criteria choose CHAID, Exhaustive CHAID or CRT, then set Maximum tree depth (3 for CHAID, 5 for CRT by default) and the minimum cases in parent and child nodes.

  5. 05

    Tune the method-specific criteria

    For CHAID set the significance levels for splitting and merging and, for a nominal target, the Pearson or likelihood-ratio chi-square. For CRT pick the impurity measure and minimum change in improvement, and optionally tick Prune tree to avoid overfitting with a standard-error rule.

  6. 06

    Validate and run

    Tick Cross-validation risk estimate and choose the sample folds, pick the target category for gains, then run. A workspace weight can be used only after you declare it a frequency weight.

Worked example

Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.

Try with example data

Data

600 synthetic subscribers with a plan tier (Basic, Standard, Premium), tenure in months (1–48) and region. Churn was simulated to depend on plan and on a first-year effect; region is pure noise. A fixed seed makes every build identical. CHAID runs with the panel defaults (depth 3, parent 100, child 50, α = .05) and 10-fold cross-validation.

Tree Table
NodeYes %NPredicted CategoryParent NodePrimary Independent VariableAdj. P-valueSplit Values
033.2600No
132.7199No0plan<.001Standard
250.5188Yes0plan<.001Basic
318.3213No0plan<.001Premium
452.559Yes1tenure<.001≤ 4; (4, 9]; (9, 14]
524.3140No1tenure<.001(14, 17]; (17, 23]; (23, 28]; (28, 33]; (33, 38]; (38, 43]; > 43
668.554Yes2tenure.033≤ 4; (4, 9]; (9, 14]
750.679Yes2tenure.033(14, 17]; (17, 23]; (23, 28]; (28, 33]
832.755No2tenure.033(33, 38]; (38, 43]; > 43

Adjusted p-values use the Bonferroni method.

Gains for Nodes — Target Category: Yes
NodeNNode %Gain %Response %Index %Cumulative Gain %
6549.018.668.5206.618.6
4599.815.652.5158.434.2
77913.220.150.6152.754.3
8559.29.032.798.763.3
514023.317.124.373.280.4
321335.519.618.355.2100.0

Terminal nodes are sorted by response, highest first.

Risk
MethodEstimateStd. Error
Resubstitution0.2920.019
Cross-Validation0.3450.019

Risk is the proportion of cases misclassified (equal costs, empirical priors).

Classification
ObservedNoYesPercent Correct
No3178479.1
Yes9110854.3
Overall Percentage68.0%32.0%70.8

How to read it

CHAID split the 600 cases first by plan (adjusted p < .001) and ended with 6 terminal nodes at depth 2; the noise variable region never entered the tree. The best node, 6, holds 9.0% of cases with a churn rate of 68.5% (index 206.6%). The tree misclassifies 29.2% of the cases it was grown on and 34.5% under 10-fold cross-validation. A pruned CRT tree on the same data has 3 terminal nodes and a cross-validated risk of 31.7%.

Output tables explained

Model Summary
Growing method, the independent variables that actually entered the tree, number of nodes and terminal nodes, depth and cases used, with a note on excluded cases.
Tree diagram
An interactive tree: each node shows its distribution or mean and N, each branch the predictor and split values; click a node to collapse its branch.
Tree Table
One row per node with the category percentages (or mean and standard deviation), N, predicted category, parent node, splitting variable, the CHAID statistic with its Bonferroni-adjusted p value or the CRT improvement, and the split values.
Gains for Nodes
Terminal nodes sorted by response: Gain % is the share of all target cases a node captures, Response % the rate inside it and Index % that rate relative to the whole sample; cumulative columns build the gains chart. A scale target gives the Gain Summary for Nodes by mean.
Risk
The misclassification rate (or within-node variance for a scale target) with its standard error, by resubstitution and by cross-validation. A large gap between the two signals overfitting.
Classification
Observed by predicted categories with percent correct per row and overall; CRT trees add Independent Variable Importance and, when pruned, the Cost-Complexity Pruning Sequence.

Assumptions and notes

  • Trees make no distributional assumptions, but CHAID's tests treat cases as independent; repeated rows from the same person overstate significance.
  • Measurement levels matter: a nominal predictor can merge any categories, while an ordinal or binned scale predictor merges only adjacent ones.
  • Cases need a valid target and at least one valid predictor. CHAID keeps missing predictor values as their own category; CRT routes them with surrogate splits.
  • Risk uses equal misclassification costs and priors estimated from the sample.

How the results are validated

CHAID and Exhaustive CHAID are checked node by node against the R package chaidr 0.1.0 (R 4.6.1) on a 1,200-case synthetic market dataset — nominal, ordinal and scale targets, the likelihood-ratio statistic, frequency weights and a deeper tree — with identical node sizes and merged categories, and adjusted p values and statistics within a relative 1e-6; 10-fold cross-validated risk matches chaidr to 12 decimals, and the root split agrees with the R-Forge CHAID package 0.1.2. CRT matches rpart 4.1.27 on Gini and least-squares trees and surrogate routing, a brute-force search for Gini, twoing and least-squares splits to 12 decimals, and the manual's cost-complexity pruning sequence. Validation evidence

Questions

Should I use CHAID or CRT?

CHAID gives wide, readable trees with multiway splits and a significance test at each split, which suits segmentation. CRT makes binary splits, handles missing values with surrogates and can be pruned by cost-complexity, which suits prediction. Compare their cross-validated risk on your data.

What is the difference between CHAID and Exhaustive CHAID?

Exhaustive CHAID keeps merging categories until two remain and then picks the best grouping, so it searches more thoroughly and has no separate merging significance level. It is slower and usually gives similar trees.

Why did my tree not split at all?

Usually the stopping rules: the parent node needs at least 100 cases and each child 50 by default. Lower the minimum cases in parent and child nodes for small files, or raise the significance level for splitting.

How do I read the gains table?

Pick the category you want to find as the target category for gains. A node with Index % of 200 has twice the overall response rate; Cumulative Gain % tells you what share of all target cases you reach by taking the top nodes.

Can I use weighted data?

Yes, if the workspace weight holds whole-number counts and you declare it a frequency weight. Sampling weights need a design-based analysis, so the tree is not grown with them.

Run Decision Tree (CHAID, CRT) 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.