Added an implementation of the median test
[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 * CORRELATIONS::                Correlation tables.
12 * CROSSTABS::                   Crosstabulation tables.
13 * FACTOR::                      Factor analysis and Principal Components analysis
14 * NPAR TESTS::                  Nonparametric tests.
15 * T-TEST::                      Test hypotheses about means.
16 * ONEWAY::                      One way analysis of variance.
17 * QUICK CLUSTER::               K-Means clustering.
18 * RANK::                        Compute rank scores.
19 * REGRESSION::                  Linear regression.
20 * RELIABILITY::                 Reliability analysis.
21 * ROC::                         Receiver Operating Characteristic.
22 @end menu
23
24 @node DESCRIPTIVES
25 @section DESCRIPTIVES
26
27 @vindex DESCRIPTIVES
28 @display
29 DESCRIPTIVES
30         /VARIABLES=var_list
31         /MISSING=@{VARIABLE,LISTWISE@} @{INCLUDE,NOINCLUDE@}
32         /FORMAT=@{LABELS,NOLABELS@} @{NOINDEX,INDEX@} @{LINE,SERIAL@}
33         /SAVE
34         /STATISTICS=@{ALL,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,
35                      SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,DEFAULT,
36                      SESKEWNESS,SEKURTOSIS@}
37         /SORT=@{NONE,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,SKEWNESS,
38                RANGE,MINIMUM,MAXIMUM,SUM,SESKEWNESS,SEKURTOSIS,NAME@}
39               @{A,D@}
40 @end display
41
42 The @cmd{DESCRIPTIVES} procedure reads the active dataset and outputs
43 descriptive
44 statistics requested by the user.  In addition, it can optionally
45 compute Z-scores.
46
47 The VARIABLES subcommand, which is required, specifies the list of
48 variables to be analyzed.  Keyword VARIABLES is optional.
49
50 All other subcommands are optional:
51
52 The MISSING subcommand determines the handling of missing variables.  If
53 INCLUDE is set, then user-missing values are included in the
54 calculations.  If NOINCLUDE is set, which is the default, user-missing
55 values are excluded.  If VARIABLE is set, then missing values are
56 excluded on a variable by variable basis; if LISTWISE is set, then
57 the entire case is excluded whenever any value in that case has a
58 system-missing or, if INCLUDE is set, user-missing value.
59
60 The FORMAT subcommand affects the output format.  Currently the
61 LABELS/NOLABELS and NOINDEX/INDEX settings are not used.  When SERIAL is
62 set, both valid and missing number of cases are listed in the output;
63 when NOSERIAL is set, only valid cases are listed.
64
65 The SAVE subcommand causes @cmd{DESCRIPTIVES} to calculate Z scores for all
66 the specified variables.  The Z scores are saved to new variables.
67 Variable names are generated by trying first the original variable name
68 with Z prepended and truncated to a maximum of 8 characters, then the
69 names ZSC000 through ZSC999, STDZ00 through STDZ09, ZZZZ00 through
70 ZZZZ09, ZQZQ00 through ZQZQ09, in that sequence.  In addition, Z score
71 variable names can be specified explicitly on VARIABLES in the variable
72 list by enclosing them in parentheses after each variable.
73
74 The STATISTICS subcommand specifies the statistics to be displayed:
75
76 @table @code
77 @item ALL
78 All of the statistics below.
79 @item MEAN
80 Arithmetic mean.
81 @item SEMEAN
82 Standard error of the mean.
83 @item STDDEV
84 Standard deviation.
85 @item VARIANCE
86 Variance.
87 @item KURTOSIS
88 Kurtosis and standard error of the kurtosis.
89 @item SKEWNESS
90 Skewness and standard error of the skewness.
91 @item RANGE
92 Range.
93 @item MINIMUM
94 Minimum value.
95 @item MAXIMUM
96 Maximum value.
97 @item SUM
98 Sum.
99 @item DEFAULT
100 Mean, standard deviation of the mean, minimum, maximum.
101 @item SEKURTOSIS
102 Standard error of the kurtosis.
103 @item SESKEWNESS
104 Standard error of the skewness.
105 @end table
106
107 The SORT subcommand specifies how the statistics should be sorted.  Most
108 of the possible values should be self-explanatory.  NAME causes the
109 statistics to be sorted by name.  By default, the statistics are listed
110 in the order that they are specified on the VARIABLES subcommand.  The A
111 and D settings request an ascending or descending sort order,
112 respectively.
113
114 @node FREQUENCIES
115 @section FREQUENCIES
116
117 @vindex FREQUENCIES
118 @display
119 FREQUENCIES
120         /VARIABLES=var_list
121         /FORMAT=@{TABLE,NOTABLE,LIMIT(limit)@}
122                 @{AVALUE,DVALUE,AFREQ,DFREQ@}
123         /MISSING=@{EXCLUDE,INCLUDE@}
124         /STATISTICS=@{DEFAULT,MEAN,SEMEAN,MEDIAN,MODE,STDDEV,VARIANCE,
125                      KURTOSIS,SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,
126                      SESKEWNESS,SEKURTOSIS,ALL,NONE@}
127         /NTILES=ntiles
128         /PERCENTILES=percent@dots{}
129         /HISTOGRAM=[MINIMUM(x_min)] [MAXIMUM(x_max)] 
130                    [@{FREQ[(y_max)],PERCENT[(y_max)]@}] [@{NONORMAL,NORMAL@}]
131         /PIECHART=[MINIMUM(x_min)] [MAXIMUM(x_max)]
132                   [@{FREQ,PERCENT@}] [@{NOMISSING,MISSING@}]
133
134 (These options are not currently implemented.)
135         /BARCHART=@dots{}
136         /HBAR=@dots{}
137         /GROUPED=@dots{}
138 @end display
139
140 The @cmd{FREQUENCIES} procedure outputs frequency tables for specified
141 variables.
142 @cmd{FREQUENCIES} can also calculate and display descriptive statistics
143 (including median and mode) and percentiles,
144 @cmd{FREQUENCIES} can also output
145 histograms and pie charts.  
146
147 The VARIABLES subcommand is the only required subcommand.  Specify the
148 variables to be analyzed.
149
150 The FORMAT subcommand controls the output format.  It has several
151 possible settings:  
152
153 @itemize @bullet
154 @item
155 TABLE, the default, causes a frequency table to be output for every
156 variable specified.  NOTABLE prevents them from being output.  LIMIT
157 with a numeric argument causes them to be output except when there are
158 more than the specified number of values in the table.
159
160 @item
161 Normally frequency tables are sorted in ascending order by value.  This
162 is AVALUE.  DVALUE tables are sorted in descending order by value.
163 AFREQ and DFREQ tables are sorted in ascending and descending order,
164 respectively, by frequency count.
165 @end itemize
166
167 The MISSING subcommand controls the handling of user-missing values.
168 When EXCLUDE, the default, is set, user-missing values are not included
169 in frequency tables or statistics.  When INCLUDE is set, user-missing
170 are included.  System-missing values are never included in statistics,
171 but are listed in frequency tables.
172
173 The available STATISTICS are the same as available in @cmd{DESCRIPTIVES}
174 (@pxref{DESCRIPTIVES}), with the addition of MEDIAN, the data's median
175 value, and MODE, the mode.  (If there are multiple modes, the smallest
176 value is reported.)  By default, the mean, standard deviation of the
177 mean, minimum, and maximum are reported for each variable.
178
179 @cindex percentiles
180 PERCENTILES causes the specified percentiles to be reported.
181 The percentiles should  be presented at a list of numbers between 0
182 and 100 inclusive.  
183 The NTILES subcommand causes the percentiles to be reported at the
184 boundaries of the data set divided into the specified number of ranges.
185 For instance, @code{/NTILES=4} would cause quartiles to be reported.
186
187 @cindex histogram
188 The HISTOGRAM subcommand causes the output to include a histogram for
189 each specified numeric variable.  The X axis by default ranges from
190 the minimum to the maximum value observed in the data, but the MINIMUM
191 and MAXIMUM keywords can set an explicit range.  Specify NORMAL to
192 superimpose a normal curve on the histogram.  Histograms are not
193 created for string variables.
194
195 @cindex piechart
196 The PIECHART adds a pie chart for each variable to the data.  Each
197 slice represents one value, with the size of the slice proportional to
198 the value's frequency.  By default, all non-missing values are given
199 slices.  The MINIMUM and MAXIMUM keywords can be used to limit the
200 displayed slices to a given range of values.  The MISSING keyword adds
201 slices for missing values.
202
203 The FREQ and PERCENT options on HISTOGRAM and PIECHART are accepted
204 but not currently honored.
205
206 @node EXAMINE
207 @comment  node-name,  next,  previous,  up
208 @section EXAMINE
209 @vindex EXAMINE
210
211 @cindex Normality, testing for
212
213 @display
214 EXAMINE
215         VARIABLES=var_list [BY factor_list ]
216         /STATISTICS=@{DESCRIPTIVES, EXTREME[(n)], ALL, NONE@}
217         /PLOT=@{BOXPLOT, NPPLOT, HISTOGRAM, ALL, NONE@}
218         /CINTERVAL n
219         /COMPARE=@{GROUPS,VARIABLES@}
220         /ID=var_name
221         /@{TOTAL,NOTOTAL@}
222         /PERCENTILE=[value_list]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @}
223         /MISSING=@{LISTWISE, PAIRWISE@} [@{EXCLUDE, INCLUDE@}] 
224                 [@{NOREPORT,REPORT@}]
225
226 @end display
227
228 The @cmd{EXAMINE} command is used to test how closely a distribution is to a 
229 normal distribution.  It also shows you outliers and extreme values.
230
231 The VARIABLES subcommand specifies the dependent variables and the
232 independent variable to use as factors for the analysis.   Variables
233 listed before the first BY keyword are the dependent variables.
234 The dependent variables may optionally be followed by a list of
235 factors which tell PSPP how to break down the analysis for each
236 dependent variable.  The format for each factor is 
237 @display
238 var [BY var].
239 @end display
240
241
242 The STATISTICS subcommand specifies the analysis to be done.  
243 DESCRIPTIVES will produce a table showing some parametric and
244 non-parametrics statistics.  EXTREME produces a table showing extreme
245 values of the dependent variable.  A number in parentheses determines
246 how many upper and lower extremes to show.  The default number is 5.
247
248
249 @cindex boxplot
250 @cindex histogram
251 @cindex npplot
252 The PLOT subcommand specifies which plots are to be produced if any.
253 Available plots are HISTOGRAM, NPPLOT and BOXPLOT.
254
255 The COMPARE subcommand is only relevant if producing boxplots, and it is only 
256 useful there is more than one dependent variable and at least one factor.   If 
257 /COMPARE=GROUPS is specified, then one plot per dependent variable is produced,
258 containing boxplots for all the factors.
259 If /COMPARE=VARIABLES is specified, then one plot per factor is produced, each 
260 each containing one boxplot per dependent variable.
261 If the /COMPARE subcommand is ommitted, then PSPP uses the default value of 
262 /COMPARE=GROUPS.
263  
264 The ID subcommand also pertains to boxplots.  If given, it must
265 specify a variable name.   Outliers and extreme cases plotted in
266 boxplots will be labelled with the case from that variable.  Numeric or
267 string variables are permissible.  If the ID subcommand is not given,
268 then the casenumber will be used for labelling.
269
270 The CINTERVAL subcommand specifies the confidence interval to use in
271 calculation of the descriptives command.  The default it 95%.
272
273 @cindex percentiles
274 The PERCENTILES subcommand specifies which percentiles are to be calculated, 
275 and which algorithm to use for calculating them.  The default is to
276 calculate the 5, 10, 25, 50, 75, 90, 95 percentiles using the
277 HAVERAGE algorithm.
278
279 The TOTAL and NOTOTAL subcommands are mutually exclusive.  If NOTOTAL
280 is given and factors have been specified in the VARIABLES subcommand,
281 then then statistics for the unfactored dependent variables are
282 produced in addition to the factored variables.  If there are no
283 factors specified then TOTAL and NOTOTAL have no effect.
284
285 @strong{Warning!}
286 If many dependent variable are given, or factors are given for which
287 there are many distinct values, then @cmd{EXAMINE} will produce a very
288 large quantity of output.
289
290 @node CORRELATIONS
291 @section CORRELATIONS
292
293 @vindex CORRELATIONS
294 @display
295 CORRELATIONS
296      /VARIABLES = varlist [ WITH varlist ]
297      [
298       .
299       .
300       .
301       /VARIABLES = varlist [ WITH varlist ]
302       /VARIABLES = varlist [ WITH varlist ]
303      ]
304
305      [ /PRINT=@{TWOTAIL, ONETAIL@} @{SIG, NOSIG@} ]
306      [ /STATISTICS=DESCRIPTIVES XPROD ALL]
307      [ /MISSING=@{PAIRWISE, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
308 @end display    
309
310 @cindex correlation
311 The @cmd{CORRELATIONS} procedure produces tables of the Pearson correlation coefficient
312 for a set of variables.  The significance of the coefficients are also given.
313
314 At least one VARIABLES subcommand is required. If the WITH keyword is used, then a non-square
315 correlation table will be produced.
316 The variables preceding WITH, will be used as the rows of the table, and the variables following
317 will be the columns of the table.
318 If no WITH subcommand is given, then a square, symmetrical table using all variables is produced.
319
320
321 The @cmd{MISSING} subcommand determines the handling of missing variables.  
322 If INCLUDE is set, then user-missing values are included in the
323 calculations, but system-missing values are not.
324 If EXCLUDE is set, which is the default, user-missing
325 values are excluded as well as system-missing values. 
326 This is the default.
327
328 If LISTWISE is set, then the entire case is excluded from analysis
329 whenever any variable  specified in any @cmd{/VARIABLES} subcommand
330 contains a missing value.   
331 If PAIRWISE is set, then a case is considered missing only if either of the
332 values  for the particular coefficient are missing.
333 The default is PAIRWISE.
334
335 The PRINT subcommand is used to control how the reported significance values are printed.
336 If the TWOTAIL option is used, then a two-tailed test of significance is 
337 printed.  If the ONETAIL option is given, then a one-tailed test is used.
338 The default is TWOTAIL.
339
340 If the NOSIG option is specified, then correlation coefficients with significance less than
341 0.05 are highlighted.
342 If SIG is specified, then no highlighting is performed.  This is the default.
343
344 @cindex covariance
345 The STATISTICS subcommand requests additional statistics to be displayed.  The keyword 
346 DESCRIPTIVES requests that the mean, number of non-missing cases, and the non-biased
347 estimator of the standard deviation are displayed.
348 These statistics will be displayed in a separated table, for all the variables listed
349 in any /VARIABLES subcommand.
350 The XPROD keyword requests cross-product deviations and covariance estimators to 
351 be displayed for each pair of variables.
352 The keyword ALL is the union of DESCRIPTIVES and XPROD.
353
354 @node CROSSTABS
355 @section CROSSTABS
356
357 @vindex CROSSTABS
358 @display
359 CROSSTABS
360         /TABLES=var_list BY var_list [BY var_list]@dots{}
361         /MISSING=@{TABLE,INCLUDE,REPORT@}
362         /WRITE=@{NONE,CELLS,ALL@}
363         /FORMAT=@{TABLES,NOTABLES@}
364                 @{LABELS,NOLABELS,NOVALLABS@}
365                 @{PIVOT,NOPIVOT@}
366                 @{AVALUE,DVALUE@}
367                 @{NOINDEX,INDEX@}
368                 @{BOX,NOBOX@}
369         /CELLS=@{COUNT,ROW,COLUMN,TOTAL,EXPECTED,RESIDUAL,SRESIDUAL,
370                 ASRESIDUAL,ALL,NONE@}
371         /STATISTICS=@{CHISQ,PHI,CC,LAMBDA,UC,BTAU,CTAU,RISK,GAMMA,D,
372                      KAPPA,ETA,CORR,ALL,NONE@}
373         
374 (Integer mode.)
375         /VARIABLES=var_list (low,high)@dots{}
376 @end display
377
378 The @cmd{CROSSTABS} procedure displays crosstabulation
379 tables requested by the user.  It can calculate several statistics for
380 each cell in the crosstabulation tables.  In addition, a number of
381 statistics can be calculated for each table itself.
382
383 The TABLES subcommand is used to specify the tables to be reported.  Any
384 number of dimensions is permitted, and any number of variables per
385 dimension is allowed.  The TABLES subcommand may be repeated as many
386 times as needed.  This is the only required subcommand in @dfn{general
387 mode}.  
388
389 Occasionally, one may want to invoke a special mode called @dfn{integer
390 mode}.  Normally, in general mode, PSPP automatically determines
391 what values occur in the data.  In integer mode, the user specifies the
392 range of values that the data assumes.  To invoke this mode, specify the
393 VARIABLES subcommand, giving a range of data values in parentheses for
394 each variable to be used on the TABLES subcommand.  Data values inside
395 the range are truncated to the nearest integer, then assigned to that
396 value.  If values occur outside this range, they are discarded.  When it
397 is present, the VARIABLES subcommand must precede the TABLES
398 subcommand.
399
400 In general mode, numeric and string variables may be specified on
401 TABLES.  In integer mode, only numeric variables are allowed.
402
403 The MISSING subcommand determines the handling of user-missing values.
404 When set to TABLE, the default, missing values are dropped on a table by
405 table basis.  When set to INCLUDE, user-missing values are included in
406 tables and statistics.  When set to REPORT, which is allowed only in
407 integer mode, user-missing values are included in tables but marked with
408 an @samp{M} (for ``missing'') and excluded from statistical
409 calculations.
410
411 Currently the WRITE subcommand is ignored.
412
413 The FORMAT subcommand controls the characteristics of the
414 crosstabulation tables to be displayed.  It has a number of possible
415 settings:
416
417 @itemize @bullet
418 @item
419 TABLES, the default, causes crosstabulation tables to be output.
420 NOTABLES suppresses them.
421
422 @item
423 LABELS, the default, allows variable labels and value labels to appear
424 in the output.  NOLABELS suppresses them.  NOVALLABS displays variable
425 labels but suppresses value labels.
426
427 @item
428 PIVOT, the default, causes each TABLES subcommand to be displayed in a
429 pivot table format.  NOPIVOT causes the old-style crosstabulation format
430 to be used.
431
432 @item
433 AVALUE, the default, causes values to be sorted in ascending order.
434 DVALUE asserts a descending sort order.
435
436 @item
437 INDEX/NOINDEX is currently ignored.
438
439 @item
440 BOX/NOBOX is currently ignored.
441 @end itemize
442
443 The CELLS subcommand controls the contents of each cell in the displayed
444 crosstabulation table.  The possible settings are:
445
446 @table @asis
447 @item COUNT
448 Frequency count.
449 @item ROW
450 Row percent.
451 @item COLUMN
452 Column percent.
453 @item TOTAL
454 Table percent.
455 @item EXPECTED
456 Expected value.
457 @item RESIDUAL 
458 Residual.
459 @item SRESIDUAL
460 Standardized residual.
461 @item ASRESIDUAL
462 Adjusted standardized residual.
463 @item ALL
464 All of the above.
465 @item NONE
466 Suppress cells entirely.
467 @end table
468
469 @samp{/CELLS} without any settings specified requests COUNT, ROW,
470 COLUMN, and TOTAL.  If CELLS is not specified at all then only COUNT
471 will be selected.
472
473 The STATISTICS subcommand selects statistics for computation:
474
475 @table @asis
476 @item CHISQ
477 @cindex chisquare
478 @cindex chi-square
479
480 Pearson chi-square, likelihood ratio, Fisher's exact test, continuity
481 correction, linear-by-linear association.
482 @item PHI
483 Phi.
484 @item CC
485 Contingency coefficient.
486 @item LAMBDA
487 Lambda.
488 @item UC
489 Uncertainty coefficient.
490 @item BTAU
491 Tau-b.
492 @item CTAU
493 Tau-c.
494 @item RISK
495 Risk estimate.
496 @item GAMMA
497 Gamma.
498 @item D
499 Somers' D.
500 @item KAPPA
501 Cohen's Kappa.
502 @item ETA
503 Eta.
504 @item CORR
505 Spearman correlation, Pearson's r.
506 @item ALL
507 All of the above.
508 @item NONE
509 No statistics.
510 @end table
511
512 Selected statistics are only calculated when appropriate for the
513 statistic.  Certain statistics require tables of a particular size, and
514 some statistics are calculated only in integer mode.
515
516 @samp{/STATISTICS} without any settings selects CHISQ.  If the
517 STATISTICS subcommand is not given, no statistics are calculated.
518
519 @strong{Please note:} Currently the implementation of CROSSTABS has the
520 followings bugs:
521
522 @itemize @bullet
523 @item
524 Pearson's R (but not Spearman) is off a little.
525 @item
526 T values for Spearman's R and Pearson's R are wrong.
527 @item
528 Significance of symmetric and directional measures is not calculated.
529 @item
530 Asymmetric ASEs and T values for lambda are wrong.
531 @item
532 ASE of Goodman and Kruskal's tau is not calculated.
533 @item
534 ASE of symmetric somers' d is wrong.
535 @item
536 Approximate T of uncertainty coefficient is wrong.
537 @end itemize
538
539 Fixes for any of these deficiencies would be welcomed.
540
541 @node FACTOR
542 @section FACTOR
543
544 @vindex FACTOR
545 @cindex factor analysis
546 @cindex principal components analysis
547 @cindex principal axis factoring
548 @cindex data reduction
549
550 @display
551 FACTOR  VARIABLES=var_list
552
553         [ /METHOD = @{CORRELATION, COVARIANCE@} ]
554
555         [ /EXTRACTION=@{PC, PAF@}] 
556
557         [ /ROTATION=@{VARIMAX, EQUAMAX, QUARTIMAX, NOROTATE@}]
558
559         [ /PRINT=[INITIAL] [EXTRACTION] [ROTATION] [UNIVARIATE] [CORRELATION] [COVARIANCE] [DET] [KMO] [SIG] [ALL] [DEFAULT] ]
560
561         [ /PLOT=[EIGEN] ]
562
563         [ /FORMAT=[SORT] [BLANK(@var{n})] [DEFAULT] ]
564
565         [ /CRITERIA=[FACTORS(@var{n})] [MINEIGEN(@var{l})] [ITERATE(@var{m})] [ECONVERGE (@var{delta})] [DEFAULT] ]
566
567         [ /MISSING=[@{LISTWISE, PAIRWISE@}] [@{INCLUDE, EXCLUDE@}] ]
568 @end display
569
570 The FACTOR command performs Factor Analysis or Principal Axis Factoring on a dataset.  It may be used to find
571 common factors in the data or for data reduction purposes.
572
573 The VARIABLES subcommand is required.  It lists the variables which are to partake in the analysis.
574
575 The /EXTRACTION subcommand is used to specify the way in which factors (components) are extracted from the data.
576 If PC is specified, then Principal Components Analysis is used.  If PAF is specified, then Principal Axis Factoring is
577 used. By default Principal Components Analysis will be used.
578
579 The /ROTATION subcommand is used to specify the method by which the extracted solution will be rotated.
580 Three methods are available: VARIMAX (which is the default), EQUAMAX, and QUARTIMAX.
581 If don't want any rotation to be performed, the word NOROTATE will prevent the command from performing any
582 rotation on the data. Oblique rotations are not supported.
583
584 The /METHOD subcommand should be used to determine whether the covariance matrix or the correlation matrix of the data is
585 to be analysed.  By default, the correlation matrix is analysed.
586
587 The /PRINT subcommand may be used to select which features of the analysis are reported:
588
589 @itemize
590 @item UNIVARIATE
591       A table of mean values, standard deviations and total weights are printed.
592 @item INITIAL
593       Initial communalities and eigenvalues are printed.
594 @item EXTRACTION
595       Extracted communalities and eigenvalues are printed.
596 @item ROTATION
597       Rotated communalities and eigenvalues are printed.
598 @item CORRELATION
599       The correlation matrix is printed.
600 @item COVARIANCE
601       The covariance matrix is printed.
602 @item DET
603       The determinant of the correlation or covariance matrix is printed.
604 @item KMO
605       The Kaiser-Meyer-Olkin measure of sampling adequacy and the Bartlett test of sphericity is printed.
606 @item SIG
607       The significance of the elements of correlation matrix is printed.
608 @item ALL
609       All of the above are printed.
610 @item DEFAULT
611       Identical to INITIAL and EXTRACTION.
612 @end itemize
613
614 If /PLOT=EIGEN is given, then a ``Scree'' plot of the eigenvalues will be printed.  This can be useful for visualising
615 which factors (components) should be retained.
616
617 The /FORMAT subcommand determined how data are to be displayed in loading matrices.  If SORT is specified, then the variables
618 are sorted in descending order of significance.  If BLANK(@var{n}) is specified, then coefficients whose absolute value is less
619 than @var{n} will not be printed.  If the keyword DEFAULT is given, or if no /FORMAT subcommand is given, then no sorting is 
620 performed, and all coefficients will be printed.
621
622 The /CRITERIA subcommand is used to specify how the number of extracted factors (components) are chosen.  If FACTORS(@var{n}) is
623 specified, where @var{n} is an integer, then @var{n} factors will be extracted.  Otherwise, the MINEIGEN setting will
624 be used.  MINEIGEN(@var{l}) requests that all factors whose eigenvalues are greater than or equal to @var{l} are extracted.
625 The default value of @var{l} is 1.    The ECONVERGE and ITERATE settings have effect only when iterative algorithms for factor
626 extraction (such as Principal Axis Factoring) are used.   ECONVERGE(@var{delta}) specifies that iteration should cease when
627 the maximum absolute value of the communality estimate between one iteration and the previous is less than @var{delta}. The
628 default value of @var{delta} is 0.001.
629 The ITERATE(@var{m}) setting sets the maximum number of iterations to @var{m}.  The default value of @var{m} is 25.
630
631 The @cmd{MISSING} subcommand determines the handling of missing variables.  
632 If INCLUDE is set, then user-missing values are included in the
633 calculations, but system-missing values are not.
634 If EXCLUDE is set, which is the default, user-missing
635 values are excluded as well as system-missing values. 
636 This is the default.
637 If LISTWISE is set, then the entire case is excluded from analysis
638 whenever any variable  specified in the @cmd{VARIABLES} subcommand
639 contains a missing value.   
640 If PAIRWISE is set, then a case is considered missing only if either of the
641 values  for the particular coefficient are missing.
642 The default is LISTWISE.
643  
644
645 @node NPAR TESTS
646 @section NPAR TESTS
647
648 @vindex NPAR TESTS
649 @cindex nonparametric tests
650
651 @display 
652 NPAR TESTS
653      
654      nonparametric test subcommands
655      .
656      .
657      .
658      
659      [ /STATISTICS=@{DESCRIPTIVES@} ]
660
661      [ /MISSING=@{ANALYSIS, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
662
663      [ /METHOD=EXACT [ TIMER [(n)] ] ]
664 @end display
665
666 NPAR TESTS performs nonparametric tests. 
667 Non parametric tests make very few assumptions about the distribution of the 
668 data.
669 One or more tests may be specified by using the corresponding subcommand.
670 If the /STATISTICS subcommand is also specified, then summary statistics are 
671 produces for each variable that is the subject of any test.
672
673 Certain tests may take a long time to execute, if an exact figure is required.
674 Therefore, by default asymptotic approximations are used unless the
675 subcommand /METHOD=EXACT is specified.  
676 Exact tests give more accurate results, but may take an unacceptably long 
677 time to perform.  If the TIMER keyword is used, it sets a maximum time,
678 after which the test will be abandoned, and a warning message printed.
679 The time, in minutes, should be specified in parentheses after the TIMER keyword.
680 If the TIMER keyword is given without this figure, then a default value of 5 minutes 
681 is used.
682
683
684 @menu
685 * BINOMIAL::                Binomial Test
686 * CHISQUARE::               Chisquare Test
687 * COCHRAN::                 Cochran Q Test
688 * FRIEDMAN::                Friedman Test
689 * KENDALL::                 Kendall's W Test
690 * KOLMOGOROV-SMIRNOV::      Kolmogorov Smirnov Test
691 * KRUSKAL-WALLIS::          Kruskal-Wallis Test
692 * MANN-WHITNEY::            Mann Whitney U Test
693 * MCNEMAR::                 McNemar Test
694 * MEDIAN::                  Median Test
695 * RUNS::                    Runs Test
696 * SIGN::                    The Sign Test
697 * WILCOXON::                Wilcoxon Signed Ranks Test
698 @end menu
699
700
701 @node    BINOMIAL
702 @subsection Binomial test
703 @vindex BINOMIAL
704 @cindex binomial test
705
706 @display 
707      [ /BINOMIAL[(p)]=var_list[(value1[, value2)] ] ]
708 @end display 
709
710 The /BINOMIAL subcommand compares the observed distribution of a dichotomous 
711 variable with that of a binomial distribution.
712 The variable @var{p} specifies the test proportion of the binomial 
713 distribution.  
714 The default value of 0.5 is assumed if @var{p} is omitted.
715
716 If a single value appears after the variable list, then that value is
717 used as the threshold to partition the observed values. Values less
718 than or equal to the threshold value form the first category.  Values
719 greater than the threshold form the second category. 
720
721 If two values appear after the variable list, then they will be used
722 as the values which a variable must take to be in the respective
723 category. 
724 Cases for which a variable takes a value equal to neither of the specified  
725 values, take no part in the test for that variable.
726
727 If no values appear, then the variable must assume dichotomous
728 values.
729 If more than two distinct, non-missing values for a variable
730 under test are encountered then an error occurs.
731
732 If the test proportion is equal to 0.5, then a two tailed test is
733 reported.   For any other test proportion, a one tailed test is
734 reported.   
735 For one tailed tests, if the test proportion is less than
736 or equal to the observed proportion, then the significance of
737 observing the observed proportion or more is reported.
738 If the test proportion is more than the observed proportion, then the
739 significance of observing the observed proportion or less is reported.
740 That is to say, the test is always performed in the observed
741 direction. 
742
743 PSPP uses a very precise approximation to the gamma function to
744 compute the binomial significance.  Thus, exact results are reported
745 even for very large sample sizes.
746
747
748
749 @node    CHISQUARE
750 @subsection Chisquare Test
751 @vindex CHISQUARE
752 @cindex chisquare test
753
754
755 @display
756      [ /CHISQUARE=var_list[(lo,hi)] [/EXPECTED=@{EQUAL|f1, f2 @dots{} fn@}] ]
757 @end display 
758
759
760 The /CHISQUARE subcommand produces a chi-square statistic for the differences 
761 between the expected and observed frequencies of the categories of a variable. 
762 Optionally, a range of values may appear after the variable list.  
763 If a range is given, then non integer values are truncated, and values
764 outside the  specified range are excluded from the analysis.
765
766 The /EXPECTED subcommand specifies the expected values of each
767 category.  
768 There must be exactly one non-zero expected value, for each observed
769 category, or the EQUAL keywork must be specified.
770 You may use the notation @var{n}*@var{f} to specify @var{n}
771 consecutive expected categories all taking a frequency of @var{f}.
772 The frequencies given are proportions, not absolute frequencies.  The
773 sum of the frequencies need not be 1.
774 If no /EXPECTED subcommand is given, then then equal frequencies 
775 are expected.
776
777
778 @node COCHRAN
779 @subsection Cochran Q Test
780 @vindex Cochran
781 @cindex Cochran Q test
782 @cindex Q, Cochran Q
783
784 @display
785      [ /COCHRAN = varlist ]
786 @end display
787
788 The Cochran Q test is used to test for differences between three or more groups.
789 The data for @var{varlist} in all cases must assume exactly two distinct values (other than missing values). 
790
791 The value of Q will be displayed and its Asymptotic significance based on a chi-square distribution.
792
793 @node FRIEDMAN
794 @subsection Friedman Test
795 @vindex FRIEDMAN
796 @cindex Friedman test
797
798 @display
799      [ /FRIEDMAN = varlist ]
800 @end display
801
802 The Friedman test is used to test for differences between repeated measures when there is no indication that the distributions are normally distributed.
803
804 A list of variables which contain the measured data must be given.  The procedure prints the sum of ranks for each variable, the test statistic and its significance.
805
806 @node KENDALL
807 @subsection Kendall's W Test
808 @vindex KENDALL
809 @cindex Kendall's W test
810 @cindex coefficient of concordance
811
812 @display
813      [ /KENDALL = varlist ]
814 @end display
815
816 The Kendall test investigates whether an arbitrary number of related samples come from the 
817 same population.
818 It is identical to the Friedman test except that the additional statistic W, Kendall's Coefficient of Concordance is printed.
819 It has the range [0,1] --- a value of zero indicates no agreement between the samples whereas a value of
820 unity indicates complete agreement.
821
822
823 @node KOLMOGOROV-SMIRNOV
824 @subsection Kolmogorov-Smirnov Test
825 @vindex KOLMOGOROV-SMIRNOV
826 @vindex K-S
827 @cindex Kolmogorov-Smirnov test
828
829 @display
830      [ /KOLMOGOROV-SMIRNOV (@{NORMAL [@var{mu}, @var{sigma}], UNIFORM [@var{min}, @var{max}], POISSON [@var{lambda}], EXPONENTIAL [@var{scale}] @}) = varlist ]
831 @end display
832
833 The one sample Kolmogorov-Smirnov subcommand is used to test whether or not a dataset is
834 drawn from a particular distribution.  Four distributions are supported, @i{viz:}
835 Normal, Uniform, Poisson and Exponential.
836
837 Ideally you should provide the parameters of the distribution against which you wish to test
838 the data. For example, with the normal distribution  the mean (@var{mu})and standard deviation (@var{sigma})
839 should be given; with the uniform distribution, the minimum (@var{min})and maximum (@var{max}) value should
840 be provided.
841 However, if the parameters are omitted they will be imputed from the data. Imputing the
842 parameters reduces the power of the test so should be avoided if possible.
843
844 In the following example, two variables @var{score} and @var{age} are tested to see if
845 they follow a normal distribution with a mean of 3.5 and a standard deviation of 2.0.
846 @example
847   NPAR TESTS
848         /KOLMOGOROV-SMIRNOV (normal 3.5 2.0) = @var{score} @var{age}.
849 @end example
850 If the variables need to be tested against different distributions, then a seperate
851 subcommand must be used.  For example the following syntax tests @var{score} against
852 a normal distribution with mean of 3.5 and standard deviation of 2.0 whilst @var{age}
853 is tested against a normal distribution of mean 40 and standard deviation 1.5.
854 @example
855   NPAR TESTS
856         /KOLMOGOROV-SMIRNOV (normal 3.5 2.0) = @var{score}
857         /KOLMOGOROV-SMIRNOV (normal 40 1.5) =  @var{age}.
858 @end example
859
860 The abbreviated subcommand  K-S may be used in place of KOLMOGOROV-SMIRNOV.
861
862 @node KRUSKAL-WALLIS
863 @subsection Kruskal-Wallis Test
864 @vindex KRUSKAL-WALLIS
865 @vindex K-W
866 @cindex Kruskal-Wallis test
867
868 @display
869      [ /KRUSKAL-WALLIS = varlist BY var (lower, upper) ]
870 @end display
871
872 The Kruskal-Wallis test is used to compare data from an 
873 arbitrary number of populations.  It does not assume normality.
874 The data to be compared are specified by @var{varlist}.
875 The categorical variable determining the groups to which the
876 data belongs is given by @var{var}. The limits @var{lower} and
877 @var{upper} specify the valid range of @var{var}. Any cases for
878 which @var{var} falls outside [@var{lower}, @var{upper}] will be
879 ignored.
880
881 The mean rank of each group as well as the chi-squared value and significance
882 of the test will be printed.
883 The abbreviated subcommand  K-W may be used in place of KRUSKAL-WALLIS.
884
885
886 @node MANN-WHITNEY
887 @subsection Mann-Whitney U Test
888 @vindex MANN-WHITNEY
889 @vindex M-W
890 @cindex Mann-Whitney U test
891 @cindex U, Mann-Whitney U
892
893 @display
894      [ /MANN-WHITNEY = varlist BY var (group1, group2) ]
895 @end display
896
897 The Mann-Whitney subcommand is used to test whether two groups of data come from different populations.
898 The variables to be tested should be specified in @var{varlist} and the grouping variable, that determines to which group the test variables belong, in @var{var}.
899 @var{Var} may be either a string or an alpha variable.
900 @var{Group1} and @var{group2} specify the
901 two values of @var{var} which determine the groups of the test data.
902 Cases for which the @var{var} value is neither @var{group1} or @var{group2} will be ignored.
903
904 The value of the Mann-Whitney U statistic, the Wilcoxon W, and the significance will be printed.
905 The abbreviated subcommand  M-W may be used in place of MANN-WHITNEY.
906
907 @node MCNEMAR
908 @subsection McNemar Test
909 @vindex MCNEMAR
910 @cindex McNemar test
911
912 @display
913      [ /MCNEMAR varlist [ WITH varlist [ (PAIRED) ]]]
914 @end display
915
916 Use McNemar's test to analyse the significance of the difference between
917 pairs of correlated proportions.
918
919 If the @code{WITH} keyword is omitted, then tests for all
920 combinations of the listed variables are performed.
921 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
922 is also given, then the number of variables preceding @code{WITH}
923 must be the same as the number following it.
924 In this case, tests for each respective pair of variables are
925 performed.
926 If the @code{WITH} keyword is given, but the
927 @code{(PAIRED)} keyword is omitted, then tests for each combination
928 of variable preceding @code{WITH} against variable following
929 @code{WITH} are performed.
930
931 The data in each variable must be dichotomous.  If there are more
932 than two distinct variables an error will occur and the test will
933 not be run.
934
935 @node MEDIAN
936 @subsection Median Test
937 @vindex MEDIAN
938 @cindex Median test
939
940 @display
941      [ /MEDIAN [(value)] = varlist BY variable (value1, value2) ]
942 @end display
943
944 The median test is used to test whether independent samples come from 
945 populations with a common median.
946 The median of the populations against which the samples are to be tested
947 may be given in parentheses immediately after the 
948 /MEDIAN subcommand.  If it is not given, the median will be imputed from the 
949 union of all the samples.
950
951 The variables of the samples to be tested should immediately follow the @samp{=} sign. The
952 keyword @code{BY} must come next, and then the grouping variable.  Two values
953 in parentheses should follow.  If the first value is greater than the second,
954 then a 2 sample test is performed using these two values to determine the groups.
955 If however, the first variable is less than the second, then a @i{k} sample test is
956 conducted and the group values used are all values encountered which lie in the
957 range [@var{value1},@var{value2}].
958
959
960 @node RUNS
961 @subsection Runs Test
962 @vindex RUNS
963 @cindex runs test
964
965 @display 
966      [ /RUNS (@{MEAN, MEDIAN, MODE, value@})  = varlist ]
967 @end display
968
969 The /RUNS subcommand tests whether a data sequence is randomly ordered.
970
971 It works by examining the number of times a variable's value crosses a given threshold. 
972 The desired threshold must be specified within parentheses.
973 It may either be specified as a number or as one of MEAN, MEDIAN or MODE.
974 Following the threshold specification comes the list of variables whose values are to be
975 tested.
976
977 The subcommand shows the number of runs, the asymptotic significance based on the
978 length of the data.
979
980 @node SIGN
981 @subsection Sign Test
982 @vindex SIGN
983 @cindex sign test
984
985 @display
986      [ /SIGN varlist [ WITH varlist [ (PAIRED) ]]]
987 @end display
988
989 The /SIGN subcommand tests for differences between medians of the 
990 variables listed.
991 The test does not make any assumptions about the
992 distribution of the data.
993
994 If the @code{WITH} keyword is omitted, then tests for all
995 combinations of the listed variables are performed.
996 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
997 is also given, then the number of variables preceding @code{WITH}
998 must be the same as the number following it.
999 In this case, tests for each respective pair of variables are
1000 performed.
1001 If the @code{WITH} keyword is given, but the
1002 @code{(PAIRED)} keyword is omitted, then tests for each combination
1003 of variable preceding @code{WITH} against variable following
1004 @code{WITH} are performed.
1005
1006 @node WILCOXON
1007 @subsection Wilcoxon Matched Pairs Signed Ranks Test
1008 @comment  node-name,  next,  previous,  up
1009 @vindex WILCOXON
1010 @cindex wilcoxon matched pairs signed ranks test
1011
1012 @display
1013      [ /WILCOXON varlist [ WITH varlist [ (PAIRED) ]]]
1014 @end display
1015
1016 The /WILCOXON subcommand tests for differences between medians of the 
1017 variables listed.
1018 The test does not make any assumptions about the variances of the samples.
1019 It does however assume that the distribution is symetrical.
1020
1021 If the @code{WITH} keyword is omitted, then tests for all
1022 combinations of the listed variables are performed.
1023 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
1024 is also given, then the number of variables preceding @code{WITH}
1025 must be the same as the number following it.
1026 In this case, tests for each respective pair of variables are
1027 performed.
1028 If the @code{WITH} keyword is given, but the
1029 @code{(PAIRED)} keyword is omitted, then tests for each combination
1030 of variable preceding @code{WITH} against variable following
1031 @code{WITH} are performed.
1032
1033 @node T-TEST
1034 @comment  node-name,  next,  previous,  up
1035 @section T-TEST
1036
1037 @vindex T-TEST
1038
1039 @display
1040 T-TEST
1041         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
1042         /CRITERIA=CIN(confidence)
1043
1044
1045 (One Sample mode.)
1046         TESTVAL=test_value
1047         /VARIABLES=var_list
1048
1049
1050 (Independent Samples mode.)
1051         GROUPS=var(value1 [, value2])
1052         /VARIABLES=var_list
1053
1054
1055 (Paired Samples mode.)
1056         PAIRS=var_list [WITH var_list [(PAIRED)] ]
1057
1058 @end display
1059
1060
1061 The @cmd{T-TEST} procedure outputs tables used in testing hypotheses about 
1062 means.  
1063 It operates in one of three modes:
1064 @itemize
1065 @item One Sample mode.
1066 @item Independent Groups mode.
1067 @item Paired mode.
1068 @end itemize
1069
1070 @noindent
1071 Each of these modes are described in more detail below.
1072 There are two optional subcommands which are common to all modes.
1073
1074 The @cmd{/CRITERIA} subcommand tells PSPP the confidence interval used
1075 in the tests.  The default value is 0.95.
1076
1077
1078 The @cmd{MISSING} subcommand determines the handling of missing
1079 variables.  
1080 If INCLUDE is set, then user-missing values are included in the
1081 calculations, but system-missing values are not.
1082 If EXCLUDE is set, which is the default, user-missing
1083 values are excluded as well as system-missing values. 
1084 This is the default.
1085
1086 If LISTWISE is set, then the entire case is excluded from analysis
1087 whenever any variable  specified in the @cmd{/VARIABLES}, @cmd{/PAIRS} or 
1088 @cmd{/GROUPS} subcommands contains a missing value.   
1089 If ANALYSIS is set, then missing values are excluded only in the analysis for
1090 which they would be needed. This is the default.
1091
1092
1093 @menu
1094 * One Sample Mode::             Testing against a hypothesised mean
1095 * Independent Samples Mode::    Testing two independent groups for equal mean
1096 * Paired Samples Mode::         Testing two interdependent groups for equal mean
1097 @end menu
1098
1099 @node One Sample Mode
1100 @subsection One Sample Mode
1101
1102 The @cmd{TESTVAL} subcommand invokes the One Sample mode.
1103 This mode is used to test a population mean against a hypothesised
1104 mean. 
1105 The value given to the @cmd{TESTVAL} subcommand is the value against
1106 which you wish to test.
1107 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
1108 tell PSPP which variables you wish to test.
1109
1110 @node Independent Samples Mode
1111 @comment  node-name,  next,  previous,  up
1112 @subsection Independent Samples Mode
1113
1114 The @cmd{GROUPS} subcommand invokes Independent Samples mode or
1115 `Groups' mode. 
1116 This mode is used to test whether two groups of values have the
1117 same population mean.
1118 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
1119 tell PSPP the dependent variables you wish to test.
1120
1121 The variable given in the @cmd{GROUPS} subcommand is the independent
1122 variable which determines to which group the samples belong.
1123 The values in parentheses are the specific values of the independent
1124 variable for each group.
1125 If the parentheses are omitted and no values are given, the default values 
1126 of 1.0 and 2.0 are assumed.
1127
1128 If the independent variable is numeric, 
1129 it is acceptable to specify only one value inside the parentheses.
1130 If you do this, cases where the independent variable is
1131 greater than or equal to this value belong to the first group, and cases
1132 less than this value belong to the second group.
1133 When using this form of the @cmd{GROUPS} subcommand, missing values in
1134 the independent variable are excluded on a listwise basis, regardless
1135 of whether @cmd{/MISSING=LISTWISE} was specified.
1136
1137
1138 @node Paired Samples Mode
1139 @comment  node-name,  next,  previous,  up
1140 @subsection Paired Samples Mode
1141
1142 The @cmd{PAIRS} subcommand introduces Paired Samples mode.
1143 Use this mode when repeated measures have been taken from the same
1144 samples.
1145 If the @code{WITH} keyword is omitted, then tables for all
1146 combinations of variables given in the @cmd{PAIRS} subcommand are
1147 generated. 
1148 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
1149 is also given, then the number of variables preceding @code{WITH}
1150 must be the same as the number following it.
1151 In this case, tables for each respective pair of variables are
1152 generated.
1153 In the event that the @code{WITH} keyword is given, but the
1154 @code{(PAIRED)} keyword is omitted, then tables for each combination
1155 of variable preceding @code{WITH} against variable following
1156 @code{WITH} are generated.
1157
1158
1159 @node ONEWAY
1160 @comment  node-name,  next,  previous,  up
1161 @section ONEWAY
1162
1163 @vindex ONEWAY
1164 @cindex analysis of variance
1165 @cindex ANOVA
1166
1167 @display
1168 ONEWAY
1169         [/VARIABLES = ] var_list BY var
1170         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
1171         /CONTRAST= value1 [, value2] ... [,valueN]
1172         /STATISTICS=@{DESCRIPTIVES,HOMOGENEITY@}
1173         /POSTHOC=@{BONFERRONI, GH, LSD, SCHEFFE, SIDAK, TUKEY, ALPHA ([value])@}
1174 @end display
1175
1176 The @cmd{ONEWAY} procedure performs a one-way analysis of variance of
1177 variables factored by a single independent variable.
1178 It is used to compare the means of a population
1179 divided into more than two groups. 
1180
1181 The dependent variables to be analysed should be given in the @code{VARIABLES}
1182 subcommand.  
1183 The list of variables must be followed by the @code{BY} keyword and
1184 the name of the independent (or factor) variable.
1185
1186 You can use the @code{STATISTICS} subcommand to tell PSPP to display
1187 ancilliary information.  The options accepted are:
1188 @itemize
1189 @item DESCRIPTIVES
1190 Displays descriptive statistics about the groups factored by the independent
1191 variable.
1192 @item HOMOGENEITY
1193 Displays the Levene test of Homogeneity of Variance for the
1194 variables and their groups.
1195 @end itemize
1196
1197 The @code{CONTRAST} subcommand is used when you anticipate certain
1198 differences between the groups.
1199 The subcommand must be followed by a list of numerals which are the
1200 coefficients of the groups to be tested.
1201 The number of coefficients must correspond to the number of distinct
1202 groups (or values of the independent variable).
1203 If the total sum of the coefficients are not zero, then PSPP will
1204 display a warning, but will proceed with the analysis.
1205 The @code{CONTRAST} subcommand may be given up to 10 times in order
1206 to specify different contrast tests.
1207 The @code{MISSING} subcommand defines how missing values are handled.
1208 If LISTWISE is specified then cases which have missing values for 
1209 the independent variable or any dependent variable will be ignored.
1210 If ANALYSIS is specified, then cases will be ignored if the independent
1211 variable is missing or if the dependent variable currently being 
1212 analysed is missing.  The default is ANALYSIS.
1213 A setting of EXCLUDE means that variables whose values are
1214 user-missing are to be excluded from the analysis. A setting of
1215 INCLUDE means they are to be included.  The default is EXCLUDE.
1216
1217 Using the @code{POSTHOC} subcommand you can perform multiple
1218 pairwise comparisons on the data. The following comparison methods
1219 are available:
1220 @itemize
1221 @item LSD
1222 Least Significant Difference.
1223 @item TUKEY
1224 Tukey Honestly Significant Difference.
1225 @item BONFERRONI
1226 Bonferroni test.
1227 @item SCHEFFE
1228 Scheff@'e's test.
1229 @item SIDAK
1230 Sidak test.
1231 @item GH
1232 The Games-Howell test.
1233 @end itemize
1234
1235 @noindent
1236 The optional syntax @code{ALPHA(@var{value})} is used to indicate
1237 that @var{value} should be used as the
1238 confidence level for which the posthoc tests will be performed.
1239 The default is 0.05.
1240
1241 @node QUICK CLUSTER
1242 @comment  node-name,  next,  previous,  up
1243 @section QUICK CLUSTER
1244 @vindex QUICK CLUSTER
1245
1246 @cindex K-means clustering
1247 @cindex clustering
1248
1249 @display
1250 QUICK CLUSTER var_list
1251       [/CRITERIA=CLUSTERS(@var{k}) [MXITER(@var{max_iter})]]
1252       [/MISSING=@{EXCLUDE,INCLUDE@} @{LISTWISE, PAIRWISE@}]
1253 @end display
1254
1255 The @cmd{QUICK CLUSTER} command performs k-means clustering on the
1256 dataset.  This is useful when you wish to allocate cases into clusters
1257 of similar values and you already know the number of clusters.
1258
1259 The minimum specification is @samp{QUICK CLUSTER} followed by the names
1260 of the variables which contain the cluster data.  Normally you will also
1261 want to specify @samp{/CRITERIA=CLUSTERS(@var{k})} where @var{k} is the
1262 number of clusters.  If this is not given, then @var{k} defaults to 2.
1263
1264 The command uses an iterative algorithm to determine the clusters for
1265 each case.  It will continue iterating until convergence, or until @var{max_iter}
1266 iterations have been done.  The default value of @var{max_iter} is 2.
1267
1268 The @cmd{MISSING} subcommand determines the handling of missing variables.  
1269 If INCLUDE is set, then user-missing values are considered at their face
1270 value and not as missing values.
1271 If EXCLUDE is set, which is the default, user-missing
1272 values are excluded as well as system-missing values. 
1273
1274 If LISTWISE is set, then the entire case is excluded from the analysis
1275 whenever any of the clustering variables contains a missing value.   
1276 If PAIRWISE is set, then a case is considered missing only if all the
1277 clustering variables contain missing values.  Otherwise it is clustered
1278 on the basis of the non-missing values.
1279 The default is LISTWISE.
1280
1281
1282 @node RANK
1283 @comment  node-name,  next,  previous,  up
1284 @section RANK
1285
1286
1287 @vindex RANK
1288 @display
1289 RANK
1290         [VARIABLES=] var_list [@{A,D@}] [BY var_list]
1291         /TIES=@{MEAN,LOW,HIGH,CONDENSE@}
1292         /FRACTION=@{BLOM,TUKEY,VW,RANKIT@}
1293         /PRINT[=@{YES,NO@}
1294         /MISSING=@{EXCLUDE,INCLUDE@}
1295
1296         /RANK [INTO var_list]
1297         /NTILES(k) [INTO var_list]
1298         /NORMAL [INTO var_list]
1299         /PERCENT [INTO var_list]
1300         /RFRACTION [INTO var_list]
1301         /PROPORTION [INTO var_list]
1302         /N [INTO var_list]
1303         /SAVAGE [INTO var_list]
1304 @end display
1305
1306 The @cmd{RANK} command ranks variables and stores the results into new
1307 variables. 
1308
1309 The VARIABLES subcommand, which is mandatory, specifies one or
1310 more variables whose values are to be ranked.  
1311 After each variable, @samp{A} or @samp{D} may appear, indicating that
1312 the variable is to be ranked in ascending or descending order.
1313 Ascending is the default.
1314 If a BY keyword appears, it should be followed by a list of variables
1315 which are to serve as group variables.  
1316 In this case, the cases are gathered into groups, and ranks calculated
1317 for each group.
1318
1319 The TIES subcommand specifies how tied values are to be treated.  The
1320 default is to take the mean value of all the tied cases.
1321
1322 The FRACTION subcommand specifies how proportional ranks are to be
1323 calculated.  This only has any effect if NORMAL or PROPORTIONAL rank
1324 functions are requested.
1325
1326 The PRINT subcommand may be used to specify that a summary of the rank
1327 variables created should appear in the output.
1328
1329 The function subcommands are RANK, NTILES, NORMAL, PERCENT, RFRACTION,
1330 PROPORTION and SAVAGE.  Any number of function subcommands may appear.
1331 If none are given, then the default is RANK.
1332 The NTILES subcommand must take an integer specifying the number of
1333 partitions into which values should be ranked.
1334 Each subcommand may be followed by the INTO keyword and a list of
1335 variables which are the variables to be created and receive the rank
1336 scores.  There may be as many variables specified as there are
1337 variables named on the VARIABLES subcommand.  If fewer are specified,
1338 then the variable names are automatically created.
1339
1340 The MISSING subcommand determines how user missing values are to be
1341 treated. A setting of EXCLUDE means that variables whose values are
1342 user-missing are to be excluded from the rank scores. A setting of
1343 INCLUDE means they are to be included.  The default is EXCLUDE.
1344
1345 @include regression.texi
1346
1347
1348 @node RELIABILITY
1349 @section RELIABILITY
1350
1351 @vindex RELIABILITY
1352 @display
1353 RELIABILITY
1354         /VARIABLES=var_list
1355         /SCALE (@var{name}) = @{var_list, ALL@}
1356         /MODEL=@{ALPHA, SPLIT[(N)]@}
1357         /SUMMARY=@{TOTAL,ALL@}
1358         /MISSING=@{EXCLUDE,INCLUDE@}
1359 @end display
1360
1361 @cindex Cronbach's Alpha
1362 The @cmd{RELIABILTY} command performs reliablity analysis on the data.
1363
1364 The VARIABLES subcommand is required. It determines the set of variables 
1365 upon which analysis is to be performed.
1366
1367 The SCALE subcommand determines which variables reliability is to be 
1368 calculated for.  If it is omitted, then analysis for all variables named
1369 in the VARIABLES subcommand will be used.
1370 Optionally, the @var{name} parameter may be specified to set a string name 
1371 for the scale.
1372
1373 The MODEL subcommand determines the type of analysis. If ALPHA is specified, 
1374 then Cronbach's Alpha is calculated for the scale.  If the model is SPLIT, 
1375 then the variables  are divided into 2 subsets.  An optional parameter 
1376 @var{N} may be given, to specify how many variables to be in the first subset.
1377 If @var{N} is omitted, then it defaults to one half of the variables in the 
1378 scale, or one half minus one if there are an odd number of variables.
1379 The default model is ALPHA.
1380
1381 By default, any cases with user missing, or system missing values for 
1382 any variables given 
1383 in the VARIABLES subcommand will be omitted from analysis.
1384 The MISSING subcommand determines whether user missing values are to 
1385 be included or excluded in the analysis.
1386
1387 The SUMMARY subcommand determines the type of summary analysis to be performed.
1388 Currently there is only one type: SUMMARY=TOTAL, which displays per-item
1389 analysis tested against the totals.
1390
1391
1392
1393 @node ROC
1394 @section ROC
1395
1396 @vindex ROC
1397 @cindex Receiver Operating Characterstic
1398 @cindex Area under curve
1399
1400 @display
1401 ROC     @var{var_list} BY @var{state_var} (@var{state_value})
1402         /PLOT = @{ CURVE [(REFERENCE)], NONE @}
1403         /PRINT = [ SE ] [ COORDINATES ]
1404         /CRITERIA = [ CUTOFF(@{INCLUDE,EXCLUDE@}) ]
1405           [ TESTPOS (@{LARGE,SMALL@}) ]
1406           [ CI (@var{confidence}) ]
1407           [ DISTRIBUTION (@{FREE, NEGEXPO @}) ]
1408         /MISSING=@{EXCLUDE,INCLUDE@}
1409 @end display
1410
1411
1412 The @cmd{ROC} command is used to plot the receiver operating characteristic curve 
1413 of a dataset, and to estimate the area under the curve.
1414 This is useful for analysing the efficacy of a variable as a predictor of a state of nature.
1415
1416 The mandatory @var{var_list} is the list of predictor variables.
1417 The variable @var{state_var} is the variable whose values represent the actual states, 
1418 and @var{state_value} is the value of this variable which represents the positive state.
1419
1420 The optional subcommand PLOT is used to determine if and how the ROC curve is drawn.
1421 The keyword CURVE means that the ROC curve should be drawn, and the optional keyword REFERENCE,
1422 which should be enclosed in parentheses, says that the diagonal reference line should be drawn.
1423 If the keyword NONE is given, then no ROC curve is drawn.
1424 By default, the curve is drawn with no reference line.
1425
1426 The optional subcommand PRINT determines which additional tables should be printed.
1427 Two additional tables are available. 
1428 The SE keyword says that standard error of the area under the curve should be printed as well as
1429 the area itself.
1430 In addition, a p-value under the null hypothesis that the area under the curve equals 0.5 will be
1431 printed.
1432 The COORDINATES keyword says that a table of coordinates of the ROC curve should be printed.
1433
1434 The CRITERIA subcommand has four optional parameters:
1435 @itemize @bullet
1436 @item The TESTPOS parameter may be LARGE or SMALL.
1437 LARGE is the default, and says that larger values in the predictor variables are to be 
1438 considered positive.  SMALL indicates that smaller values should be considered positive.
1439
1440 @item The CI parameter specifies the confidence interval that should be printed.
1441 It has no effect if the SE keyword in the PRINT subcommand has not been given.
1442
1443 @item The DISTRIBUTION parameter determines the method to be used when estimating the area
1444 under the curve.  
1445 There are two possibilities, @i{viz}: FREE and NEGEXPO.
1446 The FREE method uses a non-parametric estimate, and the NEGEXPO method a bi-negative 
1447 exponential distribution estimate.
1448 The NEGEXPO method should only be used when the number of positive actual states is
1449 equal to the number of negative actual states.
1450 The default is FREE.
1451
1452 @item The CUTOFF parameter is for compatibility and is ignored.
1453 @end itemize
1454
1455 The MISSING subcommand determines whether user missing values are to 
1456 be included or excluded in the analysis.  The default behaviour is to
1457 exclude them.
1458 Cases are excluded on a listwise basis; if any of the variables in @var{var_list} 
1459 or if the variable @var{state_var} is missing, then the entire case will be 
1460 excluded.
1461
1462