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