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