7977e3387cc2e0713bbc890d2b1c19000ba7ba77
[pspp] / doc / statistics.texi
1 @node Statistics
2 @chapter Statistics
3
4 This chapter documents the statistical procedures that @pspp{} supports so
5 far.
6
7 @menu
8 * DESCRIPTIVES::                Descriptive statistics.
9 * FREQUENCIES::                 Frequency tables.
10 * EXAMINE::                     Testing data for normality.
11 * GRAPH::                       Plot data.
12 * CORRELATIONS::                Correlation tables.
13 * CROSSTABS::                   Crosstabulation tables.
14 * FACTOR::                      Factor analysis and Principal Components analysis.
15 * LOGISTIC REGRESSION::         Bivariate Logistic Regression.
16 * MEANS::                       Average values and other statistics.
17 * NPAR TESTS::                  Nonparametric tests.
18 * T-TEST::                      Test hypotheses about means.
19 * ONEWAY::                      One way analysis of variance.
20 * QUICK CLUSTER::               K-Means clustering.
21 * RANK::                        Compute rank scores.
22 * REGRESSION::                  Linear regression.
23 * RELIABILITY::                 Reliability analysis.
24 * ROC::                         Receiver Operating Characteristic.
25 @end menu
26
27 @node DESCRIPTIVES
28 @section DESCRIPTIVES
29
30 @vindex DESCRIPTIVES
31 @display
32 DESCRIPTIVES
33         /VARIABLES=@var{var_list}
34         /MISSING=@{VARIABLE,LISTWISE@} @{INCLUDE,NOINCLUDE@}
35         /FORMAT=@{LABELS,NOLABELS@} @{NOINDEX,INDEX@} @{LINE,SERIAL@}
36         /SAVE
37         /STATISTICS=@{ALL,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,
38                      SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,DEFAULT,
39                      SESKEWNESS,SEKURTOSIS@}
40         /SORT=@{NONE,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,SKEWNESS,
41                RANGE,MINIMUM,MAXIMUM,SUM,SESKEWNESS,SEKURTOSIS,NAME@}
42               @{A,D@}
43 @end display
44
45 The @cmd{DESCRIPTIVES} procedure reads the active dataset and outputs
46 descriptive
47 statistics requested by the user.  In addition, it can optionally
48 compute Z-scores.
49
50 The @subcmd{VARIABLES} subcommand, which is required, specifies the list of
51 variables to be analyzed.  Keyword @subcmd{VARIABLES} is optional.
52
53 All other subcommands are optional:
54
55 The @subcmd{MISSING} subcommand determines the handling of missing variables.  If
56 @subcmd{INCLUDE} is set, then user-missing values are included in the
57 calculations.  If @subcmd{NOINCLUDE} is set, which is the default, user-missing
58 values are excluded.  If @subcmd{VARIABLE} is set, then missing values are
59 excluded on a variable by variable basis; if @subcmd{LISTWISE} is set, then
60 the entire case is excluded whenever any value in that case has a
61 system-missing or, if @subcmd{INCLUDE} is set, user-missing value.
62
63 The @subcmd{FORMAT} subcommand affects the output format.  Currently the
64 @subcmd{LABELS/NOLABELS} and @subcmd{NOINDEX/INDEX} settings are not used.
65 When @subcmd{SERIAL} is
66 set, both valid and missing number of cases are listed in the output;
67 when @subcmd{NOSERIAL} is set, only valid cases are listed.
68
69 The @subcmd{SAVE} subcommand causes @cmd{DESCRIPTIVES} to calculate Z scores for all
70 the specified variables.  The Z scores are saved to new variables.
71 Variable names are generated by trying first the original variable name
72 with Z prepended and truncated to a maximum of 8 characters, then the
73 names ZSC000 through ZSC999, STDZ00 through STDZ09, ZZZZ00 through
74 ZZZZ09, ZQZQ00 through ZQZQ09, in that sequence.  In addition, Z score
75 variable names can be specified explicitly on @subcmd{VARIABLES} in the variable
76 list by enclosing them in parentheses after each variable.
77 When Z scores are calculated, @pspp{} ignores @cmd{TEMPORARY},
78 treating temporary transformations as permanent.
79
80 The @subcmd{STATISTICS} subcommand specifies the statistics to be displayed:
81
82 @table @code
83 @item @subcmd{ALL}
84 All of the statistics below.
85 @item @subcmd{MEAN}
86 Arithmetic mean.
87 @item @subcmd{SEMEAN}
88 Standard error of the mean.
89 @item @subcmd{STDDEV}
90 Standard deviation.
91 @item @subcmd{VARIANCE}
92 Variance.
93 @item @subcmd{KURTOSIS}
94 Kurtosis and standard error of the kurtosis.
95 @item @subcmd{SKEWNESS}
96 Skewness and standard error of the skewness.
97 @item @subcmd{RANGE}
98 Range.
99 @item MINIMUM
100 Minimum value.
101 @item MAXIMUM
102 Maximum value.
103 @item SUM
104 Sum.
105 @item DEFAULT
106 Mean, standard deviation of the mean, minimum, maximum.
107 @item SEKURTOSIS
108 Standard error of the kurtosis.
109 @item SESKEWNESS
110 Standard error of the skewness.
111 @end table
112
113 The @subcmd{SORT} subcommand specifies how the statistics should be sorted.  Most
114 of the possible values should be self-explanatory.  @subcmd{NAME} causes the
115 statistics to be sorted by name.  By default, the statistics are listed
116 in the order that they are specified on the @subcmd{VARIABLES} subcommand.
117 The @subcmd{A} and @subcmd{D} settings request an ascending or descending
118 sort order, respectively.
119
120 @node FREQUENCIES
121 @section FREQUENCIES
122
123 @vindex FREQUENCIES
124 @display
125 FREQUENCIES
126         /VARIABLES=@var{var_list}
127         /FORMAT=@{TABLE,NOTABLE,LIMIT(@var{limit})@}
128                 @{AVALUE,DVALUE,AFREQ,DFREQ@}
129         /MISSING=@{EXCLUDE,INCLUDE@}
130         /STATISTICS=@{DEFAULT,MEAN,SEMEAN,MEDIAN,MODE,STDDEV,VARIANCE,
131                      KURTOSIS,SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,
132                      SESKEWNESS,SEKURTOSIS,ALL,NONE@}
133         /NTILES=@var{ntiles}
134         /PERCENTILES=percent@dots{}
135         /HISTOGRAM=[MINIMUM(@var{x_min})] [MAXIMUM(@var{x_max})] 
136                    [@{FREQ[(@var{y_max})],PERCENT[(@var{y_max})]@}] [@{NONORMAL,NORMAL@}]
137         /PIECHART=[MINIMUM(@var{x_min})] [MAXIMUM(@var{x_max})]
138                   [@{FREQ,PERCENT@}] [@{NOMISSING,MISSING@}]
139         /BARCHART=[MINIMUM(@var{x_min})] [MAXIMUM(@var{x_max})]
140                   [@{FREQ,PERCENT@}]
141
142
143 (These options are not currently implemented.)
144         /HBAR=@dots{}
145         /GROUPED=@dots{}
146 @end display
147
148 The @cmd{FREQUENCIES} procedure outputs frequency tables for specified
149 variables.
150 @cmd{FREQUENCIES} can also calculate and display descriptive statistics
151 (including median and mode) and percentiles,
152 @cmd{FREQUENCIES} can also output
153 histograms and pie charts.  
154
155 The @subcmd{VARIABLES} subcommand is the only required subcommand.  Specify the
156 variables to be analyzed.
157
158 The @subcmd{FORMAT} subcommand controls the output format.  It has several
159 possible settings:  
160
161 @itemize @subcmd{}
162 @item
163 @subcmd{TABLE}, the default, causes a frequency table to be output for every
164 variable specified.  @subcmd{NOTABLE} prevents them from being output.  @subcmd{LIMIT}
165 with a numeric argument causes them to be output except when there are
166 more than the specified number of values in the table.
167
168 @item
169 Normally frequency tables are sorted in ascending order by value.  This
170 is @subcmd{AVALUE}.  @subcmd{DVALUE} tables are sorted in descending order by value.
171 @subcmd{AFREQ} and @subcmd{DFREQ} tables are sorted in ascending and descending order,
172 respectively, by frequency count.
173 @end itemize
174
175 The @subcmd{MISSING} subcommand controls the handling of user-missing values.
176 When @subcmd{EXCLUDE}, the default, is set, user-missing values are not included
177 in frequency tables or statistics.  When @subcmd{INCLUDE} is set, user-missing
178 are included.  System-missing values are never included in statistics,
179 but are listed in frequency tables.
180
181 The available @subcmd{STATISTICS} are the same as available 
182 in @cmd{DESCRIPTIVES} (@pxref{DESCRIPTIVES}), with the addition 
183 of @subcmd{MEDIAN}, the data's median
184 value, and MODE, the mode.  (If there are multiple modes, the smallest
185 value is reported.)  By default, the mean, standard deviation of the
186 mean, minimum, and maximum are reported for each variable.
187
188 @cindex percentiles
189 @subcmd{PERCENTILES} causes the specified percentiles to be reported.
190 The percentiles should  be presented at a list of numbers between 0
191 and 100 inclusive.  
192 The @subcmd{NTILES} subcommand causes the percentiles to be reported at the
193 boundaries of the data set divided into the specified number of ranges.
194 For instance, @subcmd{/NTILES=4} would cause quartiles to be reported.
195
196 @cindex histogram
197 The @subcmd{HISTOGRAM} subcommand causes the output to include a histogram for
198 each specified numeric variable.  The X axis by default ranges from
199 the minimum to the maximum value observed in the data, but the @subcmd{MINIMUM}
200 and @subcmd{MAXIMUM} keywords can set an explicit range. The number of
201 bins are 2IQR(x)n^-1/3 according to the Freedman-Diaconis rule.  (Note that
202 @cmd{EXAMINE} uses a different algorithm to determine bin sizes.)
203 Histograms are not created for string variables.
204
205 Specify @subcmd{NORMAL} to superimpose a normal curve on the
206 histogram.
207
208 @cindex piechart
209 The @subcmd{PIECHART} subcommand adds a pie chart for each variable to the data.  Each
210 slice represents one value, with the size of the slice proportional to
211 the value's frequency.  By default, all non-missing values are given
212 slices.  
213 The @subcmd{MINIMUM} and @subcmd{MAXIMUM} keywords can be used to limit the
214 displayed slices to a given range of values.  
215 The keyword @subcmd{NOMISSING} causes missing values to be omitted from the
216 piechart.  This is the default.
217 If instead, @subcmd{MISSING} is specified, then a single slice
218 will be included representing all system missing and user-missing cases.
219
220 @cindex bar chart
221 The @subcmd{BARCHART} subcommand produces a bar chart for each variable.
222 The @subcmd{MINIMUM} and @subcmd{MAXIMUM} keywords can be used to omit
223 categories whose counts which lie outside the specified limits.
224 The @subcmd{FREQ} option (default) causes the ordinate to display the frequency
225 of each category, whereas the @subcmd{PERCENT} option will display relative
226 percentages.
227
228 The @subcmd{FREQ} and @subcmd{PERCENT} options on @subcmd{HISTOGRAM} and 
229 @subcmd{PIECHART} are accepted but not currently honoured.
230
231 @node EXAMINE
232 @section EXAMINE
233
234 @vindex EXAMINE
235 @cindex Exploratory data analysis
236 @cindex normality, testing
237
238 @display
239 EXAMINE
240         VARIABLES= @var{var1} [@var{var2}] @dots{} [@var{varN}]
241            [BY @var{factor1} [BY @var{subfactor1}]
242              [ @var{factor2} [BY @var{subfactor2}]]
243              @dots{}
244              [ @var{factor3} [BY @var{subfactor3}]]
245             ]
246         /STATISTICS=@{DESCRIPTIVES, EXTREME[(@var{n})], ALL, NONE@}
247         /PLOT=@{BOXPLOT, NPPLOT, HISTOGRAM, SPREADLEVEL[(@var{t})], ALL, NONE@}
248         /CINTERVAL @var{p}
249         /COMPARE=@{GROUPS,VARIABLES@}
250         /ID=@var{identity_variable}
251         /@{TOTAL,NOTOTAL@}
252         /PERCENTILE=[@var{percentiles}]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @}
253         /MISSING=@{LISTWISE, PAIRWISE@} [@{EXCLUDE, INCLUDE@}] 
254                 [@{NOREPORT,REPORT@}]
255
256 @end display
257
258 The @cmd{EXAMINE} command is used to perform exploratory data analysis.
259 In particular, it is useful for testing how closely a distribution follows a
260 normal distribution, and for finding outliers and extreme values.
261
262 The @subcmd{VARIABLES} subcommand is mandatory.  
263 It specifies the dependent variables and optionally variables to use as
264 factors for the analysis.
265 Variables listed before the first @subcmd{BY} keyword (if any) are the 
266 dependent variables.
267 The dependent variables may optionally be followed by a list of
268 factors which tell @pspp{} how to break down the analysis for each
269 dependent variable. 
270
271 Following the dependent variables, factors may be specified.
272 The factors (if desired) should be preceded by a single @subcmd{BY} keyword.
273 The format for each factor is 
274 @display
275 @var{factorvar} [BY @var{subfactorvar}].
276 @end display
277 Each unique combination of the values of  @var{factorvar} and
278 @var{subfactorvar} divide the dataset into @dfn{cells}.
279 Statistics will be calculated for each cell
280 and for the entire dataset (unless @subcmd{NOTOTAL} is given).
281
282 The @subcmd{STATISTICS} subcommand specifies which statistics to show.
283 @subcmd{DESCRIPTIVES} will produce a table showing some parametric and
284 non-parametrics statistics.
285 @subcmd{EXTREME} produces a table showing the extremities of each cell.
286 A number in parentheses, @var{n} determines
287 how many upper and lower extremities to show.
288 The default number is 5.
289
290 The subcommands @subcmd{TOTAL} and @subcmd{NOTOTAL} are mutually exclusive.
291 If @subcmd{TOTAL} appears, then statistics will be produced for the entire dataset
292 as well as for each cell.
293 If @subcmd{NOTOTAL} appears, then statistics will be produced only for the cells
294 (unless no factor variables have been given).
295 These subcommands have no effect if there have  been no factor variables
296 specified.
297
298 @cindex boxplot
299 @cindex histogram
300 @cindex npplot
301 @cindex spreadlevel plot
302 The @subcmd{PLOT} subcommand specifies which plots are to be produced if any.
303 Available plots are @subcmd{HISTOGRAM}, @subcmd{NPPLOT},  @subcmd{BOXPLOT} and
304 @subcmd{SPREADLEVEL}.
305 The first three can be used to visualise how closely each cell conforms to a 
306 normal distribution, whilst the spread vs.@: level plot can be useful to visualise
307 how the variance of differs between factors.
308 Boxplots will also show you the outliers and extreme values.
309
310 @subcmd{HISTOGRAM} uses Sturges' rule to determine the number of
311 bins, as approximately 1 + log2(n).  (Note that @cmd{FREQUENCIES} uses a
312 different algorithm to find the bin size.)
313
314 The @subcmd{SPREADLEVEL} plot displays the interquartile range versus the 
315 median.  It takes an optional parameter @var{t}, which specifies how the data
316 should be transformed prior to plotting.
317 The given value @var{t} is a power to which the data is raised.  For example, if
318 @var{t} is given as 2, then the data will be squared.
319 Zero, however is a special value.  If @var{t} is 0 or 
320 is omitted, then data will be transformed by taking its natural logarithm instead of
321 raising to the power of @var{t}.
322
323 The @subcmd{COMPARE} subcommand is only relevant if producing boxplots, and it is only 
324 useful there is more than one dependent variable and at least one factor.
325 If 
326 @subcmd{/COMPARE=GROUPS} is specified, then one plot per dependent variable is produced,
327 each of which contain boxplots for all the cells.
328 If @subcmd{/COMPARE=VARIABLES} is specified, then one plot per cell is produced,
329 each containing one boxplot per dependent variable.
330 If the @subcmd{/COMPARE} subcommand is omitted, then @pspp{} behaves as if
331 @subcmd{/COMPARE=GROUPS} were given.
332  
333 The @subcmd{ID} subcommand is relevant only if @subcmd{/PLOT=BOXPLOT} or 
334 @subcmd{/STATISTICS=EXTREME} has been given.
335 If given, it should provide the name of a variable which is to be used
336 to labels extreme values and outliers.
337 Numeric or string variables are permissible.  
338 If the @subcmd{ID} subcommand is not given, then the case number will be used for
339 labelling.
340
341 The @subcmd{CINTERVAL} subcommand specifies the confidence interval to use in
342 calculation of the descriptives command.  The default is 95%.
343
344 @cindex percentiles
345 The @subcmd{PERCENTILES} subcommand specifies which percentiles are to be calculated, 
346 and which algorithm to use for calculating them.  The default is to
347 calculate the 5, 10, 25, 50, 75, 90, 95 percentiles using the
348 @subcmd{HAVERAGE} algorithm.
349
350 The @subcmd{TOTAL} and @subcmd{NOTOTAL} subcommands are mutually exclusive.  If @subcmd{NOTOTAL}
351 is given and factors have been specified in the @subcmd{VARIABLES} subcommand,
352 then then statistics for the unfactored dependent variables are
353 produced in addition to the factored variables.  If there are no
354 factors specified then @subcmd{TOTAL} and @subcmd{NOTOTAL} have no effect.
355
356
357 The following example will generate descriptive statistics and histograms for
358 two variables @var{score1} and @var{score2}.
359 Two factors are given, @i{viz}: @var{gender} and @var{gender} BY @var{culture}.
360 Therefore, the descriptives and histograms will be generated for each
361 distinct  value
362 of @var{gender} @emph{and} for each distinct combination of the values
363 of @var{gender} and @var{race}.
364 Since the @subcmd{NOTOTAL} keyword is given, statistics and histograms for 
365 @var{score1} and @var{score2} covering the  whole dataset are not produced.
366 @example
367 EXAMINE @var{score1} @var{score2} BY 
368         @var{gender}
369         @var{gender} BY @var{culture}
370         /STATISTICS = DESCRIPTIVES
371         /PLOT = HISTOGRAM
372         /NOTOTAL.
373 @end example
374
375 Here is a second example showing how the @cmd{examine} command can be used to find extremities.
376 @example
377 EXAMINE @var{height} @var{weight} BY 
378         @var{gender}
379         /STATISTICS = EXTREME (3)
380         /PLOT = BOXPLOT
381         /COMPARE = GROUPS
382         /ID = @var{name}.
383 @end example
384 In this example, we look at the height and weight of a sample of individuals and
385 how they differ between male and female.
386 A table showing the 3 largest and the 3 smallest values of @var{height} and 
387 @var{weight} for each gender, and for the whole dataset will be shown.
388 Boxplots will also be produced.
389 Because @subcmd{/COMPARE = GROUPS} was given, boxplots for male and female will be
390 shown in the same graphic, allowing us to easily see the difference between
391 the genders.
392 Since the variable @var{name} was specified on the @subcmd{ID} subcommand, this will be
393 used to label the extreme values.
394
395 @strong{Warning!}
396 If many dependent variables are specified, or if factor variables are
397 specified for which
398 there are many distinct values, then @cmd{EXAMINE} will produce a very
399 large quantity of output.
400
401 @node GRAPH
402 @section GRAPH
403
404 @vindex GRAPH
405 @cindex Exploratory data analysis
406 @cindex normality, testing
407
408 @display
409 GRAPH
410         /HISTOGRAM = @var{var}
411         /SCATTERPLOT [(BIVARIATE)] = @var{var1} WITH @var{var2} [BY @var{var3}] 
412         [ /MISSING=@{LISTWISE, VARIABLE@} [@{EXCLUDE, INCLUDE@}] ] 
413                 [@{NOREPORT,REPORT@}]
414
415 @end display
416
417 The @cmd{GRAPH} produces graphical plots of data. Only one of the subcommands 
418 @subcmd{HISTOGRAM} or @subcmd{SCATTERPLOT} can be specified, i.e. only one plot
419 can be produced per call of @cmd{GRAPH}. The @subcmd{MISSING} is optional. 
420
421 @cindex scatterplot
422
423 The subcommand @subcmd{SCATTERPLOT} produces an xy plot of the data. The different 
424 values of the optional third variable @var{var3} will result in different colours and/or
425 markers for the plot. The following is an example for producing a scatterplot.
426
427 @example
428 GRAPH   
429         /SCATTERPLOT = @var{height} WITH @var{weight} BY @var{gender}.
430 @end example
431
432 This example will produce a scatterplot where @var{height} is plotted versus @var{weight}. Depending
433 on the value of the @var{gender} variable, the colour of the datapoint is different. With
434 this plot it is possible to analyze gender differences for @var{height} vs.@: @var{weight} relation.
435
436 @cindex histogram
437
438 The subcommand @subcmd{HISTOGRAM} produces a histogram. Only one variable is allowed for
439 the histogram plot.
440 For an alternative method to produce histograms @pxref{EXAMINE}. The
441 following example produces a histogram plot for the variable @var{weight}.
442
443 @example
444 GRAPH   
445         /HISTOGRAM = @var{weight}.
446 @end example
447
448 @node CORRELATIONS
449 @section CORRELATIONS
450
451 @vindex CORRELATIONS
452 @display
453 CORRELATIONS
454      /VARIABLES = @var{var_list} [ WITH @var{var_list} ]
455      [
456       .
457       .
458       .
459       /VARIABLES = @var{var_list} [ WITH @var{var_list} ]
460       /VARIABLES = @var{var_list} [ WITH @var{var_list} ]
461      ]
462
463      [ /PRINT=@{TWOTAIL, ONETAIL@} @{SIG, NOSIG@} ]
464      [ /STATISTICS=DESCRIPTIVES XPROD ALL]
465      [ /MISSING=@{PAIRWISE, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
466 @end display    
467
468 @cindex correlation
469 The @cmd{CORRELATIONS} procedure produces tables of the Pearson correlation coefficient
470 for a set of variables.  The significance of the coefficients are also given.
471
472 At least one @subcmd{VARIABLES} subcommand is required. If the @subcmd{WITH} 
473 keyword is used, then a non-square correlation table will be produced.
474 The variables preceding @subcmd{WITH}, will be used as the rows of the table,
475 and the variables following will be the columns of the table.
476 If no @subcmd{WITH} subcommand is given, then a square, symmetrical table using all variables is produced.
477
478
479 The @cmd{MISSING} subcommand determines the handling of missing variables.  
480 If @subcmd{INCLUDE} is set, then user-missing values are included in the
481 calculations, but system-missing values are not.
482 If @subcmd{EXCLUDE} is set, which is the default, user-missing
483 values are excluded as well as system-missing values. 
484
485 If @subcmd{LISTWISE} is set, then the entire case is excluded from analysis
486 whenever any variable  specified in any @cmd{/VARIABLES} subcommand
487 contains a missing value.   
488 If @subcmd{PAIRWISE} is set, then a case is considered missing only if either of the
489 values  for the particular coefficient are missing.
490 The default is @subcmd{PAIRWISE}.
491
492 The @subcmd{PRINT} subcommand is used to control how the reported significance values are printed.
493 If the @subcmd{TWOTAIL} option is used, then a two-tailed test of significance is 
494 printed.  If the @subcmd{ONETAIL} option is given, then a one-tailed test is used.
495 The default is @subcmd{TWOTAIL}.
496
497 If the @subcmd{NOSIG} option is specified, then correlation coefficients with significance less than
498 0.05 are highlighted.
499 If @subcmd{SIG} is specified, then no highlighting is performed.  This is the default.
500
501 @cindex covariance
502 The @subcmd{STATISTICS} subcommand requests additional statistics to be displayed.  The keyword 
503 @subcmd{DESCRIPTIVES} requests that the mean, number of non-missing cases, and the non-biased
504 estimator of the standard deviation are displayed.
505 These statistics will be displayed in a separated table, for all the variables listed
506 in any @subcmd{/VARIABLES} subcommand.
507 The @subcmd{XPROD} keyword requests cross-product deviations and covariance estimators to 
508 be displayed for each pair of variables.
509 The keyword @subcmd{ALL} is the union of @subcmd{DESCRIPTIVES} and @subcmd{XPROD}.
510
511 @node CROSSTABS
512 @section CROSSTABS
513
514 @vindex CROSSTABS
515 @display
516 CROSSTABS
517         /TABLES=@var{var_list} BY @var{var_list} [BY @var{var_list}]@dots{}
518         /MISSING=@{TABLE,INCLUDE,REPORT@}
519         /WRITE=@{NONE,CELLS,ALL@}
520         /FORMAT=@{TABLES,NOTABLES@}
521                 @{PIVOT,NOPIVOT@}
522                 @{AVALUE,DVALUE@}
523                 @{NOINDEX,INDEX@}
524                 @{BOX,NOBOX@}
525         /CELLS=@{COUNT,ROW,COLUMN,TOTAL,EXPECTED,RESIDUAL,SRESIDUAL,
526                 ASRESIDUAL,ALL,NONE@}
527         /STATISTICS=@{CHISQ,PHI,CC,LAMBDA,UC,BTAU,CTAU,RISK,GAMMA,D,
528                      KAPPA,ETA,CORR,ALL,NONE@}
529         /BARCHART
530         
531 (Integer mode.)
532         /VARIABLES=@var{var_list} (@var{low},@var{high})@dots{}
533 @end display
534
535 The @cmd{CROSSTABS} procedure displays crosstabulation
536 tables requested by the user.  It can calculate several statistics for
537 each cell in the crosstabulation tables.  In addition, a number of
538 statistics can be calculated for each table itself.
539
540 The @subcmd{TABLES} subcommand is used to specify the tables to be reported.  Any
541 number of dimensions is permitted, and any number of variables per
542 dimension is allowed.  The @subcmd{TABLES} subcommand may be repeated as many
543 times as needed.  This is the only required subcommand in @dfn{general
544 mode}.  
545
546 Occasionally, one may want to invoke a special mode called @dfn{integer
547 mode}.  Normally, in general mode, @pspp{} automatically determines
548 what values occur in the data.  In integer mode, the user specifies the
549 range of values that the data assumes.  To invoke this mode, specify the
550 @subcmd{VARIABLES} subcommand, giving a range of data values in parentheses for
551 each variable to be used on the @subcmd{TABLES} subcommand.  Data values inside
552 the range are truncated to the nearest integer, then assigned to that
553 value.  If values occur outside this range, they are discarded.  When it
554 is present, the @subcmd{VARIABLES} subcommand must precede the @subcmd{TABLES}
555 subcommand.
556
557 In general mode, numeric and string variables may be specified on
558 TABLES.  In integer mode, only numeric variables are allowed.
559
560 The @subcmd{MISSING} subcommand determines the handling of user-missing values.
561 When set to @subcmd{TABLE}, the default, missing values are dropped on a table by
562 table basis.  When set to @subcmd{INCLUDE}, user-missing values are included in
563 tables and statistics.  When set to @subcmd{REPORT}, which is allowed only in
564 integer mode, user-missing values are included in tables but marked with
565 an @samp{M} (for ``missing'') and excluded from statistical
566 calculations.
567
568 Currently the @subcmd{WRITE} subcommand is ignored.
569
570 The @subcmd{FORMAT} subcommand controls the characteristics of the
571 crosstabulation tables to be displayed.  It has a number of possible
572 settings:
573
574 @itemize @w{}
575 @item
576 @subcmd{TABLES}, the default, causes crosstabulation tables to be output.
577 @subcmd{NOTABLES} suppresses them.
578
579 @item
580 @subcmd{PIVOT}, the default, causes each @subcmd{TABLES} subcommand to be displayed in a
581 pivot table format.  @subcmd{NOPIVOT} causes the old-style crosstabulation format
582 to be used.
583
584 @item
585 @subcmd{AVALUE}, the default, causes values to be sorted in ascending order.
586 @subcmd{DVALUE} asserts a descending sort order.
587
588 @item
589 @subcmd{INDEX} and @subcmd{NOINDEX} are currently ignored.
590
591 @item
592 @subcmd{BOX} and @subcmd{NOBOX} is currently ignored.
593 @end itemize
594
595 The @subcmd{CELLS} subcommand controls the contents of each cell in the displayed
596 crosstabulation table.  The possible settings are:
597
598 @table @asis
599 @item COUNT
600 Frequency count.
601 @item ROW
602 Row percent.
603 @item COLUMN
604 Column percent.
605 @item TOTAL
606 Table percent.
607 @item EXPECTED
608 Expected value.
609 @item RESIDUAL 
610 Residual.
611 @item SRESIDUAL
612 Standardized residual.
613 @item ASRESIDUAL
614 Adjusted standardized residual.
615 @item ALL
616 All of the above.
617 @item NONE
618 Suppress cells entirely.
619 @end table
620
621 @samp{/CELLS} without any settings specified requests @subcmd{COUNT}, @subcmd{ROW},
622 @subcmd{COLUMN}, and @subcmd{TOTAL}.  
623 If @subcmd{CELLS} is not specified at all then only @subcmd{COUNT}
624 will be selected.
625
626 The @subcmd{STATISTICS} subcommand selects statistics for computation:
627
628 @table @asis
629 @item CHISQ
630 @cindex chisquare
631 @cindex chi-square
632
633 Pearson chi-square, likelihood ratio, Fisher's exact test, continuity
634 correction, linear-by-linear association.
635 @item PHI
636 Phi.
637 @item CC
638 Contingency coefficient.
639 @item LAMBDA
640 Lambda.
641 @item UC
642 Uncertainty coefficient.
643 @item BTAU
644 Tau-b.
645 @item CTAU
646 Tau-c.
647 @item RISK
648 Risk estimate.
649 @item GAMMA
650 Gamma.
651 @item D
652 Somers' D.
653 @item KAPPA
654 Cohen's Kappa.
655 @item ETA
656 Eta.
657 @item CORR
658 Spearman correlation, Pearson's r.
659 @item ALL
660 All of the above.
661 @item NONE
662 No statistics.
663 @end table
664
665 Selected statistics are only calculated when appropriate for the
666 statistic.  Certain statistics require tables of a particular size, and
667 some statistics are calculated only in integer mode.
668
669 @samp{/STATISTICS} without any settings selects CHISQ.  If the
670 @subcmd{STATISTICS} subcommand is not given, no statistics are calculated.
671
672 @cindex bar chart
673 The @samp{/BARCHART} subcommand produces a clustered bar chart for the first two
674 variables on each table.
675 If a table has more than two variables, the counts for the third and subsequent levels 
676 will be aggregated and the chart will be produces as if there were only two variables.  
677
678
679 @strong{Please note:} Currently the implementation of @cmd{CROSSTABS} has the
680 following limitations:
681
682 @itemize @bullet
683 @item
684 Significance of some symmetric and directional measures is not calculated.
685 @item
686 Asymptotic standard error is not calculated for
687 Goodman and Kruskal's tau or symmetric Somers' d.
688 @item
689 Approximate T is not calculated for symmetric uncertainty coefficient.
690 @end itemize
691
692 Fixes for any of these deficiencies would be welcomed.
693
694 @node FACTOR
695 @section FACTOR
696
697 @vindex FACTOR
698 @cindex factor analysis
699 @cindex principal components analysis
700 @cindex principal axis factoring
701 @cindex data reduction
702
703 @display
704 FACTOR  VARIABLES=@var{var_list}
705
706         [ /METHOD = @{CORRELATION, COVARIANCE@} ]
707
708         [ /EXTRACTION=@{PC, PAF@}] 
709
710         [ /ROTATION=@{VARIMAX, EQUAMAX, QUARTIMAX, PROMAX[(@var{k})], NOROTATE@}]
711
712         [ /PRINT=[INITIAL] [EXTRACTION] [ROTATION] [UNIVARIATE] [CORRELATION] [COVARIANCE] [DET] [KMO] [SIG] [ALL] [DEFAULT] ]
713
714         [ /PLOT=[EIGEN] ]
715
716         [ /FORMAT=[SORT] [BLANK(@var{n})] [DEFAULT] ]
717
718         [ /CRITERIA=[FACTORS(@var{n})] [MINEIGEN(@var{l})] [ITERATE(@var{m})] [ECONVERGE (@var{delta})] [DEFAULT] ]
719
720         [ /MISSING=[@{LISTWISE, PAIRWISE@}] [@{INCLUDE, EXCLUDE@}] ]
721 @end display
722
723 The @cmd{FACTOR} command performs Factor Analysis or Principal Axis Factoring on a dataset.  It may be used to find
724 common factors in the data or for data reduction purposes.
725
726 The @subcmd{VARIABLES} subcommand is required.  It lists the variables which are to partake in the analysis.
727
728 The @subcmd{/EXTRACTION} subcommand is used to specify the way in which factors (components) are extracted from the data.
729 If @subcmd{PC} is specified, then Principal Components Analysis is used.  
730 If @subcmd{PAF} is specified, then Principal Axis Factoring is
731 used. By default Principal Components Analysis will be used.
732
733 The @subcmd{/ROTATION} subcommand is used to specify the method by which the extracted solution will be rotated.
734 Three orthogonal rotation methods are available: 
735 @subcmd{VARIMAX} (which is the default), @subcmd{EQUAMAX}, and @subcmd{QUARTIMAX}.
736 There is one oblique rotation method, @i{viz}: @subcmd{PROMAX}.
737 Optionally you may enter the power of the promax rotation @var{k}, which must be enclosed in parentheses.
738 The default value of @var{k} is 5.
739 If you don't want any rotation to be performed, the word @subcmd{NOROTATE} will prevent the command from performing any
740 rotation on the data. 
741
742 The @subcmd{/METHOD} subcommand should be used to determine whether the covariance matrix or the correlation matrix of the data is
743 to be analysed.  By default, the correlation matrix is analysed.
744
745 The @subcmd{/PRINT} subcommand may be used to select which features of the analysis are reported:
746
747 @itemize 
748 @item @subcmd{UNIVARIATE}
749       A table of mean values, standard deviations and total weights are printed.
750 @item @subcmd{INITIAL}
751       Initial communalities and eigenvalues are printed.
752 @item @subcmd{EXTRACTION}
753       Extracted communalities and eigenvalues are printed.
754 @item @subcmd{ROTATION}
755       Rotated communalities and eigenvalues are printed.
756 @item @subcmd{CORRELATION}
757       The correlation matrix is printed.
758 @item @subcmd{COVARIANCE}
759       The covariance matrix is printed.
760 @item @subcmd{DET}
761       The determinant of the correlation or covariance matrix is printed.
762 @item @subcmd{KMO}
763       The Kaiser-Meyer-Olkin measure of sampling adequacy and the Bartlett test of sphericity is printed.
764 @item @subcmd{SIG}
765       The significance of the elements of correlation matrix is printed.
766 @item @subcmd{ALL}
767       All of the above are printed.
768 @item @subcmd{DEFAULT}
769       Identical to @subcmd{INITIAL} and @subcmd{EXTRACTION}.
770 @end itemize
771
772 If @subcmd{/PLOT=EIGEN} is given, then a ``Scree'' plot of the eigenvalues will be printed.  This can be useful for visualizing
773 which factors (components) should be retained.
774
775 The @subcmd{/FORMAT} subcommand determined how data are to be displayed in loading matrices.  If @subcmd{SORT} is specified, then the variables
776 are sorted in descending order of significance.  If @subcmd{BLANK(@var{n})} is specified, then coefficients whose absolute value is less
777 than @var{n} will not be printed.  If the keyword @subcmd{DEFAULT} is given, or if no @subcmd{/FORMAT} subcommand is given, then no sorting is 
778 performed, and all coefficients will be printed.
779
780 The @subcmd{/CRITERIA} subcommand is used to specify how the number of extracted factors (components) are chosen.
781 If @subcmd{FACTORS(@var{n})} is
782 specified, where @var{n} is an integer, then @var{n} factors will be extracted.  Otherwise, the @subcmd{MINEIGEN} setting will
783 be used.  
784 @subcmd{MINEIGEN(@var{l})} requests that all factors whose eigenvalues are greater than or equal to @var{l} are extracted.
785 The default value of @var{l} is 1.    
786 The @subcmd{ECONVERGE} setting has effect only when iterative algorithms for factor
787 extraction (such as Principal Axis Factoring) are used.   
788 @subcmd{ECONVERGE(@var{delta})} specifies that
789 iteration should cease when
790 the maximum absolute value of the communality estimate between one iteration and the previous is less than @var{delta}. The
791 default value of @var{delta} is 0.001.
792 The @subcmd{ITERATE(@var{m})} may appear any number of times and is used for two different purposes.  
793 It is used to set the maximum number of iterations (@var{m}) for convergence and also to set the maximum number of iterations
794 for rotation.
795 Whether it affects convergence or rotation depends upon which subcommand follows the @subcmd{ITERATE} subcommand.
796 If @subcmd{EXTRACTION} follows, it affects convergence.  
797 If @subcmd{ROTATION} follows, it affects rotation.  
798 If neither @subcmd{ROTATION} nor @subcmd{EXTRACTION} follow a @subcmd{ITERATE} subcommand it will be ignored.
799 The default value of @var{m} is 25.
800
801 The @cmd{MISSING} subcommand determines the handling of missing variables.  
802 If @subcmd{INCLUDE} is set, then user-missing values are included in the
803 calculations, but system-missing values are not.
804 If @subcmd{EXCLUDE} is set, which is the default, user-missing
805 values are excluded as well as system-missing values. 
806 This is the default.
807 If @subcmd{LISTWISE} is set, then the entire case is excluded from analysis
808 whenever any variable  specified in the @cmd{VARIABLES} subcommand
809 contains a missing value.   
810 If @subcmd{PAIRWISE} is set, then a case is considered missing only if either of the
811 values  for the particular coefficient are missing.
812 The default is @subcmd{LISTWISE}.
813
814 @node LOGISTIC REGRESSION
815 @section LOGISTIC REGRESSION
816
817 @vindex LOGISTIC REGRESSION
818 @cindex logistic regression
819 @cindex bivariate logistic regression
820
821 @display
822 LOGISTIC REGRESSION [VARIABLES =] @var{dependent_var} WITH @var{predictors}
823
824      [/CATEGORICAL = @var{categorical_predictors}]
825
826      [@{/NOCONST | /ORIGIN | /NOORIGIN @}]
827
828      [/PRINT = [SUMMARY] [DEFAULT] [CI(@var{confidence})] [ALL]]
829
830      [/CRITERIA = [BCON(@var{min_delta})] [ITERATE(@var{max_interations})]
831                   [LCON(@var{min_likelihood_delta})] [EPS(@var{min_epsilon})]
832                   [CUT(@var{cut_point})]]
833
834      [/MISSING = @{INCLUDE|EXCLUDE@}]
835 @end display
836
837 Bivariate Logistic Regression is used when you want to explain a dichotomous dependent
838 variable in terms of one or more predictor variables.
839
840 The minimum command is
841 @example
842 LOGISTIC REGRESSION @var{y} WITH @var{x1} @var{x2} @dots{} @var{xn}.
843 @end example
844 Here, @var{y} is the dependent variable, which must be dichotomous and @var{x1} @dots{} @var{xn}
845 are the predictor variables whose coefficients the procedure estimates.
846
847 By default, a constant term is included in the model.
848 Hence, the full model is
849 @math{
850 {\bf y} 
851 = b_0 + b_1 {\bf x_1} 
852 + b_2 {\bf x_2} 
853 + \dots
854 + b_n {\bf x_n}
855 }
856
857 Predictor variables which are categorical in nature should be listed on the @subcmd{/CATEGORICAL} subcommand.
858 Simple variables as well as interactions between variables may be listed here.
859
860 If you want a model without the constant term @math{b_0}, use the keyword @subcmd{/ORIGIN}.
861 @subcmd{/NOCONST} is a synonym for @subcmd{/ORIGIN}.
862
863 An iterative Newton-Raphson procedure is used to fit the model.
864 The @subcmd{/CRITERIA} subcommand is used to specify the stopping criteria of the procedure,
865 and other parameters.
866 The value of @var{cut_point} is used in the classification table.  It is the 
867 threshold above which predicted values are considered to be 1.  Values
868 of @var{cut_point} must lie in the range [0,1].
869 During iterations, if any one of the stopping criteria are satisfied, the procedure is
870 considered complete.
871 The stopping criteria are:
872 @itemize
873 @item The number of iterations exceeds @var{max_iterations}.  
874       The default value of @var{max_iterations} is 20.
875 @item The change in the all coefficient estimates are less than @var{min_delta}.
876 The default value of @var{min_delta} is 0.001.
877 @item The magnitude of change in the likelihood estimate is less than @var{min_likelihood_delta}.
878 The default value of @var{min_delta} is zero.
879 This means that this criterion is disabled.
880 @item The differential of the estimated probability for all cases is less than @var{min_epsilon}.
881 In other words, the probabilities are close to zero or one.
882 The default value of @var{min_epsilon} is 0.00000001.
883 @end itemize
884
885
886 The @subcmd{PRINT} subcommand controls the display of optional statistics.
887 Currently there is one such option, @subcmd{CI}, which indicates that the 
888 confidence interval of the odds ratio should be displayed as well as its value.
889 @subcmd{CI} should be followed by an integer in parentheses, to indicate the
890 confidence level of the desired confidence interval.
891
892 The @subcmd{MISSING} subcommand determines the handling of missing
893 variables.  
894 If @subcmd{INCLUDE} is set, then user-missing values are included in the
895 calculations, but system-missing values are not.
896 If @subcmd{EXCLUDE} is set, which is the default, user-missing
897 values are excluded as well as system-missing values. 
898 This is the default.
899
900 @node MEANS
901 @section MEANS
902
903 @vindex MEANS
904 @cindex means
905
906 @display 
907 MEANS [TABLES =] 
908       @{@var{var_list}@} 
909         [ BY @{@var{var_list}@} [BY @{@var{var_list}@} [BY @{@var{var_list}@} @dots{} ]]]
910
911       [ /@{@var{var_list}@} 
912          [ BY @{@var{var_list}@} [BY @{@var{var_list}@} [BY @{@var{var_list}@} @dots{} ]]] ]
913
914       [/CELLS = [MEAN] [COUNT] [STDDEV] [SEMEAN] [SUM] [MIN] [MAX] [RANGE]
915         [VARIANCE] [KURT] [SEKURT] 
916         [SKEW] [SESKEW] [FIRST] [LAST] 
917         [HARMONIC] [GEOMETRIC] 
918         [DEFAULT]
919         [ALL]
920         [NONE] ]
921
922       [/MISSING = [TABLE] [INCLUDE] [DEPENDENT]]
923 @end display 
924
925 You can use the @cmd{MEANS} command to calculate the arithmetic mean and similar
926 statistics, either for the dataset as a whole or for categories of data.
927
928 The simplest form of the command is
929 @example
930 MEANS @var{v}.
931 @end example
932 @noindent which calculates the mean, count and standard deviation for @var{v}.
933 If you specify a grouping variable, for example
934 @example
935 MEANS @var{v} BY @var{g}.
936 @end example
937 @noindent then the means, counts and standard deviations for @var{v} after having
938 been grouped by @var{g} will be calculated.
939 Instead of the mean, count and standard deviation, you could specify the statistics
940 in which you are interested:
941 @example
942 MEANS @var{x} @var{y} BY @var{g}
943       /CELLS = HARMONIC SUM MIN.
944 @end example
945 This example calculates the harmonic mean, the sum and the minimum values of @var{x} and @var{y}
946 grouped by @var{g}.
947
948 The @subcmd{CELLS} subcommand specifies which statistics to calculate.  The available statistics
949 are:
950 @itemize
951 @item @subcmd{MEAN}
952 @cindex arithmetic mean
953       The arithmetic mean.
954 @item @subcmd{COUNT}
955       The count of the values.
956 @item @subcmd{STDDEV}
957       The standard deviation.
958 @item @subcmd{SEMEAN}
959       The standard error of the mean.
960 @item @subcmd{SUM}
961       The sum of the values.
962 @item @subcmd{MIN}
963       The minimum value.
964 @item @subcmd{MAX}
965       The maximum value.
966 @item @subcmd{RANGE}
967       The difference between the maximum and minimum values.
968 @item @subcmd{VARIANCE}
969       The variance.
970 @item @subcmd{FIRST}
971       The first value in the category.
972 @item @subcmd{LAST}
973       The last value in the category.
974 @item @subcmd{SKEW}
975       The skewness.
976 @item @subcmd{SESKEW}
977       The standard error of the skewness.
978 @item @subcmd{KURT}
979       The kurtosis
980 @item @subcmd{SEKURT}
981       The standard error of the kurtosis.
982 @item @subcmd{HARMONIC}
983 @cindex harmonic mean
984       The harmonic mean.
985 @item @subcmd{GEOMETRIC}
986 @cindex geometric mean
987       The geometric mean.
988 @end itemize
989
990 In addition, three special keywords are recognized:
991 @itemize
992 @item @subcmd{DEFAULT}
993       This is the same as @subcmd{MEAN} @subcmd{COUNT} @subcmd{STDDEV}.
994 @item @subcmd{ALL}
995       All of the above statistics will be calculated.
996 @item @subcmd{NONE}
997       No statistics will be calculated (only a summary will be shown).
998 @end itemize
999
1000
1001 More than one @dfn{table} can be specified in a single command. 
1002 Each table is separated by a @samp{/}. For
1003 example
1004 @example
1005 MEANS TABLES =
1006       @var{c} @var{d} @var{e} BY @var{x}
1007       /@var{a} @var{b} BY @var{x} @var{y}
1008       /@var{f} BY @var{y} BY @var{z}.
1009 @end example
1010 has three tables (the @samp{TABLE =} is optional).
1011 The first table has three dependent variables @var{c}, @var{d} and @var{e}
1012 and a single categorical variable @var{x}.
1013 The second table has two dependent variables @var{a} and @var{b}, 
1014 and two categorical variables @var{x} and @var{y}.
1015 The third table has a single dependent variables @var{f}
1016 and a categorical variable formed by the combination of @var{y} and @var{z}.
1017
1018
1019 By default values are omitted from the analysis only if missing values
1020 (either system missing or user missing)
1021 for any of the variables directly involved in their calculation are 
1022 encountered.
1023 This behaviour can be modified with the  @subcmd{/MISSING} subcommand.
1024 Three options are possible: @subcmd{TABLE}, @subcmd{INCLUDE} and @subcmd{DEPENDENT}.
1025
1026 @subcmd{/MISSING = TABLE} causes cases to be dropped if any variable is missing 
1027 in the table specification currently being processed, regardless of 
1028 whether it is needed to calculate the statistic.
1029
1030 @subcmd{/MISSING = INCLUDE} says that user missing values, either in the dependent
1031 variables or in the categorical variables should be taken at their face
1032 value, and not excluded.
1033
1034 @subcmd{/MISSING = DEPENDENT} says that user missing values, in the dependent
1035 variables should be taken at their face value, however cases which 
1036 have user missing values for the categorical variables should be omitted 
1037 from the calculation.
1038
1039 @node NPAR TESTS
1040 @section NPAR TESTS
1041
1042 @vindex NPAR TESTS
1043 @cindex nonparametric tests
1044
1045 @display 
1046 NPAR TESTS
1047      
1048      nonparametric test subcommands
1049      .
1050      .
1051      .
1052      
1053      [ /STATISTICS=@{DESCRIPTIVES@} ]
1054
1055      [ /MISSING=@{ANALYSIS, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
1056
1057      [ /METHOD=EXACT [ TIMER [(@var{n})] ] ]
1058 @end display
1059
1060 @cmd{NPAR TESTS} performs nonparametric tests. 
1061 Non parametric tests make very few assumptions about the distribution of the 
1062 data.
1063 One or more tests may be specified by using the corresponding subcommand.
1064 If the @subcmd{/STATISTICS} subcommand is also specified, then summary statistics are 
1065 produces for each variable that is the subject of any test.
1066
1067 Certain tests may take a long time to execute, if an exact figure is required.
1068 Therefore, by default asymptotic approximations are used unless the
1069 subcommand @subcmd{/METHOD=EXACT} is specified.  
1070 Exact tests give more accurate results, but may take an unacceptably long 
1071 time to perform.  If the @subcmd{TIMER} keyword is used, it sets a maximum time,
1072 after which the test will be abandoned, and a warning message printed.
1073 The time, in minutes, should be specified in parentheses after the @subcmd{TIMER} keyword.
1074 If the @subcmd{TIMER} keyword is given without this figure, then a default value of 5 minutes 
1075 is used.
1076
1077
1078 @menu
1079 * BINOMIAL::                Binomial Test
1080 * CHISQUARE::               Chisquare Test
1081 * COCHRAN::                 Cochran Q Test
1082 * FRIEDMAN::                Friedman Test
1083 * KENDALL::                 Kendall's W Test
1084 * KOLMOGOROV-SMIRNOV::      Kolmogorov Smirnov Test
1085 * KRUSKAL-WALLIS::          Kruskal-Wallis Test
1086 * MANN-WHITNEY::            Mann Whitney U Test
1087 * MCNEMAR::                 McNemar Test
1088 * MEDIAN::                  Median Test
1089 * RUNS::                    Runs Test
1090 * SIGN::                    The Sign Test
1091 * WILCOXON::                Wilcoxon Signed Ranks Test
1092 @end menu
1093
1094
1095 @node    BINOMIAL
1096 @subsection Binomial test
1097 @vindex BINOMIAL
1098 @cindex binomial test
1099
1100 @display 
1101      [ /BINOMIAL[(@var{p})]=@var{var_list}[(@var{value1}[, @var{value2})] ] ]
1102 @end display 
1103
1104 The @subcmd{/BINOMIAL} subcommand compares the observed distribution of a dichotomous 
1105 variable with that of a binomial distribution.
1106 The variable @var{p} specifies the test proportion of the binomial 
1107 distribution.  
1108 The default value of 0.5 is assumed if @var{p} is omitted.
1109
1110 If a single value appears after the variable list, then that value is
1111 used as the threshold to partition the observed values. Values less
1112 than or equal to the threshold value form the first category.  Values
1113 greater than the threshold form the second category. 
1114
1115 If two values appear after the variable list, then they will be used
1116 as the values which a variable must take to be in the respective
1117 category. 
1118 Cases for which a variable takes a value equal to neither of the specified  
1119 values, take no part in the test for that variable.
1120
1121 If no values appear, then the variable must assume dichotomous
1122 values.
1123 If more than two distinct, non-missing values for a variable
1124 under test are encountered then an error occurs.
1125
1126 If the test proportion is equal to 0.5, then a two tailed test is
1127 reported.   For any other test proportion, a one tailed test is
1128 reported.   
1129 For one tailed tests, if the test proportion is less than
1130 or equal to the observed proportion, then the significance of
1131 observing the observed proportion or more is reported.
1132 If the test proportion is more than the observed proportion, then the
1133 significance of observing the observed proportion or less is reported.
1134 That is to say, the test is always performed in the observed
1135 direction. 
1136
1137 @pspp{} uses a very precise approximation to the gamma function to
1138 compute the binomial significance.  Thus, exact results are reported
1139 even for very large sample sizes.
1140
1141
1142
1143 @node    CHISQUARE
1144 @subsection Chisquare Test
1145 @vindex CHISQUARE
1146 @cindex chisquare test
1147
1148
1149 @display
1150      [ /CHISQUARE=@var{var_list}[(@var{lo},@var{hi})] [/EXPECTED=@{EQUAL|@var{f1}, @var{f2} @dots{} @var{fn}@}] ]
1151 @end display 
1152
1153
1154 The @subcmd{/CHISQUARE} subcommand produces a chi-square statistic for the differences 
1155 between the expected and observed frequencies of the categories of a variable. 
1156 Optionally, a range of values may appear after the variable list.  
1157 If a range is given, then non integer values are truncated, and values
1158 outside the  specified range are excluded from the analysis.
1159
1160 The @subcmd{/EXPECTED} subcommand specifies the expected values of each
1161 category.  
1162 There must be exactly one non-zero expected value, for each observed
1163 category, or the @subcmd{EQUAL} keyword must be specified.
1164 You may use the notation @subcmd{@var{n}*@var{f}} to specify @var{n}
1165 consecutive expected categories all taking a frequency of @var{f}.
1166 The frequencies given are proportions, not absolute frequencies.  The
1167 sum of the frequencies need not be 1.
1168 If no @subcmd{/EXPECTED} subcommand is given, then then equal frequencies 
1169 are expected.
1170
1171
1172 @node COCHRAN
1173 @subsection Cochran Q Test
1174 @vindex Cochran
1175 @cindex Cochran Q test
1176 @cindex Q, Cochran Q
1177
1178 @display
1179      [ /COCHRAN = @var{var_list} ]
1180 @end display
1181
1182 The Cochran Q test is used to test for differences between three or more groups.
1183 The data for @var{var_list} in all cases must assume exactly two distinct values (other than missing values). 
1184
1185 The value of Q will be displayed and its Asymptotic significance based on a chi-square distribution.
1186
1187 @node FRIEDMAN
1188 @subsection Friedman Test
1189 @vindex FRIEDMAN
1190 @cindex Friedman test
1191
1192 @display
1193      [ /FRIEDMAN = @var{var_list} ]
1194 @end display
1195
1196 The Friedman test is used to test for differences between repeated measures when
1197 there is no indication that the distributions are normally distributed.
1198
1199 A list of variables which contain the measured data must be given.  The procedure
1200 prints the sum of ranks for each variable, the test statistic and its significance.
1201
1202 @node KENDALL
1203 @subsection Kendall's W Test
1204 @vindex KENDALL
1205 @cindex Kendall's W test
1206 @cindex coefficient of concordance
1207
1208 @display
1209      [ /KENDALL = @var{var_list} ]
1210 @end display
1211
1212 The Kendall test investigates whether an arbitrary number of related samples come from the 
1213 same population.
1214 It is identical to the Friedman test except that the additional statistic W, Kendall's Coefficient of Concordance is printed.
1215 It has the range [0,1] --- a value of zero indicates no agreement between the samples whereas a value of
1216 unity indicates complete agreement.
1217
1218
1219 @node KOLMOGOROV-SMIRNOV
1220 @subsection Kolmogorov-Smirnov Test
1221 @vindex KOLMOGOROV-SMIRNOV
1222 @vindex K-S
1223 @cindex Kolmogorov-Smirnov test
1224
1225 @display
1226      [ /KOLMOGOROV-SMIRNOV (@{NORMAL [@var{mu}, @var{sigma}], UNIFORM [@var{min}, @var{max}], POISSON [@var{lambda}], EXPONENTIAL [@var{scale}] @}) = @var{var_list} ]
1227 @end display
1228
1229 The one sample Kolmogorov-Smirnov subcommand is used to test whether or not a dataset is
1230 drawn from a particular distribution.  Four distributions are supported, @i{viz:}
1231 Normal, Uniform, Poisson and Exponential.
1232
1233 Ideally you should provide the parameters of the distribution against which you wish to test
1234 the data. For example, with the normal distribution  the mean (@var{mu})and standard deviation (@var{sigma})
1235 should be given; with the uniform distribution, the minimum (@var{min})and maximum (@var{max}) value should
1236 be provided.
1237 However, if the parameters are omitted they will be imputed from the data. Imputing the
1238 parameters reduces the power of the test so should be avoided if possible.
1239
1240 In the following example, two variables @var{score} and @var{age} are tested to see if
1241 they follow a normal distribution with a mean of 3.5 and a standard deviation of 2.0.
1242 @example
1243   NPAR TESTS
1244         /KOLMOGOROV-SMIRNOV (normal 3.5 2.0) = @var{score} @var{age}.
1245 @end example
1246 If the variables need to be tested against different distributions, then a separate
1247 subcommand must be used.  For example the following syntax tests @var{score} against
1248 a normal distribution with mean of 3.5 and standard deviation of 2.0 whilst @var{age}
1249 is tested against a normal distribution of mean 40 and standard deviation 1.5.
1250 @example
1251   NPAR TESTS
1252         /KOLMOGOROV-SMIRNOV (normal 3.5 2.0) = @var{score}
1253         /KOLMOGOROV-SMIRNOV (normal 40 1.5) =  @var{age}.
1254 @end example
1255
1256 The abbreviated subcommand  @subcmd{K-S} may be used in place of @subcmd{KOLMOGOROV-SMIRNOV}.
1257
1258 @node KRUSKAL-WALLIS
1259 @subsection Kruskal-Wallis Test
1260 @vindex KRUSKAL-WALLIS
1261 @vindex K-W
1262 @cindex Kruskal-Wallis test
1263
1264 @display
1265      [ /KRUSKAL-WALLIS = @var{var_list} BY var (@var{lower}, @var{upper}) ]
1266 @end display
1267
1268 The Kruskal-Wallis test is used to compare data from an 
1269 arbitrary number of populations.  It does not assume normality.
1270 The data to be compared are specified by @var{var_list}.
1271 The categorical variable determining the groups to which the
1272 data belongs is given by @var{var}. The limits @var{lower} and
1273 @var{upper} specify the valid range of @var{var}. Any cases for
1274 which @var{var} falls outside [@var{lower}, @var{upper}] will be
1275 ignored.
1276
1277 The mean rank of each group as well as the chi-squared value and significance
1278 of the test will be printed.
1279 The abbreviated subcommand  @subcmd{K-W} may be used in place of @subcmd{KRUSKAL-WALLIS}.
1280
1281
1282 @node MANN-WHITNEY
1283 @subsection Mann-Whitney U Test
1284 @vindex MANN-WHITNEY
1285 @vindex M-W
1286 @cindex Mann-Whitney U test
1287 @cindex U, Mann-Whitney U
1288
1289 @display
1290      [ /MANN-WHITNEY = @var{var_list} BY var (@var{group1}, @var{group2}) ]
1291 @end display
1292
1293 The Mann-Whitney subcommand is used to test whether two groups of data come from different populations.
1294 The variables to be tested should be specified in @var{var_list} and the grouping variable, that determines to which group the test variables belong, in @var{var}.
1295 @var{Var} may be either a string or an alpha variable.
1296 @var{Group1} and @var{group2} specify the
1297 two values of @var{var} which determine the groups of the test data.
1298 Cases for which the @var{var} value is neither @var{group1} or @var{group2} will be ignored.
1299
1300 The value of the Mann-Whitney U statistic, the Wilcoxon W, and the significance will be printed.
1301 The abbreviated subcommand  @subcmd{M-W} may be used in place of @subcmd{MANN-WHITNEY}.
1302
1303 @node MCNEMAR
1304 @subsection McNemar Test
1305 @vindex MCNEMAR
1306 @cindex McNemar test
1307
1308 @display
1309      [ /MCNEMAR @var{var_list} [ WITH @var{var_list} [ (PAIRED) ]]]
1310 @end display
1311
1312 Use McNemar's test to analyse the significance of the difference between
1313 pairs of correlated proportions.
1314
1315 If the @code{WITH} keyword is omitted, then tests for all
1316 combinations of the listed variables are performed.
1317 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
1318 is also given, then the number of variables preceding @code{WITH}
1319 must be the same as the number following it.
1320 In this case, tests for each respective pair of variables are
1321 performed.
1322 If the @code{WITH} keyword is given, but the
1323 @code{(PAIRED)} keyword is omitted, then tests for each combination
1324 of variable preceding @code{WITH} against variable following
1325 @code{WITH} are performed.
1326
1327 The data in each variable must be dichotomous.  If there are more
1328 than two distinct variables an error will occur and the test will
1329 not be run.
1330
1331 @node MEDIAN
1332 @subsection Median Test
1333 @vindex MEDIAN
1334 @cindex Median test
1335
1336 @display
1337      [ /MEDIAN [(@var{value})] = @var{var_list} BY @var{variable} (@var{value1}, @var{value2}) ]
1338 @end display
1339
1340 The median test is used to test whether independent samples come from 
1341 populations with a common median.
1342 The median of the populations against which the samples are to be tested
1343 may be given in parentheses immediately after the 
1344 @subcmd{/MEDIAN} subcommand.  If it is not given, the median will be imputed from the 
1345 union of all the samples.
1346
1347 The variables of the samples to be tested should immediately follow the @samp{=} sign. The
1348 keyword @code{BY} must come next, and then the grouping variable.  Two values
1349 in parentheses should follow.  If the first value is greater than the second,
1350 then a 2 sample test is performed using these two values to determine the groups.
1351 If however, the first variable is less than the second, then a @i{k} sample test is
1352 conducted and the group values used are all values encountered which lie in the
1353 range [@var{value1},@var{value2}].
1354
1355
1356 @node RUNS
1357 @subsection Runs Test
1358 @vindex RUNS
1359 @cindex runs test
1360
1361 @display 
1362      [ /RUNS (@{MEAN, MEDIAN, MODE, @var{value}@})  = @var{var_list} ]
1363 @end display
1364
1365 The @subcmd{/RUNS} subcommand tests whether a data sequence is randomly ordered.
1366
1367 It works by examining the number of times a variable's value crosses a given threshold. 
1368 The desired threshold must be specified within parentheses.
1369 It may either be specified as a number or as one of @subcmd{MEAN}, @subcmd{MEDIAN} or @subcmd{MODE}.
1370 Following the threshold specification comes the list of variables whose values are to be
1371 tested.
1372
1373 The subcommand shows the number of runs, the asymptotic significance based on the
1374 length of the data.
1375
1376 @node SIGN
1377 @subsection Sign Test
1378 @vindex SIGN
1379 @cindex sign test
1380
1381 @display
1382      [ /SIGN @var{var_list} [ WITH @var{var_list} [ (PAIRED) ]]]
1383 @end display
1384
1385 The @subcmd{/SIGN} subcommand tests for differences between medians of the 
1386 variables listed.
1387 The test does not make any assumptions about the
1388 distribution of the data.
1389
1390 If the @code{WITH} keyword is omitted, then tests for all
1391 combinations of the listed variables are performed.
1392 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
1393 is also given, then the number of variables preceding @code{WITH}
1394 must be the same as the number following it.
1395 In this case, tests for each respective pair of variables are
1396 performed.
1397 If the @code{WITH} keyword is given, but the
1398 @code{(PAIRED)} keyword is omitted, then tests for each combination
1399 of variable preceding @code{WITH} against variable following
1400 @code{WITH} are performed.
1401
1402 @node WILCOXON
1403 @subsection Wilcoxon Matched Pairs Signed Ranks Test
1404 @vindex WILCOXON
1405 @cindex wilcoxon matched pairs signed ranks test
1406
1407 @display
1408      [ /WILCOXON @var{var_list} [ WITH @var{var_list} [ (PAIRED) ]]]
1409 @end display
1410
1411 The @subcmd{/WILCOXON} subcommand tests for differences between medians of the 
1412 variables listed.
1413 The test does not make any assumptions about the variances of the samples.
1414 It does however assume that the distribution is symmetrical.
1415
1416 If the @subcmd{WITH} keyword is omitted, then tests for all
1417 combinations of the listed variables are performed.
1418 If the @subcmd{WITH} keyword is given, and the @subcmd{(PAIRED)} keyword
1419 is also given, then the number of variables preceding @subcmd{WITH}
1420 must be the same as the number following it.
1421 In this case, tests for each respective pair of variables are
1422 performed.
1423 If the @subcmd{WITH} keyword is given, but the
1424 @subcmd{(PAIRED)} keyword is omitted, then tests for each combination
1425 of variable preceding @subcmd{WITH} against variable following
1426 @subcmd{WITH} are performed.
1427
1428 @node T-TEST
1429 @section T-TEST
1430
1431 @vindex T-TEST
1432
1433 @display
1434 T-TEST
1435         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
1436         /CRITERIA=CIN(@var{confidence})
1437
1438
1439 (One Sample mode.)
1440         TESTVAL=@var{test_value}
1441         /VARIABLES=@var{var_list}
1442
1443
1444 (Independent Samples mode.)
1445         GROUPS=var(@var{value1} [, @var{value2}])
1446         /VARIABLES=@var{var_list}
1447
1448
1449 (Paired Samples mode.)
1450         PAIRS=@var{var_list} [WITH @var{var_list} [(PAIRED)] ]
1451
1452 @end display
1453
1454
1455 The @cmd{T-TEST} procedure outputs tables used in testing hypotheses about 
1456 means.  
1457 It operates in one of three modes:
1458 @itemize
1459 @item One Sample mode.
1460 @item Independent Groups mode.
1461 @item Paired mode.
1462 @end itemize
1463
1464 @noindent
1465 Each of these modes are described in more detail below.
1466 There are two optional subcommands which are common to all modes.
1467
1468 The @cmd{/CRITERIA} subcommand tells @pspp{} the confidence interval used
1469 in the tests.  The default value is 0.95.
1470
1471
1472 The @cmd{MISSING} subcommand determines the handling of missing
1473 variables.  
1474 If @subcmd{INCLUDE} is set, then user-missing values are included in the
1475 calculations, but system-missing values are not.
1476 If @subcmd{EXCLUDE} is set, which is the default, user-missing
1477 values are excluded as well as system-missing values. 
1478 This is the default.
1479
1480 If @subcmd{LISTWISE} is set, then the entire case is excluded from analysis
1481 whenever any variable  specified in the @subcmd{/VARIABLES}, @subcmd{/PAIRS} or 
1482 @subcmd{/GROUPS} subcommands contains a missing value.   
1483 If @subcmd{ANALYSIS} is set, then missing values are excluded only in the analysis for
1484 which they would be needed. This is the default.
1485
1486
1487 @menu
1488 * One Sample Mode::             Testing against a hypothesized mean
1489 * Independent Samples Mode::    Testing two independent groups for equal mean
1490 * Paired Samples Mode::         Testing two interdependent groups for equal mean
1491 @end menu
1492
1493 @node One Sample Mode
1494 @subsection One Sample Mode
1495
1496 The @subcmd{TESTVAL} subcommand invokes the One Sample mode.
1497 This mode is used to test a population mean against a hypothesized
1498 mean. 
1499 The value given to the @subcmd{TESTVAL} subcommand is the value against
1500 which you wish to test.
1501 In this mode, you must also use the @subcmd{/VARIABLES} subcommand to
1502 tell @pspp{} which variables you wish to test.
1503
1504 @node Independent Samples Mode
1505 @subsection Independent Samples Mode
1506
1507 The @subcmd{GROUPS} subcommand invokes Independent Samples mode or
1508 `Groups' mode. 
1509 This mode is used to test whether two groups of values have the
1510 same population mean.
1511 In this mode, you must also use the @subcmd{/VARIABLES} subcommand to
1512 tell @pspp{} the dependent variables you wish to test.
1513
1514 The variable given in the @subcmd{GROUPS} subcommand is the independent
1515 variable which determines to which group the samples belong.
1516 The values in parentheses are the specific values of the independent
1517 variable for each group.
1518 If the parentheses are omitted and no values are given, the default values 
1519 of 1.0 and 2.0 are assumed.
1520
1521 If the independent variable is numeric, 
1522 it is acceptable to specify only one value inside the parentheses.
1523 If you do this, cases where the independent variable is
1524 greater than or equal to this value belong to the first group, and cases
1525 less than this value belong to the second group.
1526 When using this form of the @subcmd{GROUPS} subcommand, missing values in
1527 the independent variable are excluded on a listwise basis, regardless
1528 of whether @subcmd{/MISSING=LISTWISE} was specified.
1529
1530
1531 @node Paired Samples Mode
1532 @subsection Paired Samples Mode
1533
1534 The @cmd{PAIRS} subcommand introduces Paired Samples mode.
1535 Use this mode when repeated measures have been taken from the same
1536 samples.
1537 If the @subcmd{WITH} keyword is omitted, then tables for all
1538 combinations of variables given in the @cmd{PAIRS} subcommand are
1539 generated. 
1540 If the @subcmd{WITH} keyword is given, and the @subcmd{(PAIRED)} keyword
1541 is also given, then the number of variables preceding @subcmd{WITH}
1542 must be the same as the number following it.
1543 In this case, tables for each respective pair of variables are
1544 generated.
1545 In the event that the @subcmd{WITH} keyword is given, but the
1546 @subcmd{(PAIRED)} keyword is omitted, then tables for each combination
1547 of variable preceding @subcmd{WITH} against variable following
1548 @subcmd{WITH} are generated.
1549
1550
1551 @node ONEWAY
1552 @section ONEWAY
1553
1554 @vindex ONEWAY
1555 @cindex analysis of variance
1556 @cindex ANOVA
1557
1558 @display
1559 ONEWAY
1560         [/VARIABLES = ] @var{var_list} BY @var{var}
1561         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
1562         /CONTRAST= @var{value1} [, @var{value2}] ... [,@var{valueN}]
1563         /STATISTICS=@{DESCRIPTIVES,HOMOGENEITY@}
1564         /POSTHOC=@{BONFERRONI, GH, LSD, SCHEFFE, SIDAK, TUKEY, ALPHA ([@var{value}])@}
1565 @end display
1566
1567 The @cmd{ONEWAY} procedure performs a one-way analysis of variance of
1568 variables factored by a single independent variable.
1569 It is used to compare the means of a population
1570 divided into more than two groups. 
1571
1572 The dependent variables to be analysed should be given in the @subcmd{VARIABLES}
1573 subcommand.  
1574 The list of variables must be followed by the @subcmd{BY} keyword and
1575 the name of the independent (or factor) variable.
1576
1577 You can use the @subcmd{STATISTICS} subcommand to tell @pspp{} to display
1578 ancillary information.  The options accepted are:
1579 @itemize
1580 @item DESCRIPTIVES
1581 Displays descriptive statistics about the groups factored by the independent
1582 variable.
1583 @item HOMOGENEITY
1584 Displays the Levene test of Homogeneity of Variance for the
1585 variables and their groups.
1586 @end itemize
1587
1588 The @subcmd{CONTRAST} subcommand is used when you anticipate certain
1589 differences between the groups.
1590 The subcommand must be followed by a list of numerals which are the
1591 coefficients of the groups to be tested.
1592 The number of coefficients must correspond to the number of distinct
1593 groups (or values of the independent variable).
1594 If the total sum of the coefficients are not zero, then @pspp{} will
1595 display a warning, but will proceed with the analysis.
1596 The @subcmd{CONTRAST} subcommand may be given up to 10 times in order
1597 to specify different contrast tests.
1598 The @subcmd{MISSING} subcommand defines how missing values are handled.
1599 If @subcmd{LISTWISE} is specified then cases which have missing values for 
1600 the independent variable or any dependent variable will be ignored.
1601 If @subcmd{ANALYSIS} is specified, then cases will be ignored if the independent
1602 variable is missing or if the dependent variable currently being 
1603 analysed is missing.  The default is @subcmd{ANALYSIS}.
1604 A setting of @subcmd{EXCLUDE} means that variables whose values are
1605 user-missing are to be excluded from the analysis. A setting of
1606 @subcmd{INCLUDE} means they are to be included.  The default is @subcmd{EXCLUDE}.
1607
1608 Using the @code{POSTHOC} subcommand you can perform multiple
1609 pairwise comparisons on the data. The following comparison methods
1610 are available:
1611 @itemize
1612 @item @subcmd{LSD}
1613 Least Significant Difference.
1614 @item @subcmd{TUKEY}
1615 Tukey Honestly Significant Difference.
1616 @item @subcmd{BONFERRONI}
1617 Bonferroni test.
1618 @item @subcmd{SCHEFFE}
1619 Scheff@'e's test.
1620 @item @subcmd{SIDAK}
1621 Sidak test.
1622 @item @subcmd{GH}
1623 The Games-Howell test.
1624 @end itemize
1625
1626 @noindent
1627 The optional syntax @code{ALPHA(@var{value})} is used to indicate
1628 that @var{value} should be used as the
1629 confidence level for which the posthoc tests will be performed.
1630 The default is 0.05.
1631
1632 @node QUICK CLUSTER
1633 @section QUICK CLUSTER
1634 @vindex QUICK CLUSTER
1635
1636 @cindex K-means clustering
1637 @cindex clustering
1638
1639 @display
1640 QUICK CLUSTER @var{var_list}
1641       [/CRITERIA=CLUSTERS(@var{k}) [MXITER(@var{max_iter})]]
1642       [/MISSING=@{EXCLUDE,INCLUDE@} @{LISTWISE, PAIRWISE@}]
1643 @end display
1644
1645 The @cmd{QUICK CLUSTER} command performs k-means clustering on the
1646 dataset.  This is useful when you wish to allocate cases into clusters
1647 of similar values and you already know the number of clusters.
1648
1649 The minimum specification is @samp{QUICK CLUSTER} followed by the names
1650 of the variables which contain the cluster data.  Normally you will also
1651 want to specify @subcmd{/CRITERIA=CLUSTERS(@var{k})} where @var{k} is the
1652 number of clusters.  If this is not given, then @var{k} defaults to 2.
1653
1654 The command uses an iterative algorithm to determine the clusters for
1655 each case.  It will continue iterating until convergence, or until @var{max_iter}
1656 iterations have been done.  The default value of @var{max_iter} is 2.
1657
1658 The @subcmd{MISSING} subcommand determines the handling of missing variables.  
1659 If @subcmd{INCLUDE} is set, then user-missing values are considered at their face
1660 value and not as missing values.
1661 If @subcmd{EXCLUDE} is set, which is the default, user-missing
1662 values are excluded as well as system-missing values. 
1663
1664 If @subcmd{LISTWISE} is set, then the entire case is excluded from the analysis
1665 whenever any of the clustering variables contains a missing value.   
1666 If @subcmd{PAIRWISE} is set, then a case is considered missing only if all the
1667 clustering variables contain missing values.  Otherwise it is clustered
1668 on the basis of the non-missing values.
1669 The default is @subcmd{LISTWISE}.
1670
1671
1672 @node RANK
1673 @section RANK
1674
1675 @vindex RANK
1676 @display
1677 RANK
1678         [VARIABLES=] @var{var_list} [@{A,D@}] [BY @var{var_list}]
1679         /TIES=@{MEAN,LOW,HIGH,CONDENSE@}
1680         /FRACTION=@{BLOM,TUKEY,VW,RANKIT@}
1681         /PRINT[=@{YES,NO@}
1682         /MISSING=@{EXCLUDE,INCLUDE@}
1683
1684         /RANK [INTO @var{var_list}]
1685         /NTILES(k) [INTO @var{var_list}]
1686         /NORMAL [INTO @var{var_list}]
1687         /PERCENT [INTO @var{var_list}]
1688         /RFRACTION [INTO @var{var_list}]
1689         /PROPORTION [INTO @var{var_list}]
1690         /N [INTO @var{var_list}]
1691         /SAVAGE [INTO @var{var_list}]
1692 @end display
1693
1694 The @cmd{RANK} command ranks variables and stores the results into new
1695 variables. 
1696
1697 The @subcmd{VARIABLES} subcommand, which is mandatory, specifies one or
1698 more variables whose values are to be ranked.  
1699 After each variable, @samp{A} or @samp{D} may appear, indicating that
1700 the variable is to be ranked in ascending or descending order.
1701 Ascending is the default.
1702 If a @subcmd{BY} keyword appears, it should be followed by a list of variables
1703 which are to serve as group variables.  
1704 In this case, the cases are gathered into groups, and ranks calculated
1705 for each group.
1706
1707 The @subcmd{TIES} subcommand specifies how tied values are to be treated.  The
1708 default is to take the mean value of all the tied cases.
1709
1710 The @subcmd{FRACTION} subcommand specifies how proportional ranks are to be
1711 calculated.  This only has any effect if @subcmd{NORMAL} or @subcmd{PROPORTIONAL} rank
1712 functions are requested.
1713
1714 The @subcmd{PRINT} subcommand may be used to specify that a summary of the rank
1715 variables created should appear in the output.
1716
1717 The function subcommands are @subcmd{RANK}, @subcmd{NTILES}, @subcmd{NORMAL}, @subcmd{PERCENT}, @subcmd{RFRACTION},
1718 @subcmd{PROPORTION} and @subcmd{SAVAGE}.  Any number of function subcommands may appear.
1719 If none are given, then the default is RANK.
1720 The @subcmd{NTILES} subcommand must take an integer specifying the number of
1721 partitions into which values should be ranked.
1722 Each subcommand may be followed by the @subcmd{INTO} keyword and a list of
1723 variables which are the variables to be created and receive the rank
1724 scores.  There may be as many variables specified as there are
1725 variables named on the @subcmd{VARIABLES} subcommand.  If fewer are specified,
1726 then the variable names are automatically created.
1727
1728 The @subcmd{MISSING} subcommand determines how user missing values are to be
1729 treated. A setting of @subcmd{EXCLUDE} means that variables whose values are
1730 user-missing are to be excluded from the rank scores. A setting of
1731 @subcmd{INCLUDE} means they are to be included.  The default is @subcmd{EXCLUDE}.
1732
1733 @include regression.texi
1734
1735
1736 @node RELIABILITY
1737 @section RELIABILITY
1738
1739 @vindex RELIABILITY
1740 @display
1741 RELIABILITY
1742         /VARIABLES=@var{var_list}
1743         /SCALE (@var{name}) = @{@var{var_list}, ALL@}
1744         /MODEL=@{ALPHA, SPLIT[(@var{n})]@}
1745         /SUMMARY=@{TOTAL,ALL@}
1746         /MISSING=@{EXCLUDE,INCLUDE@}
1747 @end display
1748
1749 @cindex Cronbach's Alpha
1750 The @cmd{RELIABILITY} command performs reliability analysis on the data.
1751
1752 The @subcmd{VARIABLES} subcommand is required. It determines the set of variables 
1753 upon which analysis is to be performed.
1754
1755 The @subcmd{SCALE} subcommand determines which variables reliability is to be 
1756 calculated for.  If it is omitted, then analysis for all variables named
1757 in the @subcmd{VARIABLES} subcommand will be used.
1758 Optionally, the @var{name} parameter may be specified to set a string name 
1759 for the scale.
1760
1761 The @subcmd{MODEL} subcommand determines the type of analysis. If @subcmd{ALPHA} is specified, 
1762 then Cronbach's Alpha is calculated for the scale.  If the model is @subcmd{SPLIT}, 
1763 then the variables  are divided into 2 subsets.  An optional parameter 
1764 @var{n} may be given, to specify how many variables to be in the first subset.
1765 If @var{n} is omitted, then it defaults to one half of the variables in the 
1766 scale, or one half minus one if there are an odd number of variables.
1767 The default model is @subcmd{ALPHA}.
1768
1769 By default, any cases with user missing, or system missing values for 
1770 any variables given 
1771 in the @subcmd{VARIABLES} subcommand will be omitted from analysis.
1772 The @subcmd{MISSING} subcommand determines whether user missing values are to 
1773 be included or excluded in the analysis.
1774
1775 The @subcmd{SUMMARY} subcommand determines the type of summary analysis to be performed.
1776 Currently there is only one type: @subcmd{SUMMARY=TOTAL}, which displays per-item
1777 analysis tested against the totals.
1778
1779
1780
1781 @node ROC
1782 @section ROC
1783
1784 @vindex ROC
1785 @cindex Receiver Operating Characteristic
1786 @cindex Area under curve
1787
1788 @display
1789 ROC     @var{var_list} BY @var{state_var} (@var{state_value})
1790         /PLOT = @{ CURVE [(REFERENCE)], NONE @}
1791         /PRINT = [ SE ] [ COORDINATES ]
1792         /CRITERIA = [ CUTOFF(@{INCLUDE,EXCLUDE@}) ]
1793           [ TESTPOS (@{LARGE,SMALL@}) ]
1794           [ CI (@var{confidence}) ]
1795           [ DISTRIBUTION (@{FREE, NEGEXPO @}) ]
1796         /MISSING=@{EXCLUDE,INCLUDE@}
1797 @end display
1798
1799
1800 The @cmd{ROC} command is used to plot the receiver operating characteristic curve 
1801 of a dataset, and to estimate the area under the curve.
1802 This is useful for analysing the efficacy of a variable as a predictor of a state of nature.
1803
1804 The mandatory @var{var_list} is the list of predictor variables.
1805 The variable @var{state_var} is the variable whose values represent the actual states, 
1806 and @var{state_value} is the value of this variable which represents the positive state.
1807
1808 The optional subcommand @subcmd{PLOT} is used to determine if and how the @subcmd{ROC} curve is drawn.
1809 The keyword @subcmd{CURVE} means that the @subcmd{ROC} curve should be drawn, and the optional keyword @subcmd{REFERENCE},
1810 which should be enclosed in parentheses, says that the diagonal reference line should be drawn.
1811 If the keyword @subcmd{NONE} is given, then no @subcmd{ROC} curve is drawn.
1812 By default, the curve is drawn with no reference line.
1813
1814 The optional subcommand @subcmd{PRINT} determines which additional tables should be printed.
1815 Two additional tables are available. 
1816 The @subcmd{SE} keyword says that standard error of the area under the curve should be printed as well as
1817 the area itself.
1818 In addition, a p-value under the null hypothesis that the area under the curve equals 0.5 will be
1819 printed.
1820 The @subcmd{COORDINATES} keyword says that a table of coordinates of the @subcmd{ROC} curve should be printed.
1821
1822 The @subcmd{CRITERIA} subcommand has four optional parameters:
1823 @itemize @bullet
1824 @item The @subcmd{TESTPOS} parameter may be @subcmd{LARGE} or @subcmd{SMALL}.
1825 @subcmd{LARGE} is the default, and says that larger values in the predictor variables are to be 
1826 considered positive.  @subcmd{SMALL} indicates that smaller values should be considered positive.
1827
1828 @item The @subcmd{CI} parameter specifies the confidence interval that should be printed.
1829 It has no effect if the @subcmd{SE} keyword in the @subcmd{PRINT} subcommand has not been given.
1830
1831 @item The @subcmd{DISTRIBUTION} parameter determines the method to be used when estimating the area
1832 under the curve.  
1833 There are two possibilities, @i{viz}: @subcmd{FREE} and @subcmd{NEGEXPO}.
1834 The @subcmd{FREE} method uses a non-parametric estimate, and the @subcmd{NEGEXPO} method a bi-negative 
1835 exponential distribution estimate.
1836 The @subcmd{NEGEXPO} method should only be used when the number of positive actual states is
1837 equal to the number of negative actual states.
1838 The default is @subcmd{FREE}.
1839
1840 @item The @subcmd{CUTOFF} parameter is for compatibility and is ignored.
1841 @end itemize
1842
1843 The @subcmd{MISSING} subcommand determines whether user missing values are to 
1844 be included or excluded in the analysis.  The default behaviour is to
1845 exclude them.
1846 Cases are excluded on a listwise basis; if any of the variables in @var{var_list} 
1847 or if the variable @var{state_var} is missing, then the entire case will be 
1848 excluded.