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