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