SPSS command: SPSS DISCRIMINANT
Discriminant analysis in your browser
Discriminant analysis finds the linear combinations of numeric predictors that best separate known groups, then uses them to classify cases.
Free · No account · Files stay on your device · Updated 18 October 2026
What it tells you
Crosstabs runs SPSS DISCRIMINANT with direct or stepwise Wilks' lambda entry, Box's M, canonical function coefficients, Fisher's classification functions and both original and leave-one-out classification results.
- Whether the groups differ on the predictors at all, variable by variable and jointly through Wilks' lambda.
- How many discriminant functions matter and how much between-group variance each explains, with its canonical correlation.
- Which predictors drive each function, from standardized coefficients and the structure matrix.
- How accurately the functions classify cases, both on the fitted data and under leave-one-out cross-validation.
When to use it
Use it when
- A categorical outcome with known groups (repaid, late, default) and several continuous predictors measured on every case.
- Describing how groups differ in a low-dimensional space, for example placing segments found by a cluster analysis on two functions.
- Predictors that are roughly normal within groups, where LDA is efficient and its posterior probabilities are well calibrated.
Use something else when
- Categorical predictors or clearly non-normal ones: use multinomial or binary logistic regression.
- Group covariance matrices that differ strongly (Box's M significant in a large sample): the linear rule is no longer optimal, and quadratic classification is not offered.
- You only need a predictive classifier and do not care about the functions: k-nearest neighbors or a decision tree may fit better.
How to run it in Crosstabs
- 01
Open Discriminant analysis
In Statistics mode, choose Discriminant analysis (DISCRIMINANT) in the Classify group.
- 02
Set the grouping variable
Choose the Grouping variable; variables with 2 to 30 distinct values are offered, and value labels name the groups.
- 03
Tick the independents
Tick numeric predictors under Independents.
- 04
Choose the method and priors
Under Method pick Enter independents together or Use stepwise method (Wilks' lambda), which uses entry F 3.84, removal F 2.71 and tolerance 0.001. Set Prior probabilities to All groups equal or Compute from group sizes.
- 05
Run and read the classification
Run the analysis. If the workspace has a weight, declare it as a frequency weight first; sampling weights are not used.
Worked example
Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.
Data
90 synthetic loan applicants, 30 in each outcome group (Repaid, Late, Default), with income (thousands), debt-to-income ratio (%) and years employed drawn from normal distributions with group-specific means and a fixed seed. All three independents are entered together with equal prior probabilities (the panel defaults).
| Function | Eigenvalue | % of Variance | Cumulative % | Canonical Correlation |
|---|---|---|---|---|
| 1 | 2.273 | 99.6 | 99.6 | 0.833 |
| 2 | 0.010 | 0.4 | 100.0 | 0.098 |
| Test of Function(s) | Wilks' Lambda | Chi-square | df | Sig. |
|---|---|---|---|---|
| 1 through 2 | 0.303 | 102.805 | 6 | <.001 |
| 2 | 0.990 | 0.828 | 2 | .661 |
| Item | Function 1 | Function 2 |
|---|---|---|
| income | −0.494 | 0.872 |
| debt_ratio | 0.738 | 0.641 |
| years_employed | −0.381 | −0.046 |
Function signs are arbitrary; each is oriented so its largest standardized coefficient is positive.
| Item | Repaid | Late | Default | % correct |
|---|---|---|---|---|
| Original: Repaid | 28 | 2 | 0 | 93.3 |
| Original: Late | 7 | 13 | 10 | 43.3 |
| Original: Default | 0 | 6 | 24 | 80.0 |
| Cross-validated: Repaid | 27 | 3 | 0 | 90.0 |
| Cross-validated: Late | 9 | 11 | 10 | 36.7 |
| Cross-validated: Default | 0 | 6 | 24 | 80.0 |
72.2% of original and 68.9% of cross-validated (leave-one-out) grouped cases correctly classified.
How to read it
Function 1 carries 99.6% of the between-group variance (canonical correlation 0.833), and the test of functions 1 through 2 gives Wilks' λ = 0.303, p < .001. The second function is not significant (p = .661), so the outcomes are essentially ordered along one dimension. The functions classify 72.2% of applicants correctly, 68.9% under leave-one-out, against 33.3% by chance with equal priors. Box's M = 15.99 (p = .231) checks the equal-covariance assumption behind the linear rule.
Output tables explained
- Tests of Equality of Group Means
- Wilks' lambda and F for each predictor on its own, following Group Statistics with per-group means and standard deviations.
- Box's Test of Equality of Covariance Matrices
- Box's M with its F (or chi-square) approximation and the log determinants of each group and the pooled matrix. It is sensitive in large samples and to non-normality.
- Eigenvalues
- Each function's eigenvalue, % of variance, cumulative % and canonical correlation; there are at most one fewer functions than groups.
- Wilks' Lambda
- Tests functions 1 through m, then 2 through m and so on, with a chi-square and significance, to show how many functions are worth keeping.
- Standardized Canonical Discriminant Function Coefficients
- Weights on standardized predictors, comparable across variables; the Structure Matrix, unstandardized coefficients, Functions at Group Centroids, Prior Probabilities for Groups and Classification Function Coefficients follow.
- Classification Results
- Observed by predicted group counts and percentages with the percent correctly classified; Classification Results (Cross-validated) repeats it with each case classified by functions fitted without it.
Assumptions and notes
- Predictors are approximately multivariate normal within each group.
- Groups share a common covariance matrix (checked by Box's M); the classification rule uses the pooled within-groups matrix.
- No predictor is a linear combination of others: a singular within-groups matrix stops the analysis.
- Each group needs more cases than predictors; cases missing the group or any predictor are excluded listwise.
How the results are validated
DISCRIMINANT is checked against an independent NumPy/SciPy implementation of the SPSS algorithms (NumPy 2.5.4, SciPy 1.18.1, statsmodels 0.15.0) on Fisher's iris data with equal and size-based priors, a two-class wine subset and a frequency-weighted set: eigenvalues and univariate Wilks' lambda and F agree within 1e-9, coefficients, structure matrix, centroids, Fisher functions, posteriors and Box's M within 1e-8, with identical original and leave-one-out predictions. R's MASS 7.3.66 lda and biotools 4.3 boxM agree within 1e-7; stepwise selection matches brute-force determinant search and statsmodels MANOVA, and weights equal replicated rows. Validation evidence
Questions
What is the difference between standardized coefficients and the structure matrix?
Standardized coefficients are partial weights: each shows a predictor's unique contribution given the others. Structure correlations are simple correlations with the function and are steadier when predictors are correlated, so many analysts name functions from the structure matrix.
Why report the cross-validated classification?
The original table reuses the cases that built the functions, so it is optimistic. Leave-one-out classifies each case with functions fitted without it and is a fairer estimate of accuracy on new data.
Should priors be equal or based on group sizes?
Use group sizes when the sample proportions reflect the population, so common groups are predicted more often. Use equal priors when groups were sampled in fixed numbers or misclassifying each group matters equally.
Box's M is significant. Is my analysis invalid?
Not necessarily. Box's M is very sensitive with large samples and non-normal data. If group sizes are similar, LDA is fairly robust; compare its cross-validated accuracy with logistic regression before deciding.
Can I save discriminant scores or predicted groups to the dataset?
The panel reports the tables but does not add new variables. You can score new cases by hand from the Canonical Discriminant Function Coefficients or the Classification Function Coefficients.
Related procedures
- Multinomial Logistic RegressionNOMREG
- Binary Logistic RegressionLOGISTIC REGRESSION
- GLM Multivariate (MANOVA)GLM
- Nearest Neighbor Analysis (KNN)KNN
- K-Means ClusterQUICK CLUSTER
- Free SPSS alternative: full coverage list
Run Discriminant Analysis on your own data
Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.
SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.