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