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