Sample permanently draws a random sample of cases to process in all the subsequent procedures. Use Sample to draw a random sample of cases.
Sample allows two different specifications. One way to run it is to specify a decimal value between 0 and 1 reflecting the approximate fraction of cases that you would like to see in the sample. The second is to select an exact-size random sample, specify a positive number that is less than the file size, and follow it with the keyword FROM and the active dataset size.
To illustrate sampling, suppose you want to draw an approximately 30 percent sample from the GSS2016 active file. We will demonstrate the effect of sampling by obtaining statistics on age before and after sampling.
Here is the SPSS code:
DESCRIPTIVES VARIABLES=age
/STATISTICS=MEAN STDDEV MIN MAX.
FILTER OFF.
USE ALL.
SAMPLE .30.
DESCRIPTIVES VARIABLES...