Next: , Previous: FILTER, Up: Data Selection



10.2 N OF CASES

     N [OF CASES] num_of_cases [ESTIMATED].

Sometimes you may want to disregard cases of your input. N can do this. N 100 tells PSPP to disregard all cases after the first 100.

If the value specified for N is greater than the number of cases read in, the value is ignored.

N does not discard cases or prevent them from being read. It just causes cases beyond the last one specified to be ignored by data analysis commands.

A later N command can increase or decrease the number of cases selected. (To select all the cases without knowing how many there are, specify a very high number: 100000 or whatever you think is large enough.)

Transformation procedures performed after N is executed do cause cases to be discarded.

SAMPLE, PROCESS IF, and SELECT IF have precedence over N—the same results are obtained by both of the following fragments, given the same random number seeds:

     ...set up, read in data...
     N 100.
     SAMPLE .5.
     ...analyze data...
     
     ...set up, read in data...
     SAMPLE .5.
     N 100.
     ...analyze data...

Both fragments above first randomly sample approximately half of the cases, then select the first 100 of those sampled.

N with the ESTIMATED keyword gives an estimated number of cases before DATA LIST or another command to read in data. ESTIMATED never limits the number of cases processed by procedures. PSPP currently does not make use of case count estimates.

When N is specified after TEMPORARY, it affects only the next procedure (see TEMPORARY).