SPSS command: SPSS NLR / CNLR

Nonlinear regression with your own formula

Nonlinear regression estimates the parameters of a model you write yourself — a saturation curve, an exponential decay, a Michaelis–Menten rate — by minimizing the sum of squared residuals.

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

What it tells you

Crosstabs runs SPSS NLR on your device with a safe formula parser, and its CNLR options add bounds on the parameters and bootstrap standard errors.

  • The best-fitting value of every parameter in your formula, with asymptotic standard errors and 95% confidence intervals.
  • How strongly the parameter estimates are correlated — a sign that the model is poorly identified by the data.
  • How much variation the model explains: the ANOVA table and R² = 1 − residual SS / corrected SS.
  • With CNLR, estimates that respect lower and upper bounds, and bootstrap standard errors and percentile intervals that do not rely on linearization.

When to use it

Use it when

  • Theory gives a specific nonlinear form, such as y = a·(1 − e^(−b·x)) for learning or y = a·x / (b + x) for saturation.
  • The parameters themselves (a ceiling, a half-life, a rate) are the quantities you want to report.
  • Parameters must stay in a meaningful range, such as a positive rate or a share between 0 and 1 (use the CNLR bounds).

Use something else when

  • The curve is one of the standard shapes in curve estimation, or becomes linear after a transformation: those fits are simpler and need no starting values.
  • The outcome is a count or a proportion of responders: use generalized linear models or probit analysis, which model the error distribution correctly.
  • You need linear or nonlinear constraints that combine several parameters: CNLR here supports simple per-parameter bounds only.

How to run it in Crosstabs

  1. 01

    Choose Nonlinear regression

    Open your data in Statistics mode and, in the Regression group, pick Nonlinear regression (NLR / CNLR).

  2. 02

    Pick the dependent variable

    Under Model choose the Dependent variable. It cannot appear in the formula.

  3. 03

    Declare parameters and starting values

    In Parameters and starting values type each parameter with a sensible start, for example a = 10, b = 0.5. Starts near the expected answer help convergence.

  4. 04

    Write the model expression

    In Model expression use + − * / ^, parentheses and exp, ln, log10, sqrt, abs, sin, cos, tan or atan, with variable names as in the data and [square brackets] around names with spaces.

  5. 05

    Add CNLR options and run

    Under Constraints and bootstrap (CNLR) tick Bound parameters to enter a lower and upper bound per parameter, or Bootstrap estimates of standard error with the Number of bootstrap samples (20–2000), then click Run.

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

30 synthetic learners with 0.5 to 21.5 hours of practice; score follows 85·(1 − e^(−0.18·hours)) plus normal noise (fixed seed). Model expression = a * (1 - exp(-b * hours)), Parameters and starting values = a = 80, b = 0.1.

Parameter Estimates
ParameterEstimateStd. ErrorLower BoundUpper Bound
a86.3931.23783.86088.926
b0.1810.0080.1640.198
ANOVA
SourceSum of SquaresdfMean Squares
Regression140981.706270490.853
Residual249.814288.922
Uncorrected Total141231.52030
Corrected Total15597.05529

Dependent variable: score. R squared = 1 - (Residual Sum of Squares) / (Corrected Sum of Squares) = 0.984.

How to read it

From the starting values a = 80 and b = 0.1 the fit converges to a ceiling of a = 86.39 points (95% CI 83.86 to 88.93) and a rate b = 0.181 per hour, so half the ceiling is reached after ln 2 / b = 3.82 hours. The residual mean square is 8.92 and R² = 1 − SSresidual / SScorrected = 0.984.

Output tables explained

Parameter Estimates
Estimate, asymptotic standard error and 95% confidence interval for each parameter; with bootstrap, also the bootstrap standard error and 95% percentile interval. A parameter that ends on a bound is fixed and has no asymptotic SE.
Correlations of Parameter Estimates
Correlations near ±1 mean two parameters trade off against each other and are hard to estimate separately.
ANOVA
Regression, residual, uncorrected total and corrected total sums of squares, with R² in the footnote. When the formula uses a single variable, a chart of the observed points and the fitted curve follows.

Assumptions and notes

  • The formula is the right shape for the data; nonlinear least squares cannot fix a misspecified model.
  • Errors are independent with constant variance; asymptotic standard errors rely on a linear approximation that can be poor in small samples — bootstrap helps.
  • The starting values lead to the global minimum; if the iterations stop early, try different starts.

How the results are validated

NLR and CNLR are checked against scipy.optimize (curve_fit and least_squares): estimates agree within 1e-8, standard errors within 1e-6 and the residual sum of squares within 1e-9; a frequency-weighted fit must equal the expanded-data fit, and a CNLR fit with an active upper bound holds that parameter exactly at the bound. Bootstrap standard errors are tested for reproducibility and for staying within 40% of the asymptotic values. Validation evidence

Questions

How do I choose starting values?

Read them off the data: a ceiling parameter near the largest Y, a rate near the reciprocal of the X range, an intercept near the Y at X = 0. Poor starts can lead to non-convergence or a local minimum.

Is the formula executed as code?

No. The expression is parsed into a formula tree that allows only arithmetic, the listed functions, parameters and variable names, and derivatives are computed symbolically from that tree.

When should I use bootstrap standard errors?

When the sample is small, the curve is strongly nonlinear near the estimates, or a confidence interval should not be symmetric. The panel resamples cases with a fixed seed, so the same data give the same bootstrap results.

What happens when a parameter hits a bound?

It is held at the bound, excluded from the covariance matrix, and shown without an asymptotic standard error; a warning notes that at least one parameter ended on a bound.

Run Nonlinear Regression 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.