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