SPSS command: SPSS WLS

Weighted least squares and weight estimation

When the spread of the residuals grows with a variable — spending varies more among high earners, errors are larger for bigger firms — ordinary least squares gives too much say to the noisiest cases.

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

What it tells you

Crosstabs runs the SPSS WLS (Weight Estimation) procedure on your device: it weights each case by 1 / source^power and searches a range of powers for the one with the highest log-likelihood, or uses a weight variable you supply.

  • Which power of the weight-source variable best describes how the error variance changes (Log-likelihood Values, with the maximum marked).
  • Regression coefficients, standard errors and t tests that are efficient under the estimated variance pattern.
  • Weighted R², adjusted R², the standard error of the estimate and the ANOVA F test.

When to use it

Use it when

  • A residual plot fans out as a predictor (or the size of the unit) increases.
  • Each row is an average of a different number of observations, so its precision is known: use the weight variable directly.
  • You want SPSS-style power estimation rather than guessing a weight such as 1/x or 1/x².

Use something else when

  • You only need valid standard errors and are content with OLS coefficients: heteroscedasticity-robust standard errors in linear regression are simpler.
  • The weights are survey design weights: these describe sampling, not error variance; use a complex-samples analysis.
  • The outcome is a count or a positive skewed amount whose variance follows the mean: a GENLIN model with the matching distribution handles this directly.

How to run it in Crosstabs

  1. 01

    Choose Weight estimation

    Open your data in Statistics mode and, in the Regression group, pick Weight estimation (WLS).

  2. 02

    Set the variables

    Choose the Dependent variable, the Weight variable (the source of the variance pattern, often a predictor) and tick Independent variables.

  3. 03

    Pick the weighting

    Under Weights set Weighting to 1 / weight variable ^ power (estimate power), or Use the weight variable as the weight when it already holds precision weights.

  4. 04

    Set the power range

    For power estimation set Power range: from, to and by (default −2 to 2 by 0.5; at most 200 steps).

  5. 05

    Run

    Keep Include constant in equation ticked unless the line must pass through the origin, and click Run. Cases with a zero, negative or missing weight source are excluded.

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

60 synthetic households with income from 20 to 120 (thousand); spend = 5 + 0.3·income plus noise whose standard deviation is proportional to income, so the variance grows with income squared (fixed seed). Weight variable = income, Weighting = 1 / weight variable ^ power, Power range from 0 to 3 by 0.5.

Log-likelihood Values
PowerLog-likelihood
0.000−188.734
0.500−184.916
1.000−182.052
1.500−180.299
2.000−179.812
2.500−180.719
3.000−183.082

The corresponding power is selected for further analysis because it maximizes the log-likelihood function. Selected power: 2.0.

Model Summary
RR SquareAdjusted R SquareStd. Error of the EstimateLog-likelihood Function Value
0.8320.6930.6880.084−179.812

Weighted least squares regression - weighted by 1 / income ** 2.

Coefficients
ItemBStd. ErrorBetatSig.
(Constant)4.0711.3043.122.003
income0.3070.0270.83211.442<.001

How to read it

The log-likelihood rises from −188.73 at power 0 (ordinary least squares) to a maximum of −179.81 at power 2.0, so the weights are 1 / income^2.0 — matching how the noise was generated. With those weights the slope is 0.307 (SE 0.0269, t = 11.44), close to the true 0.3, and the weighted R² is 0.693.

Output tables explained

Log-likelihood Values
The log-likelihood for every power in the range; the power that maximizes it is marked and used for the rest of the output.
Model Summary
Multiple R, R Square, Adjusted R Square, Std. Error of the Estimate and the log-likelihood of the chosen weighting; a footnote states the weights used.
ANOVA
Weighted regression and residual sums of squares with the F test of all predictors.
Coefficients
Unstandardized B with standard error, standardized Beta, t and significance under the chosen weights.

Assumptions and notes

  • The error variance is proportional to a power of the weight-source variable (or to the reciprocal of the supplied weight).
  • Apart from the variance pattern, the usual linear-regression assumptions hold: linearity, independence and roughly normal errors.
  • The weight source must be positive for every case used; the workspace frequency weight, if any, is separate and must be declared as a frequency weight.

How the results are validated

WLS is checked against statsmodels WLS and the SPSS WLS log-likelihood formula: every log-likelihood in the power grid agrees within 1e-9, the selected power matches exactly, coefficients and R² within 1e-9, standard errors and F within 1e-8. The weight-variable mode is tested the same way. Validation evidence

Questions

What does the selected power mean?

Power p means the error variance grows with source^p, so each case is weighted by 1/source^p. Power 0 is ordinary least squares, 1 means variance proportional to the source, 2 means standard deviation proportional to it.

Is the weight variable the same as the workspace weight?

No. The Weight variable in this panel defines precision weights for the regression. A workspace weight is a separate case weight and is only accepted when declared as a frequency weight.

Why is the weighted R² lower than the OLS R²?

Weighted R² is measured on the weighted scale, where the large-variance cases that drove the OLS fit count for less. The two are not comparable; judge the models by the log-likelihood instead.

The maximum is at the edge of my power range. What now?

Widen the range in that direction and run again; the true maximum may lie outside the grid you searched.

Run Weight Estimation (WLS) 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.