Added brief documentation about the FACTOR command's rotation feature
[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 * NPAR TESTS::                  Nonparametric tests.
15 * T-TEST::                      Test hypotheses about means.
16 * ONEWAY::                      One way analysis of variance.
17 * RANK::                        Compute rank scores.
18 * REGRESSION::                  Linear regression.
19 * RELIABILITY::                 Reliability analysis.
20 * ROC::                         Receiver Operating Characteristic.
21 @end menu
22
23 @node DESCRIPTIVES
24 @section DESCRIPTIVES
25
26 @vindex DESCRIPTIVES
27 @display
28 DESCRIPTIVES
29         /VARIABLES=var_list
30         /MISSING=@{VARIABLE,LISTWISE@} @{INCLUDE,NOINCLUDE@}
31         /FORMAT=@{LABELS,NOLABELS@} @{NOINDEX,INDEX@} @{LINE,SERIAL@}
32         /SAVE
33         /STATISTICS=@{ALL,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,
34                      SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,DEFAULT,
35                      SESKEWNESS,SEKURTOSIS@}
36         /SORT=@{NONE,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,SKEWNESS,
37                RANGE,MINIMUM,MAXIMUM,SUM,SESKEWNESS,SEKURTOSIS,NAME@}
38               @{A,D@}
39 @end display
40
41 The @cmd{DESCRIPTIVES} procedure reads the active file and outputs
42 descriptive
43 statistics requested by the user.  In addition, it can optionally
44 compute Z-scores.
45
46 The VARIABLES subcommand, which is required, specifies the list of
47 variables to be analyzed.  Keyword VARIABLES is optional.
48
49 All other subcommands are optional:
50
51 The MISSING subcommand determines the handling of missing variables.  If
52 INCLUDE is set, then user-missing values are included in the
53 calculations.  If NOINCLUDE is set, which is the default, user-missing
54 values are excluded.  If VARIABLE is set, then missing values are
55 excluded on a variable by variable basis; if LISTWISE is set, then
56 the entire case is excluded whenever any value in that case has a
57 system-missing or, if INCLUDE is set, user-missing value.
58
59 The FORMAT subcommand affects the output format.  Currently the
60 LABELS/NOLABELS and NOINDEX/INDEX settings are not used.  When SERIAL is
61 set, both valid and missing number of cases are listed in the output;
62 when NOSERIAL is set, only valid cases are listed.
63
64 The SAVE subcommand causes @cmd{DESCRIPTIVES} to calculate Z scores for all
65 the specified variables.  The Z scores are saved to new variables.
66 Variable names are generated by trying first the original variable name
67 with Z prepended and truncated to a maximum of 8 characters, then the
68 names ZSC000 through ZSC999, STDZ00 through STDZ09, ZZZZ00 through
69 ZZZZ09, ZQZQ00 through ZQZQ09, in that sequence.  In addition, Z score
70 variable names can be specified explicitly on VARIABLES in the variable
71 list by enclosing them in parentheses after each variable.
72
73 The STATISTICS subcommand specifies the statistics to be displayed:
74
75 @table @code
76 @item ALL
77 All of the statistics below.
78 @item MEAN
79 Arithmetic mean.
80 @item SEMEAN
81 Standard error of the mean.
82 @item STDDEV
83 Standard deviation.
84 @item VARIANCE
85 Variance.
86 @item KURTOSIS
87 Kurtosis and standard error of the kurtosis.
88 @item SKEWNESS
89 Skewness and standard error of the skewness.
90 @item RANGE
91 Range.
92 @item MINIMUM
93 Minimum value.
94 @item MAXIMUM
95 Maximum value.
96 @item SUM
97 Sum.
98 @item DEFAULT
99 Mean, standard deviation of the mean, minimum, maximum.
100 @item SEKURTOSIS
101 Standard error of the kurtosis.
102 @item SESKEWNESS
103 Standard error of the skewness.
104 @end table
105
106 The SORT subcommand specifies how the statistics should be sorted.  Most
107 of the possible values should be self-explanatory.  NAME causes the
108 statistics to be sorted by name.  By default, the statistics are listed
109 in the order that they are specified on the VARIABLES subcommand.  The A
110 and D settings request an ascending or descending sort order,
111 respectively.
112
113 @node FREQUENCIES
114 @section FREQUENCIES
115
116 @vindex FREQUENCIES
117 @display
118 FREQUENCIES
119         /VARIABLES=var_list
120         /FORMAT=@{TABLE,NOTABLE,LIMIT(limit)@}
121                 @{AVALUE,DVALUE,AFREQ,DFREQ@}
122         /MISSING=@{EXCLUDE,INCLUDE@}
123         /STATISTICS=@{DEFAULT,MEAN,SEMEAN,MEDIAN,MODE,STDDEV,VARIANCE,
124                      KURTOSIS,SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,
125                      SESKEWNESS,SEKURTOSIS,ALL,NONE@}
126         /NTILES=ntiles
127         /PERCENTILES=percent@dots{}
128         /HISTOGRAM=[MINIMUM(x_min)] [MAXIMUM(x_max)] 
129                    [@{FREQ[(y_max)],PERCENT[(y_max)]@}] [@{NONORMAL,NORMAL@}]
130         /PIECHART=[MINIMUM(x_min)] [MAXIMUM(x_max)]
131                   [@{FREQ,PERCENT@}] [@{NOMISSING,MISSING@}]
132
133 (These options are not currently implemented.)
134         /BARCHART=@dots{}
135         /HBAR=@dots{}
136         /GROUPED=@dots{}
137 @end display
138
139 The @cmd{FREQUENCIES} procedure outputs frequency tables for specified
140 variables.
141 @cmd{FREQUENCIES} can also calculate and display descriptive statistics
142 (including median and mode) and percentiles,
143 @cmd{FREQUENCIES} can also output
144 histograms and pie charts.  
145
146 The VARIABLES subcommand is the only required subcommand.  Specify the
147 variables to be analyzed.
148
149 The FORMAT subcommand controls the output format.  It has several
150 possible settings:  
151
152 @itemize @bullet
153 @item
154 TABLE, the default, causes a frequency table to be output for every
155 variable specified.  NOTABLE prevents them from being output.  LIMIT
156 with a numeric argument causes them to be output except when there are
157 more than the specified number of values in the table.
158
159 @item
160 Normally frequency tables are sorted in ascending order by value.  This
161 is AVALUE.  DVALUE tables are sorted in descending order by value.
162 AFREQ and DFREQ tables are sorted in ascending and descending order,
163 respectively, by frequency count.
164 @end itemize
165
166 The MISSING subcommand controls the handling of user-missing values.
167 When EXCLUDE, the default, is set, user-missing values are not included
168 in frequency tables or statistics.  When INCLUDE is set, user-missing
169 are included.  System-missing values are never included in statistics,
170 but are listed in frequency tables.
171
172 The available STATISTICS are the same as available in @cmd{DESCRIPTIVES}
173 (@pxref{DESCRIPTIVES}), with the addition of MEDIAN, the data's median
174 value, and MODE, the mode.  (If there are multiple modes, the smallest
175 value is reported.)  By default, the mean, standard deviation of the
176 mean, minimum, and maximum are reported for each variable.
177
178 @cindex percentiles
179 PERCENTILES causes the specified percentiles to be reported.
180 The percentiles should  be presented at a list of numbers between 0
181 and 100 inclusive.  
182 The NTILES subcommand causes the percentiles to be reported at the
183 boundaries of the data set divided into the specified number of ranges.
184 For instance, @code{/NTILES=4} would cause quartiles to be reported.
185
186 The HISTOGRAM subcommand causes the output to include a histogram for
187 each specified numeric variable.  The X axis by default ranges from
188 the minimum to the maximum value observed in the data, but the MINIMUM
189 and MAXIMUM keywords can set an explicit range.  Specify NORMAL to
190 superimpose a normal curve on the histogram.  Histograms are not
191 created for string variables.
192
193 The PIECHART adds a pie chart for each variable to the data.  Each
194 slice represents one value, with the size of the slice proportional to
195 the value's frequency.  By default, all non-missing values are given
196 slices.  The MINIMUM and MAXIMUM keywords can be used to limit the
197 displayed slices to a given range of values.  The MISSING keyword adds
198 slices for missing values.
199
200 The FREQ and PERCENT options on HISTOGRAM and PIECHART are accepted
201 but not currently honored.
202
203 @node EXAMINE
204 @comment  node-name,  next,  previous,  up
205 @section EXAMINE
206 @vindex EXAMINE
207
208 @cindex Normality, testing for
209
210 @display
211 EXAMINE
212         VARIABLES=var_list [BY factor_list ]
213         /STATISTICS=@{DESCRIPTIVES, EXTREME[(n)], ALL, NONE@}
214         /PLOT=@{BOXPLOT, NPPLOT, HISTOGRAM, ALL, NONE@}
215         /CINTERVAL n
216         /COMPARE=@{GROUPS,VARIABLES@}
217         /ID=var_name
218         /@{TOTAL,NOTOTAL@}
219         /PERCENTILE=[value_list]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @}
220         /MISSING=@{LISTWISE, PAIRWISE@} [@{EXCLUDE, INCLUDE@}] 
221                 [@{NOREPORT,REPORT@}]
222
223 @end display
224
225 The @cmd{EXAMINE} command is used to test how closely a distribution is to a 
226 normal distribution.  It also shows you outliers and extreme values.
227
228 The VARIABLES subcommand specifies the dependent variables and the
229 independent variable to use as factors for the analysis.   Variables
230 listed before the first BY keyword are the dependent variables.
231 The dependent variables may optionally be followed by a list of
232 factors which tell PSPP how to break down the analysis for each
233 dependent variable.  The format for each factor is 
234 @display
235 var [BY var].
236 @end display
237
238
239 The STATISTICS subcommand specifies the analysis to be done.  
240 DESCRIPTIVES will produce a table showing some parametric and
241 non-parametrics statistics.  EXTREME produces a table showing extreme
242 values of the dependent variable.  A number in parentheses determines
243 how many upper and lower extremes to show.  The default number is 5.
244
245
246 The PLOT subcommand specifies which plots are to be produced if any.
247
248 The COMPARE subcommand is only relevant if producing boxplots, and it is only 
249 useful there is more than one dependent variable and at least one factor.   If 
250 /COMPARE=GROUPS is specified, then one plot per dependent variable is produced,
251 containing boxplots for all the factors.
252 If /COMPARE=VARIABLES is specified, then one plot per factor is produced, each 
253 each containing one boxplot per dependent variable.
254 If the /COMPARE subcommand is ommitted, then PSPP uses the default value of 
255 /COMPARE=GROUPS.
256  
257 The ID subcommand also pertains to boxplots.  If given, it must
258 specify a variable name.   Outliers and extreme cases plotted in
259 boxplots will be labelled with the case from that variable.  Numeric or
260 string variables are permissible.  If the ID subcommand is not given,
261 then the casenumber will be used for labelling.
262
263 The CINTERVAL subcommand specifies the confidence interval to use in
264 calculation of the descriptives command.  The default it 95%.
265
266 @cindex percentiles
267 The PERCENTILES subcommand specifies which percentiles are to be calculated, 
268 and which algorithm to use for calculating them.  The default is to
269 calculate the 5, 10, 25, 50, 75, 90, 95 percentiles using the
270 HAVERAGE algorithm.
271
272 The TOTAL and NOTOTAL subcommands are mutually exclusive.  If NOTOTAL
273 is given and factors have been specified in the VARIABLES subcommand,
274 then then statistics for the unfactored dependent variables are
275 produced in addition to the factored variables.  If there are no
276 factors specified then TOTAL and NOTOTAL have no effect.
277
278 @strong{Warning!}
279 If many dependent variable are given, or factors are given for which
280 there are many distinct values, then @cmd{EXAMINE} will produce a very
281 large quantity of output.
282
283 @node CORRELATIONS
284 @section CORRELATIONS
285
286 @vindex CORRELATIONS
287 @display
288 CORRELATIONS
289      /VARIABLES = varlist [ WITH varlist ]
290      [
291       .
292       .
293       .
294       /VARIABLES = varlist [ WITH varlist ]
295       /VARIABLES = varlist [ WITH varlist ]
296      ]
297
298      [ /PRINT=@{TWOTAIL, ONETAIL@} @{SIG, NOSIG@} ]
299      [ /STATISTICS=DESCRIPTIVES XPROD ALL]
300      [ /MISSING=@{PAIRWISE, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
301 @end display    
302
303 @cindex correlation
304 The @cmd{CORRELATIONS} procedure produces tables of the Pearson correlation coefficient
305 for a set of variables.  The significance of the coefficients are also given.
306
307 At least one VARIABLES subcommand is required. If the WITH keyword is used, then a non-square
308 correlation table will be produced.
309 The variables preceding WITH, will be used as the rows of the table, and the variables following
310 will be the columns of the table.
311 If no WITH subcommand is given, then a square, symmetrical table using all variables is produced.
312
313
314 The @cmd{MISSING} subcommand determines the handling of missing variables.  
315 If INCLUDE is set, then user-missing values are included in the
316 calculations, but system-missing values are not.
317 If EXCLUDE is set, which is the default, user-missing
318 values are excluded as well as system-missing values. 
319 This is the default.
320
321 If LISTWISE is set, then the entire case is excluded from analysis
322 whenever any variable  specified in any @cmd{/VARIABLES} subcommand
323 contains a missing value.   
324 If PAIRWISE is set, then a case is considered missing only if either of the
325 values  for the particular coefficient are missing.
326 The default is PAIRWISE.
327
328 The PRINT subcommand is used to control how the reported significance values are printed.
329 If the TWOTAIL option is used, then a two-tailed test of significance is 
330 printed.  If the ONETAIL option is given, then a one-tailed test is used.
331 The default is TWOTAIL.
332
333 If the NOSIG option is specified, then correlation coefficients with significance less than
334 0.05 are highlighted.
335 If SIG is specified, then no highlighting is performed.  This is the default.
336
337 @cindex covariance
338 The STATISTICS subcommand requests additional statistics to be displayed.  The keyword 
339 DESCRIPTIVES requests that the mean, number of non-missing cases, and the non-biased
340 estimator of the standard deviation are displayed.
341 These statistics will be displayed in a separated table, for all the variables listed
342 in any /VARIABLES subcommand.
343 The XPROD keyword requests cross-product deviations and covariance estimators to 
344 be displayed for each pair of variables.
345 The keyword ALL is the union of DESCRIPTIVES and XPROD.
346
347 @node CROSSTABS
348 @section CROSSTABS
349
350 @vindex CROSSTABS
351 @display
352 CROSSTABS
353         /TABLES=var_list BY var_list [BY var_list]@dots{}
354         /MISSING=@{TABLE,INCLUDE,REPORT@}
355         /WRITE=@{NONE,CELLS,ALL@}
356         /FORMAT=@{TABLES,NOTABLES@}
357                 @{LABELS,NOLABELS,NOVALLABS@}
358                 @{PIVOT,NOPIVOT@}
359                 @{AVALUE,DVALUE@}
360                 @{NOINDEX,INDEX@}
361                 @{BOX,NOBOX@}
362         /CELLS=@{COUNT,ROW,COLUMN,TOTAL,EXPECTED,RESIDUAL,SRESIDUAL,
363                 ASRESIDUAL,ALL,NONE@}
364         /STATISTICS=@{CHISQ,PHI,CC,LAMBDA,UC,BTAU,CTAU,RISK,GAMMA,D,
365                      KAPPA,ETA,CORR,ALL,NONE@}
366         
367 (Integer mode.)
368         /VARIABLES=var_list (low,high)@dots{}
369 @end display
370
371 The @cmd{CROSSTABS} procedure displays crosstabulation
372 tables requested by the user.  It can calculate several statistics for
373 each cell in the crosstabulation tables.  In addition, a number of
374 statistics can be calculated for each table itself.
375
376 The TABLES subcommand is used to specify the tables to be reported.  Any
377 number of dimensions is permitted, and any number of variables per
378 dimension is allowed.  The TABLES subcommand may be repeated as many
379 times as needed.  This is the only required subcommand in @dfn{general
380 mode}.  
381
382 Occasionally, one may want to invoke a special mode called @dfn{integer
383 mode}.  Normally, in general mode, PSPP automatically determines
384 what values occur in the data.  In integer mode, the user specifies the
385 range of values that the data assumes.  To invoke this mode, specify the
386 VARIABLES subcommand, giving a range of data values in parentheses for
387 each variable to be used on the TABLES subcommand.  Data values inside
388 the range are truncated to the nearest integer, then assigned to that
389 value.  If values occur outside this range, they are discarded.  When it
390 is present, the VARIABLES subcommand must precede the TABLES
391 subcommand.
392
393 In general mode, numeric and string variables may be specified on
394 TABLES.  In integer mode, only numeric variables are allowed.
395
396 The MISSING subcommand determines the handling of user-missing values.
397 When set to TABLE, the default, missing values are dropped on a table by
398 table basis.  When set to INCLUDE, user-missing values are included in
399 tables and statistics.  When set to REPORT, which is allowed only in
400 integer mode, user-missing values are included in tables but marked with
401 an @samp{M} (for ``missing'') and excluded from statistical
402 calculations.
403
404 Currently the WRITE subcommand is ignored.
405
406 The FORMAT subcommand controls the characteristics of the
407 crosstabulation tables to be displayed.  It has a number of possible
408 settings:
409
410 @itemize @bullet
411 @item
412 TABLES, the default, causes crosstabulation tables to be output.
413 NOTABLES suppresses them.
414
415 @item
416 LABELS, the default, allows variable labels and value labels to appear
417 in the output.  NOLABELS suppresses them.  NOVALLABS displays variable
418 labels but suppresses value labels.
419
420 @item
421 PIVOT, the default, causes each TABLES subcommand to be displayed in a
422 pivot table format.  NOPIVOT causes the old-style crosstabulation format
423 to be used.
424
425 @item
426 AVALUE, the default, causes values to be sorted in ascending order.
427 DVALUE asserts a descending sort order.
428
429 @item
430 INDEX/NOINDEX is currently ignored.
431
432 @item
433 BOX/NOBOX is currently ignored.
434 @end itemize
435
436 The CELLS subcommand controls the contents of each cell in the displayed
437 crosstabulation table.  The possible settings are:
438
439 @table @asis
440 @item COUNT
441 Frequency count.
442 @item ROW
443 Row percent.
444 @item COLUMN
445 Column percent.
446 @item TOTAL
447 Table percent.
448 @item EXPECTED
449 Expected value.
450 @item RESIDUAL 
451 Residual.
452 @item SRESIDUAL
453 Standardized residual.
454 @item ASRESIDUAL
455 Adjusted standardized residual.
456 @item ALL
457 All of the above.
458 @item NONE
459 Suppress cells entirely.
460 @end table
461
462 @samp{/CELLS} without any settings specified requests COUNT, ROW,
463 COLUMN, and TOTAL.  If CELLS is not specified at all then only COUNT
464 will be selected.
465
466 The STATISTICS subcommand selects statistics for computation:
467
468 @table @asis
469 @item CHISQ
470 @cindex chisquare
471 @cindex chi-square
472
473 Pearson chi-square, likelihood ratio, Fisher's exact test, continuity
474 correction, linear-by-linear association.
475 @item PHI
476 Phi.
477 @item CC
478 Contingency coefficient.
479 @item LAMBDA
480 Lambda.
481 @item UC
482 Uncertainty coefficient.
483 @item BTAU
484 Tau-b.
485 @item CTAU
486 Tau-c.
487 @item RISK
488 Risk estimate.
489 @item GAMMA
490 Gamma.
491 @item D
492 Somers' D.
493 @item KAPPA
494 Cohen's Kappa.
495 @item ETA
496 Eta.
497 @item CORR
498 Spearman correlation, Pearson's r.
499 @item ALL
500 All of the above.
501 @item NONE
502 No statistics.
503 @end table
504
505 Selected statistics are only calculated when appropriate for the
506 statistic.  Certain statistics require tables of a particular size, and
507 some statistics are calculated only in integer mode.
508
509 @samp{/STATISTICS} without any settings selects CHISQ.  If the
510 STATISTICS subcommand is not given, no statistics are calculated.
511
512 @strong{Please note:} Currently the implementation of CROSSTABS has the
513 followings bugs:
514
515 @itemize @bullet
516 @item
517 Pearson's R (but not Spearman) is off a little.
518 @item
519 T values for Spearman's R and Pearson's R are wrong.
520 @item
521 Significance of symmetric and directional measures is not calculated.
522 @item
523 Asymmetric ASEs and T values for lambda are wrong.
524 @item
525 ASE of Goodman and Kruskal's tau is not calculated.
526 @item
527 ASE of symmetric somers' d is wrong.
528 @item
529 Approximate T of uncertainty coefficient is wrong.
530 @end itemize
531
532 Fixes for any of these deficiencies would be welcomed.
533
534 @node FACTOR
535 @section FACTOR
536
537 @vindex FACTOR
538 @cindex factor analysis
539 @cindex principal components analysis
540 @cindex principal axis factoring
541 @cindex data reduction
542
543 @display
544 FACTOR  VARIABLES=var_list
545
546         [ /METHOD = @{CORRELATION, COVARIANCE@} ]
547
548         [ /EXTRACTION=@{PC, PAF@}] 
549
550         [ /ROTATION=@{VARIMAX, EQUAMAX, QUARTIMAX, NOROTATE@}]
551
552         [ /PRINT=[INITIAL] [EXTRACTION] [ROTATION] [UNIVARIATE] [CORRELATION] [COVARIANCE] [DET] [SIG] [ALL] [DEFAULT] ]
553
554         [ /PLOT=[EIGEN] ]
555
556         [ /FORMAT=[SORT] [BLANK(@var{n})] [DEFAULT] ]
557
558         [ /CRITERIA=[FACTORS(@var{n})] [MINEIGEN(@var{l})] [ITERATE(@var{m})] [ECONVERGE (@var{delta})] [DEFAULT] ]
559
560         [ /MISSING=[@{LISTWISE, PAIRWISE@}] [@{INCLUDE, EXCLUDE@}] ]
561 @end display
562
563 The FACTOR command performs Factor Analysis or Principal Axis Factoring on a dataset.  It may be used to find
564 common factors in the data or for data reduction purposes.
565
566 The VARIABLES subcommand is required.  It lists the variables which are to partake in the analysis.
567
568 The /EXTRACTION subcommand is used to specify the way in which factors (components) are extracted from the data.
569 If PC is specified, then Principal Components Analysis is used.  If PAF is specified, then Principal Axis Factoring is
570 used. By default Principal Components Analysis will be used.
571
572 The /ROTATION subcommand is used to specify the method by which the extracted solution will be rotated.
573 Three methods are available: VARIMAX (which is the default), EQUAMAX, and QUARTIMAX.
574 If don't want any rotation to be performed, the word NOROTATE will prevent the command from performing any
575 rotation on the data. Oblique rotations are not supported.
576
577 The /METHOD subcommand should be used to determine whether the covariance matrix or the correlation matrix of the data is
578 to be analysed.  By default, the correlation matrix is analysed.
579
580 The /PRINT subcommand may be used to select which features of the analysis are reported:
581
582 @itemize
583 @item UNIVARIATE
584       A table of mean values, standard deviations and total weights are printed.
585 @item INITIAL
586       Initial communalities and eigenvalues are printed.
587 @item EXTRACTION
588       Extracted communalities and eigenvalues are printed.
589 @item ROTATION
590       Rotated communalities and eigenvalues are printed.
591 @item CORRELATION
592       The correlation matrix is printed.
593 @item COVARIANCE
594       The covariance matrix is printed.
595 @item DET
596       The determinant of the correlation or covariance matrix is printed.
597 @item SIG
598       The significance of the elements of correlation matrix is printed.
599 @item ALL
600       All of the above are printed.
601 @item DEFAULT
602       Identical to INITIAL and EXTRACTION.
603 @end itemize
604
605 If /PLOT=EIGEN is given, then a ``Scree'' plot of the eigenvalues will be printed.  This can be useful for visualising
606 which factors (components) should be retained.
607
608 The /FORMAT subcommand determined how data are to be displayed in loading matrices.  If SORT is specified, then the variables
609 are sorted in descending order of significance.  If BLANK(@var{n}) is specified, then coefficients whose absolute value is less
610 than @var{n} will not be printed.  If the keyword DEFAULT is given, or if no /FORMAT subcommand is given, then no sorting is 
611 performed, and all coefficients will be printed.
612
613 The /CRITERIA subcommand is used to specify how the number of extracted factors (components) are chosen.  If FACTORS(@var{n}) is
614 specified, where @var{n} is an integer, then @var{n} factors will be extracted.  Otherwise, the MINEIGEN setting will
615 be used.  MINEIGEN(@var{l}) requests that all factors whose eigenvalues are greater than or equal to @var{l} are extracted.
616 The default value of @var{l} is 1.    The ECONVERGE and ITERATE settings have effect only when iterative algorithms for factor
617 extraction (such as Principal Axis Factoring) are used.   ECONVERGE(@var{delta}) specifies that iteration should cease when
618 the maximum absolute value of the communality estimate between one iteration and the previous is less than @var{delta}. The
619 default value of @var{delta} is 0.001.
620 The ITERATE(@var{m}) setting sets the maximum number of iterations to @var{m}.  The default value of @var{m} is 25.
621
622 The @cmd{MISSING} subcommand determines the handling of missing variables.  
623 If INCLUDE is set, then user-missing values are included in the
624 calculations, but system-missing values are not.
625 If EXCLUDE is set, which is the default, user-missing
626 values are excluded as well as system-missing values. 
627 This is the default.
628 If LISTWISE is set, then the entire case is excluded from analysis
629 whenever any variable  specified in the @cmd{VARIABLES} subcommand
630 contains a missing value.   
631 If PAIRWISE is set, then a case is considered missing only if either of the
632 values  for the particular coefficient are missing.
633 The default is LISTWISE.
634  
635
636 @node NPAR TESTS
637 @section NPAR TESTS
638
639 @vindex NPAR TESTS
640 @cindex nonparametric tests
641
642 @display 
643 NPAR TESTS
644      
645      nonparametric test subcommands
646      .
647      .
648      .
649      
650      [ /STATISTICS=@{DESCRIPTIVES@} ]
651
652      [ /MISSING=@{ANALYSIS, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
653
654      [ /METHOD=EXACT [ TIMER [(n)] ] ]
655 @end display
656
657 NPAR TESTS performs nonparametric tests. 
658 Non parametric tests make very few assumptions about the distribution of the 
659 data.
660 One or more tests may be specified by using the corresponding subcommand.
661 If the /STATISTICS subcommand is also specified, then summary statistics are 
662 produces for each variable that is the subject of any test.
663
664 Certain tests may take a long time to execute, if an exact figure is required.
665 Therefore, by default asymptotic approximations are used unless the
666 subcommand /METHOD=EXACT is specified.  
667 Exact tests give more accurate results, but may take an unacceptably long 
668 time to perform.  If the TIMER keyword is used, it sets a maximum time,
669 after which the test will be abandoned, and a warning message printed.
670 The time, in minutes, should be specified in parentheses after the TIMER keyword.
671 If the TIMER keyword is given without this figure, then a default value of 5 minutes 
672 is used.
673
674
675 @menu
676 * BINOMIAL::                Binomial Test
677 * CHISQUARE::               Chisquare Test
678 * WILCOXON::                Wilcoxon Signed Ranks Test
679 * SIGN::                    The Sign Test
680 @end menu
681
682
683 @node    BINOMIAL
684 @subsection Binomial test
685 @vindex BINOMIAL
686 @cindex binomial test
687
688 @display 
689      [ /BINOMIAL[(p)]=var_list[(value1[, value2)] ] ]
690 @end display 
691
692 The /BINOMIAL subcommand compares the observed distribution of a dichotomous 
693 variable with that of a binomial distribution.
694 The variable @var{p} specifies the test proportion of the binomial 
695 distribution.  
696 The default value of 0.5 is assumed if @var{p} is omitted.
697
698 If a single value appears after the variable list, then that value is
699 used as the threshold to partition the observed values. Values less
700 than or equal to the threshold value form the first category.  Values
701 greater than the threshold form the second category. 
702
703 If two values appear after the variable list, then they will be used
704 as the values which a variable must take to be in the respective
705 category. 
706 Cases for which a variable takes a value equal to neither of the specified  
707 values, take no part in the test for that variable.
708
709 If no values appear, then the variable must assume dichotomous
710 values.
711 If more than two distinct, non-missing values for a variable
712 under test are encountered then an error occurs.
713
714 If the test proportion is equal to 0.5, then a two tailed test is
715 reported.   For any other test proportion, a one tailed test is
716 reported.   
717 For one tailed tests, if the test proportion is less than
718 or equal to the observed proportion, then the significance of
719 observing the observed proportion or more is reported.
720 If the test proportion is more than the observed proportion, then the
721 significance of observing the observed proportion or less is reported.
722 That is to say, the test is always performed in the observed
723 direction. 
724
725 PSPP uses a very precise approximation to the gamma function to
726 compute the binomial significance.  Thus, exact results are reported
727 even for very large sample sizes.
728
729
730
731 @node    CHISQUARE
732 @subsection Chisquare Test
733 @vindex CHISQUARE
734 @cindex chisquare test
735
736
737 @display
738      [ /CHISQUARE=var_list[(lo,hi)] [/EXPECTED=@{EQUAL|f1, f2 @dots{} fn@}] ]
739 @end display 
740
741
742 The /CHISQUARE subcommand produces a chi-square statistic for the differences 
743 between the expected and observed frequencies of the categories of a variable. 
744 Optionally, a range of values may appear after the variable list.  
745 If a range is given, then non integer values are truncated, and values
746 outside the  specified range are excluded from the analysis.
747
748 The /EXPECTED subcommand specifies the expected values of each
749 category.  
750 There must be exactly one non-zero expected value, for each observed
751 category, or the EQUAL keywork must be specified.
752 You may use the notation @var{n}*@var{f} to specify @var{n}
753 consecutive expected categories all taking a frequency of @var{f}.
754 The frequencies given are proportions, not absolute frequencies.  The
755 sum of the frequencies need not be 1.
756 If no /EXPECTED subcommand is given, then then equal frequencies 
757 are expected.
758
759 @node WILCOXON
760 @subsection Wilcoxon Matched Pairs Signed Ranks Test
761 @comment  node-name,  next,  previous,  up
762 @vindex WILCOXON
763 @cindex wilcoxon matched pairs signed ranks test
764
765 @display
766      [ /WILCOXON varlist [ WITH varlist [ (PAIRED) ]]]
767 @end display
768
769 The /WILCOXON subcommand tests for differences between medians of the 
770 variables listed.
771 The test does not make any assumptions about the variances of the samples.
772 It does however assume that the distribution is symetrical.
773
774 If the @code{WITH} keyword is omitted, then tests for all
775 combinations of the listed variables are performed.
776 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
777 is also given, then the number of variables preceding @code{WITH}
778 must be the same as the number following it.
779 In this case, tests for each respective pair of variables are
780 performed.
781 If the @code{WITH} keyword is given, but the
782 @code{(PAIRED)} keyword is omitted, then tests for each combination
783 of variable preceding @code{WITH} against variable following
784 @code{WITH} are performed.
785
786
787 @node SIGN
788 @subsection Sign Test
789 @vindex SIGN
790 @cindex sign test
791
792 @display
793      [ /SIGN varlist [ WITH varlist [ (PAIRED) ]]]
794 @end display
795
796 The /SIGN subcommand tests for differences between medians of the 
797 variables listed.
798 The test does not make any assumptions about the
799 distribution of the data.
800
801 If the @code{WITH} keyword is omitted, then tests for all
802 combinations of the listed variables are performed.
803 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
804 is also given, then the number of variables preceding @code{WITH}
805 must be the same as the number following it.
806 In this case, tests for each respective pair of variables are
807 performed.
808 If the @code{WITH} keyword is given, but the
809 @code{(PAIRED)} keyword is omitted, then tests for each combination
810 of variable preceding @code{WITH} against variable following
811 @code{WITH} are performed.
812
813 @node T-TEST
814 @comment  node-name,  next,  previous,  up
815 @section T-TEST
816
817 @vindex T-TEST
818
819 @display
820 T-TEST
821         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
822         /CRITERIA=CIN(confidence)
823
824
825 (One Sample mode.)
826         TESTVAL=test_value
827         /VARIABLES=var_list
828
829
830 (Independent Samples mode.)
831         GROUPS=var(value1 [, value2])
832         /VARIABLES=var_list
833
834
835 (Paired Samples mode.)
836         PAIRS=var_list [WITH var_list [(PAIRED)] ]
837
838 @end display
839
840
841 The @cmd{T-TEST} procedure outputs tables used in testing hypotheses about 
842 means.  
843 It operates in one of three modes:
844 @itemize
845 @item One Sample mode.
846 @item Independent Groups mode.
847 @item Paired mode.
848 @end itemize
849
850 @noindent
851 Each of these modes are described in more detail below.
852 There are two optional subcommands which are common to all modes.
853
854 The @cmd{/CRITERIA} subcommand tells PSPP the confidence interval used
855 in the tests.  The default value is 0.95.
856
857
858 The @cmd{MISSING} subcommand determines the handling of missing
859 variables.  
860 If INCLUDE is set, then user-missing values are included in the
861 calculations, but system-missing values are not.
862 If EXCLUDE is set, which is the default, user-missing
863 values are excluded as well as system-missing values. 
864 This is the default.
865
866 If LISTWISE is set, then the entire case is excluded from analysis
867 whenever any variable  specified in the @cmd{/VARIABLES}, @cmd{/PAIRS} or 
868 @cmd{/GROUPS} subcommands contains a missing value.   
869 If ANALYSIS is set, then missing values are excluded only in the analysis for
870 which they would be needed. This is the default.
871
872
873 @menu
874 * One Sample Mode::             Testing against a hypothesised mean
875 * Independent Samples Mode::    Testing two independent groups for equal mean
876 * Paired Samples Mode::         Testing two interdependent groups for equal mean
877 @end menu
878
879 @node One Sample Mode
880 @subsection One Sample Mode
881
882 The @cmd{TESTVAL} subcommand invokes the One Sample mode.
883 This mode is used to test a population mean against a hypothesised
884 mean. 
885 The value given to the @cmd{TESTVAL} subcommand is the value against
886 which you wish to test.
887 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
888 tell PSPP which variables you wish to test.
889
890 @node Independent Samples Mode
891 @comment  node-name,  next,  previous,  up
892 @subsection Independent Samples Mode
893
894 The @cmd{GROUPS} subcommand invokes Independent Samples mode or
895 `Groups' mode. 
896 This mode is used to test whether two groups of values have the
897 same population mean.
898 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
899 tell PSPP the dependent variables you wish to test.
900
901 The variable given in the @cmd{GROUPS} subcommand is the independent
902 variable which determines to which group the samples belong.
903 The values in parentheses are the specific values of the independent
904 variable for each group.
905 If the parentheses are omitted and no values are given, the default values 
906 of 1.0 and 2.0 are assumed.
907
908 If the independent variable is numeric, 
909 it is acceptable to specify only one value inside the parentheses.
910 If you do this, cases where the independent variable is
911 greater than or equal to this value belong to the first group, and cases
912 less than this value belong to the second group.
913 When using this form of the @cmd{GROUPS} subcommand, missing values in
914 the independent variable are excluded on a listwise basis, regardless
915 of whether @cmd{/MISSING=LISTWISE} was specified.
916
917
918 @node Paired Samples Mode
919 @comment  node-name,  next,  previous,  up
920 @subsection Paired Samples Mode
921
922 The @cmd{PAIRS} subcommand introduces Paired Samples mode.
923 Use this mode when repeated measures have been taken from the same
924 samples.
925 If the @code{WITH} keyword is omitted, then tables for all
926 combinations of variables given in the @cmd{PAIRS} subcommand are
927 generated. 
928 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
929 is also given, then the number of variables preceding @code{WITH}
930 must be the same as the number following it.
931 In this case, tables for each respective pair of variables are
932 generated.
933 In the event that the @code{WITH} keyword is given, but the
934 @code{(PAIRED)} keyword is omitted, then tables for each combination
935 of variable preceding @code{WITH} against variable following
936 @code{WITH} are generated.
937
938
939 @node ONEWAY
940 @comment  node-name,  next,  previous,  up
941 @section ONEWAY
942
943 @vindex ONEWAY
944 @cindex analysis of variance
945 @cindex ANOVA
946
947 @display
948 ONEWAY
949         [/VARIABLES = ] var_list BY var
950         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
951         /CONTRAST= value1 [, value2] ... [,valueN]
952         /STATISTICS=@{DESCRIPTIVES,HOMOGENEITY@}
953
954 @end display
955
956 The @cmd{ONEWAY} procedure performs a one-way analysis of variance of
957 variables factored by a single independent variable.
958 It is used to compare the means of a population
959 divided into more than two groups. 
960
961 The  variables to be analysed should be given in the @code{VARIABLES}
962 subcommand.  
963 The list of variables must be followed by the @code{BY} keyword and
964 the name of the independent (or factor) variable.
965
966 You can use the @code{STATISTICS} subcommand to tell PSPP to display
967 ancilliary information.  The options accepted are:
968 @itemize
969 @item DESCRIPTIVES
970 Displays descriptive statistics about the groups factored by the independent
971 variable.
972 @item HOMOGENEITY
973 Displays the Levene test of Homogeneity of Variance for the
974 variables and their groups.
975 @end itemize
976
977 The @code{CONTRAST} subcommand is used when you anticipate certain
978 differences between the groups.
979 The subcommand must be followed by a list of numerals which are the
980 coefficients of the groups to be tested.
981 The number of coefficients must correspond to the number of distinct
982 groups (or values of the independent variable).
983 If the total sum of the coefficients are not zero, then PSPP will
984 display a warning, but will proceed with the analysis.
985 The @code{CONTRAST} subcommand may be given up to 10 times in order
986 to specify different contrast tests.
987
988 @node RANK
989 @comment  node-name,  next,  previous,  up
990 @section RANK
991
992 @vindex RANK
993 @display
994 RANK
995         [VARIABLES=] var_list [@{A,D@}] [BY var_list]
996         /TIES=@{MEAN,LOW,HIGH,CONDENSE@}
997         /FRACTION=@{BLOM,TUKEY,VW,RANKIT@}
998         /PRINT[=@{YES,NO@}
999         /MISSING=@{EXCLUDE,INCLUDE@}
1000
1001         /RANK [INTO var_list]
1002         /NTILES(k) [INTO var_list]
1003         /NORMAL [INTO var_list]
1004         /PERCENT [INTO var_list]
1005         /RFRACTION [INTO var_list]
1006         /PROPORTION [INTO var_list]
1007         /N [INTO var_list]
1008         /SAVAGE [INTO var_list]
1009 @end display
1010
1011 The @cmd{RANK} command ranks variables and stores the results into new
1012 variables. 
1013
1014 The VARIABLES subcommand, which is mandatory, specifies one or
1015 more variables whose values are to be ranked.  
1016 After each variable, @samp{A} or @samp{D} may appear, indicating that
1017 the variable is to be ranked in ascending or descending order.
1018 Ascending is the default.
1019 If a BY keyword appears, it should be followed by a list of variables
1020 which are to serve as group variables.  
1021 In this case, the cases are gathered into groups, and ranks calculated
1022 for each group.
1023
1024 The TIES subcommand specifies how tied values are to be treated.  The
1025 default is to take the mean value of all the tied cases.
1026
1027 The FRACTION subcommand specifies how proportional ranks are to be
1028 calculated.  This only has any effect if NORMAL or PROPORTIONAL rank
1029 functions are requested.
1030
1031 The PRINT subcommand may be used to specify that a summary of the rank
1032 variables created should appear in the output.
1033
1034 The function subcommands are RANK, NTILES, NORMAL, PERCENT, RFRACTION,
1035 PROPORTION and SAVAGE.  Any number of function subcommands may appear.
1036 If none are given, then the default is RANK.
1037 The NTILES subcommand must take an integer specifying the number of
1038 partitions into which values should be ranked.
1039 Each subcommand may be followed by the INTO keyword and a list of
1040 variables which are the variables to be created and receive the rank
1041 scores.  There may be as many variables specified as there are
1042 variables named on the VARIABLES subcommand.  If fewer are specified,
1043 then the variable names are automatically created.
1044
1045 The MISSING subcommand determines how user missing values are to be
1046 treated. A setting of EXCLUDE means that variables whose values are
1047 user-missing are to be excluded from the rank scores. A setting of
1048 INCLUDE means they are to be included.  The default is EXCLUDE.
1049
1050 @include regression.texi
1051
1052
1053 @node RELIABILITY
1054 @section RELIABILITY
1055
1056 @vindex RELIABILITY
1057 @display
1058 RELIABILITY
1059         /VARIABLES=var_list
1060         /SCALE (@var{name}) = @{var_list, ALL@}
1061         /MODEL=@{ALPHA, SPLIT[(N)]@}
1062         /SUMMARY=@{TOTAL,ALL@}
1063         /MISSING=@{EXCLUDE,INCLUDE@}
1064 @end display
1065
1066 @cindex Cronbach's Alpha
1067 The @cmd{RELIABILTY} command performs reliablity analysis on the data.
1068
1069 The VARIABLES subcommand is required. It determines the set of variables 
1070 upon which analysis is to be performed.
1071
1072 The SCALE subcommand determines which variables reliability is to be 
1073 calculated for.  If it is omitted, then analysis for all variables named
1074 in the VARIABLES subcommand will be used.
1075 Optionally, the @var{name} parameter may be specified to set a string name 
1076 for the scale.
1077
1078 The MODEL subcommand determines the type of analysis. If ALPHA is specified, 
1079 then Cronbach's Alpha is calculated for the scale.  If the model is SPLIT, 
1080 then the variables  are divided into 2 subsets.  An optional parameter 
1081 @var{N} may be given, to specify how many variables to be in the first subset.
1082 If @var{N} is omitted, then it defaults to one half of the variables in the 
1083 scale, or one half minus one if there are an odd number of variables.
1084 The default model is ALPHA.
1085
1086 By default, any cases with user missing, or system missing values for 
1087 any variables given 
1088 in the VARIABLES subcommand will be omitted from analysis.
1089 The MISSING subcommand determines whether user missing values are to 
1090 be included or excluded in the analysis.
1091
1092 The SUMMARY subcommand determines the type of summary analysis to be performed.
1093 Currently there is only one type: SUMMARY=TOTAL, which displays per-item
1094 analysis tested against the totals.
1095
1096
1097
1098 @node ROC
1099 @section ROC
1100
1101 @vindex ROC
1102 @cindex Receiver Operating Characterstic
1103 @cindex Area under curve
1104
1105 @display
1106 ROC     @var{var_list} BY @var{state_var} (@var{state_value})
1107         /PLOT = @{ CURVE [(REFERENCE)], NONE @}
1108         /PRINT = [ SE ] [ COORDINATES ]
1109         /CRITERIA = [ CUTOFF(@{INCLUDE,EXCLUDE@}) ]
1110           [ TESTPOS (@{LARGE,SMALL@}) ]
1111           [ CI (@var{confidence}) ]
1112           [ DISTRIBUTION (@{FREE, NEGEXPO @}) ]
1113         /MISSING=@{EXCLUDE,INCLUDE@}
1114 @end display
1115
1116
1117 The @cmd{ROC} command is used to plot the receiver operating characteristic curve 
1118 of a dataset, and to estimate the area under the curve.
1119 This is useful for analysing the efficacy of a variable as a predictor of a state of nature.
1120
1121 The mandatory @var{var_list} is the list of predictor variables.
1122 The variable @var{state_var} is the variable whose values represent the actual states, 
1123 and @var{state_value} is the value of this variable which represents the positive state.
1124
1125 The optional subcommand PLOT is used to determine if and how the ROC curve is drawn.
1126 The keyword CURVE means that the ROC curve should be drawn, and the optional keyword REFERENCE,
1127 which should be enclosed in parentheses, says that the diagonal reference line should be drawn.
1128 If the keyword NONE is given, then no ROC curve is drawn.
1129 By default, the curve is drawn with no reference line.
1130
1131 The optional subcommand PRINT determines which additional tables should be printed.
1132 Two additional tables are available. 
1133 The SE keyword says that standard error of the area under the curve should be printed as well as
1134 the area itself.
1135 In addition, a p-value under the null hypothesis that the area under the curve equals 0.5 will be
1136 printed.
1137 The COORDINATES keyword says that a table of coordinates of the ROC curve should be printed.
1138
1139 The CRITERIA subcommand has four optional parameters:
1140 @itemize @bullet
1141 @item The TESTPOS parameter may be LARGE or SMALL.
1142 LARGE is the default, and says that larger values in the predictor variables are to be 
1143 considered positive.  SMALL indicates that smaller values should be considered positive.
1144
1145 @item The CI parameter specifies the confidence interval that should be printed.
1146 It has no effect if the SE keyword in the PRINT subcommand has not been given.
1147
1148 @item The DISTRIBUTION parameter determines the method to be used when estimating the area
1149 under the curve.  
1150 There are two possibilities, @i{viz}: FREE and NEGEXPO.
1151 The FREE method uses a non-parametric estimate, and the NEGEXPO method a bi-negative 
1152 exponential distribution estimate.
1153 The NEGEXPO method should only be used when the number of positive actual states is
1154 equal to the number of negative actual states.
1155 The default is FREE.
1156
1157 @item The CUTOFF parameter is for compatibility and is ignored.
1158 @end itemize
1159
1160 The MISSING subcommand determines whether user missing values are to 
1161 be included or excluded in the analysis.  The default behaviour is to
1162 exclude them.
1163 Cases are excluded on a listwise basis; if any of the variables in @var{var_list} 
1164 or if the variable @var{state_var} is missing, then the entire case will be 
1165 excluded.
1166
1167