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