SPSS command: SPSS CSGLM
Linear regression for complex survey data
Complex Samples GLM fits a linear model to a scale outcome from a weighted, stratified or clustered survey, with coefficients that describe the population and standard errors that respect the design.
Free · No account · Files stay on your device · Updated 18 October 2026
What it tells you
Crosstabs runs the SPSS CSGLM procedure on your device: weighted least-squares estimates, Taylor-linearized (Binder) standard errors, Fellegi's Wald F and Rao–Scott adjusted F tests on the design degrees of freedom, and design effects for every parameter.
- How much the outcome changes per unit of each covariate, and how factor levels differ from the last (reference) level, in the population.
- Whether each predictor matters overall, from a Wald F test of all its parameters on the design df.
- Whether the model as a whole explains anything, from the corrected-model test, and the weighted R².
- How much clustering and weighting change each coefficient's variance relative to simple random sampling (design effects).
When to use it
Use it when
- A scale outcome (spend, hours, a score) modelled on several predictors in survey data with strata, clusters and weights.
- Comparing group means after adjusting for covariates (ANCOVA) in a national or multi-stage survey.
- Checking whether a regression result from unweighted OLS still holds once the design is taken into account.
Use something else when
- A binary, nominal or ordinal outcome: use Complex Samples Logistic or Ordinal Regression.
- You need interaction terms, estimated marginal means or custom contrasts: this panel fits main effects only, with parameter tests.
- Data from a simple random sample with no weights: Linear Regression or GLM Univariate gives the same estimates with more diagnostics.
How to run it in Crosstabs
- 01
Open your survey file
Open the .sav, CSV or Excel file in the workspace and switch to Statistics mode. The file is read in your browser and is not uploaded.
- 02
Choose the procedure
In the Complex samples group, pick Complex Samples General Linear Model (CSGLM).
- 03
Check the saved sampling plan
The panel opens with a Sampling plan line showing the weight, strata, clusters and estimation. If no plan is saved for this dataset, open Sampling plan (CSPLAN) first. Plan variables are left out of the variable pickers, and the workspace weight is ignored: Complex Samples always use the plan's weight.
- 04
Specify the model
Choose the Dependent variable (scale), then tick Factors (categorical) and Covariates (numeric). Keep Include intercept ticked unless the model should pass through zero.
- 05
Set the confidence level and run
Choose the Confidence level (90%, 95% or 99%) and run. Cases missing any model variable are dropped listwise from the model but stay in the design.
Worked example
Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.
Data
A synthetic household survey of 120 respondents: three strata (Metro, Town, Rural), four primary sampling units (PSUs) per stratum and ten respondents per PSU, with a sampling weight that rises from about 35 in Metro to about 110 in Rural. Each PSU shares a random effect, so respondents in the same cluster resemble each other. The plan is weight + strata + clusters, with-replacement (WR) estimation; all values come from a fixed seed.
| Source | Wald F | df1 | df2 | Sig. | Adjusted F | Sig. (Adjusted F) |
|---|---|---|---|---|---|---|
| (Corrected Model) | 19.839 | 3 | 7 | <.001 | 23.794 | <.001 |
| (Intercept) | 17.841 | 1 | 9 | .002 | 17.841 | .002 |
| sex | 8.377 | 1 | 9 | .018 | 8.377 | .018 |
| age | 20.041 | 1 | 9 | .002 | 20.041 | .002 |
| hhsize | 73.472 | 1 | 9 | <.001 | 73.472 | <.001 |
Wald F is Fellegi's adjusted Wald F with (r, ν − r + 1) df; Adjusted F is the Rao–Scott second-order correction against the SRS covariance.
| Parameter | B | Std. Error | t | Sig. | Design Effect |
|---|---|---|---|---|---|
| (Intercept) | 78.711 | 18.635 | 4.224 | .002 | 2.363 |
| [sex=Female] | 19.627 | 6.781 | 2.894 | .018 | 1.175 |
| [sex=Male]ᵃ | 0 | ||||
| age | 0.928 | 0.207 | 4.477 | .002 | 1.095 |
| hhsize | 14.441 | 1.685 | 8.572 | <.001 | 0.605 |
a. Set to zero because this parameter is redundant (the last category is the reference). Standard errors by Taylor linearization of the weighted normal equations (Binder 1983); t tests on 9 design df.
How to read it
The model explains R² = 0.376 of the weighted variance in spend. Each extra year of age adds 0.93 (SE 0.21, p = .002), and women spend 19.63 more than men (p = .018; Wald F for sex = 8.38 on 1 and 9 df). Every test uses the 9 design degrees of freedom (12 PSUs − 3 strata), not the 120 cases, which is why the corrected-model Wald F has 7 denominator df. Each design effect compares a coefficient's design-based variance with simple random sampling of the same size: 1.10 for age, 0.60 for hhsize.
Output tables explained
- Model Summary
- Weighted R Square, the unweighted cases used and the estimated population size, with a footnote giving strata, PSUs and design df.
- Tests of Model Effects
- For the corrected model, the intercept and each predictor: Wald F with (r, ν − r + 1) df and its significance, the Wald chi-square, and the Rao–Scott Adjusted F with its own df.
- Parameter Estimates
- B, standard error, confidence interval, t, df, significance, design effect and its square root for every parameter; the last level of each factor is the redundant reference set to zero.
Assumptions and notes
- The saved plan describes how the sample was actually drawn: the right sampling weight, the stage-1 strata and the primary sampling units (PSUs). A wrong plan gives wrong standard errors, however good the model.
- Models contain main effects only (no interaction terms). Factors use SPSS-style coding with the last category as the redundant reference; cases missing any model variable are dropped listwise but stay in the design with zero contribution.
- Inference uses t and F distributions on the design degrees of freedom (PSUs minus strata). With few PSUs per stratum the df are small and intervals are wide; a stratum with a single PSU contributes no variance.
- The mean of the outcome is linear in the predictors. Design-based standard errors do not require constant variance or normal residuals, but they rely on enough PSUs per stratum.
How the results are validated
On a synthetic two-stage stratified survey (235 cases) under three designs, coefficients and standard errors for a model with two factors and a covariate match the R survey package's svyglm to a relative 1e-9, and the Wald chi-square for a factor matches R's. Design effects, R², Fellegi's Wald F and the Rao–Scott adjusted tests (including the corrected model) are checked against an independent NumPy/SciPy implementation of the SPSS formulas to 1e-8. Validation evidence
Questions
Why are the denominator df so small?
In a clustered design the information about variance comes from the PSUs, not the individual cases, so tests use the design df (PSUs minus strata). Fellegi's Wald F further uses ν − r + 1 denominator df for an r-parameter hypothesis.
Should I read Wald F or Adjusted F?
Wald F is the SPSS default and the usual choice. The Rao–Scott Adjusted F compares the estimates against the simple-random-sampling covariance corrected by the design effects; it can be more stable when the design df are small relative to the number of parameters tested.
Why do the coefficients match weighted least squares but not the standard errors?
The point estimates solve the weighted normal equations, so they equal a WLS fit with the sampling weights. The standard errors instead come from Taylor linearization over strata and PSUs (a sandwich estimator), which reflects clustering rather than treating weights as precision weights.
Can I add an interaction between two factors?
Not in this panel: it fits main effects only. To compare combinations, create a combined grouping variable (for example region × sex) in the data and use it as one factor.
Is my survey file uploaded?
No. The workspace reads the file and runs CSGLM in your browser, and the sampling plan is stored in this browser only. Nothing is sent to Crosstabs servers, and there is no account to create.
Related procedures
- Complex Samples PlanCSPLAN
- Complex Samples DescriptivesCSDESCRIPTIVES
- Complex Samples Logistic RegressionCSLOGISTIC
- Linear RegressionREGRESSION
- GLM UnivariateUNIANOVA
- Free SPSS alternative: full coverage list
Run Complex Samples General Linear Model 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.