SPSS command: SPSS CSSELECT

Draw a complex probability sample in your browser

Select a Complex Sample treats your dataset as a sampling frame and draws a probability sample from it: simple random, systematic or probability proportional to size (PPS), within strata and by clusters.

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

What it tells you

Crosstabs runs the SPSS CSSELECT procedure on your device with a seed, reports each selected case's inclusion probability and sampling weight, and offers the sample as a CSV download without changing your data.

  • Which units were selected in each stratum, and how many cases they contain.
  • Each selected case's inclusion probability and sampling weight (the inverse of the inclusion probability; N/n for with-replacement designs).
  • How many times each unit was hit, which can exceed 1 under with-replacement methods.

When to use it

Use it when

  • Planning fieldwork: drawing schools, villages, stores or households from a list, with strata to guarantee coverage of each region.
  • Selecting larger units with higher probability (PPS) using a size measure such as enrollment or population.
  • Teaching or simulating sampling designs reproducibly: the same seed always gives the same sample here.

Use something else when

  • You only need a random subset of cases: Random Sample of Cases is simpler.
  • A multi-stage selection in one run (PSUs, then units inside them): this panel draws a single stage; run it again on the selected clusters' list for a second stage.
  • You need to reproduce a specific SPSS-drawn sample: the random number stream differs, so a sample drawn here will differ from SPSS's even with the same seed.

How to run it in Crosstabs

  1. 01

    Open your survey file

    Open the sampling frame — one row per element, such as a school or household — as a .sav, CSV or Excel file and switch to Statistics mode. The frame stays in your browser.

  2. 02

    Choose the procedure

    In the Complex samples group, pick Select a Complex Sample (CSSELECT).

  3. 03

    Choose the method and units

    Under Method choose Simple random sampling without or with replacement, Systematic, PPS with replacement, PPS systematic or PPS without replacement (Sampford). Optionally set a Cluster (sampling unit, optional); PPS methods also need a Size measure that is constant within each unit.

  4. 04

    Set strata and sample size

    Tick Strata (optional). Under Sample size per stratum choose Number of units or Proportion of units and enter the value; it applies to every stratum.

  5. 05

    Draw and download

    Enter a Random seed, click Draw sample, then Download sample (CSV). The workspace dataset is not changed.

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

A synthetic sampling frame of 36 schools, 12 in each of three districts (North, Central, South); enrollment, drawn with a fixed seed between 80 and 900, is the size measure. CSSELECT draws 3 schools per district with probability proportional to enrollment, without replacement (Sampford's method), seed 20261017.

Stratum Summary
StratumPopulation unitsRequested sample unitsSelected cases
Central1233
North1233
South1233
Selected Cases (first 20)
CaseschoolenrollmentHitsInclusion probabilitySampling weight
1N0174010.294433.3964
3N0358010.230774.3333
8N0886010.342182.9225
17C0572010.362422.7593
18C0672010.362422.7593
22C1080010.402682.4833
31S0754010.290323.4444
33S0978010.419352.3846
36S1254010.290323.4444

The download adds SampleHits_ (times selected), InclusionProbability_ and SampleWeight_ (inverse inclusion probability; N/n for with-replacement designs) to every selected case.

How to read it

Seed 20261017 selected 9 schools, 3 + 3 + 3 per district. Under PPS each school's inclusion probability is n·p, its share of district enrollment times 3: school N08 (enrollment 860) had π = 0.3422 and gets weight 2.92, while S07 (enrollment 540) had π = 0.2903 and stands for 3.44 schools. Declaring SampleWeight_ as the plan weight and district as strata lets the other Complex Samples procedures analyse the drawn sample.

Output tables explained

Stratum Summary
For each stratum: population units in the frame, requested sample units and the number of cases selected (a selected cluster brings all its cases).
Selected Cases (first 20)
Row number, hits, inclusion probability and sampling weight of the first selected cases. The CSV download adds SampleHits_, InclusionProbability_ and SampleWeight_ to every selected case.

Assumptions and notes

  • The frame is complete: units missing a stratum, cluster or size value are not eligible and are counted in a footnote.
  • Without-replacement methods cannot request more units than a stratum holds, and Sampford's method needs every unit's share below the selection interval (n·p < 1).
  • Systematic and PPS systematic methods select along the frame order, so sort the frame first if you want implicit stratification.

How the results are validated

Unit tests draw from a stratified 40-unit frame and check that each seed reproduces the same sample, that without-replacement methods return exactly the requested sizes, and that inclusion probabilities and weights follow the stated formulas. For all six methods, 4,000 seeded draws give empirical selection frequencies within five standard errors of each unit's stated inclusion probability. Samples are not compared with SPSS, whose random stream differs. Validation evidence

Questions

How is the sampling weight computed?

For equal-probability methods the weight is N/n (units in the stratum over units drawn). For PPS methods it is 1/(n·p), where p is the unit's share of the stratum's total size. Use it as the Sampling weight when you later declare a sampling plan for the collected data.

Which PPS method should I use?

PPS systematic is simple and spreads the sample along the frame order. Sampford draws without replacement with inclusion probabilities exactly proportional to size. PPS with replacement can select a unit more than once, which the Hits column records.

Can I set a different sample size for each stratum?

The panel applies one number or one proportion to every stratum. A proportion gives proportional allocation; for other allocations, run each stratum separately with its own size.

Will the same seed reproduce my sample?

Yes, here: the same frame, settings and seed always give the same sample. It will not match a sample SPSS drew with the same seed, because the random number streams differ.

Is my survey file uploaded?

No. The workspace reads the file and runs CSSELECT in your browser. Nothing is sent to Crosstabs servers, and there is no account to create.

Run Select a Complex Sample 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.