01cd52d5f57a6b1b265b1352e8e110415d1a96b7
[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      [ /MISSING=@{PAIRWISE, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
322 @end display    
323
324 @cindex correlation
325 The @cmd{CORRELATIONS} procedure produces tables of the Pearson correlation coefficient
326 for a set of variables.  The significance of the coefficients are also given.
327
328 At least one VARIABLES subcommand is required. If the WITH keyword is used, then a non-square
329 correlation table will be produced.
330 The variables preceding WITH, will be used as the rows of the table, and the variables following
331 will be the columns of the table.
332 If no WITH subcommand is given, then a square, symmetrical table using all variables is produced.
333
334
335 The @cmd{MISSING} subcommand determines the handling of missing variables.  
336 If INCLUDE is set, then user-missing values are included in the
337 calculations, but system-missing values are not.
338 If EXCLUDE is set, which is the default, user-missing
339 values are excluded as well as system-missing values. 
340 This is the default.
341
342 If LISTWISE is set, then the entire case is excluded from analysis
343 whenever any variable  specified in the any @cmd{/VARIABLES} subcommand
344 contains a missing value.   
345 If PAIRWISE is set, then a case is considered missing only if either of the
346 values  for the particular coefficient are missing.
347 The default is PAIRWISE.
348
349 The PRINT subcommand is used to control how the reported significance values are printed.
350 If the TWOTAIL option is used, then a two-tailed test of significance is 
351 printed.  If the ONETAIL option is given, then a one-tailed test is used.
352 The default is TWOTAIL.
353
354 If the NOSIG option is specified, then correlation coefficients with significance less than
355 0.05 are highlighted.
356 If SIG is specified, then no highlighting is performed.  This is the default.
357
358
359
360 @node CROSSTABS
361 @section CROSSTABS
362
363 @vindex CROSSTABS
364 @display
365 CROSSTABS
366         /TABLES=var_list BY var_list [BY var_list]@dots{}
367         /MISSING=@{TABLE,INCLUDE,REPORT@}
368         /WRITE=@{NONE,CELLS,ALL@}
369         /FORMAT=@{TABLES,NOTABLES@}
370                 @{LABELS,NOLABELS,NOVALLABS@}
371                 @{PIVOT,NOPIVOT@}
372                 @{AVALUE,DVALUE@}
373                 @{NOINDEX,INDEX@}
374                 @{BOX,NOBOX@}
375         /CELLS=@{COUNT,ROW,COLUMN,TOTAL,EXPECTED,RESIDUAL,SRESIDUAL,
376                 ASRESIDUAL,ALL,NONE@}
377         /STATISTICS=@{CHISQ,PHI,CC,LAMBDA,UC,BTAU,CTAU,RISK,GAMMA,D,
378                      KAPPA,ETA,CORR,ALL,NONE@}
379         
380 (Integer mode.)
381         /VARIABLES=var_list (low,high)@dots{}
382 @end display
383
384 The @cmd{CROSSTABS} procedure displays crosstabulation
385 tables requested by the user.  It can calculate several statistics for
386 each cell in the crosstabulation tables.  In addition, a number of
387 statistics can be calculated for each table itself.
388
389 The TABLES subcommand is used to specify the tables to be reported.  Any
390 number of dimensions is permitted, and any number of variables per
391 dimension is allowed.  The TABLES subcommand may be repeated as many
392 times as needed.  This is the only required subcommand in @dfn{general
393 mode}.  
394
395 Occasionally, one may want to invoke a special mode called @dfn{integer
396 mode}.  Normally, in general mode, PSPP automatically determines
397 what values occur in the data.  In integer mode, the user specifies the
398 range of values that the data assumes.  To invoke this mode, specify the
399 VARIABLES subcommand, giving a range of data values in parentheses for
400 each variable to be used on the TABLES subcommand.  Data values inside
401 the range are truncated to the nearest integer, then assigned to that
402 value.  If values occur outside this range, they are discarded.  When it
403 is present, the VARIABLES subcommand must precede the TABLES
404 subcommand.
405
406 In general mode, numeric and string variables may be specified on
407 TABLES.  In integer mode, only numeric variables are allowed.
408
409 The MISSING subcommand determines the handling of user-missing values.
410 When set to TABLE, the default, missing values are dropped on a table by
411 table basis.  When set to INCLUDE, user-missing values are included in
412 tables and statistics.  When set to REPORT, which is allowed only in
413 integer mode, user-missing values are included in tables but marked with
414 an @samp{M} (for ``missing'') and excluded from statistical
415 calculations.
416
417 Currently the WRITE subcommand is ignored.
418
419 The FORMAT subcommand controls the characteristics of the
420 crosstabulation tables to be displayed.  It has a number of possible
421 settings:
422
423 @itemize @bullet
424 @item
425 TABLES, the default, causes crosstabulation tables to be output.
426 NOTABLES suppresses them.
427
428 @item
429 LABELS, the default, allows variable labels and value labels to appear
430 in the output.  NOLABELS suppresses them.  NOVALLABS displays variable
431 labels but suppresses value labels.
432
433 @item
434 PIVOT, the default, causes each TABLES subcommand to be displayed in a
435 pivot table format.  NOPIVOT causes the old-style crosstabulation format
436 to be used.
437
438 @item
439 AVALUE, the default, causes values to be sorted in ascending order.
440 DVALUE asserts a descending sort order.
441
442 @item
443 INDEX/NOINDEX is currently ignored.
444
445 @item
446 BOX/NOBOX is currently ignored.
447 @end itemize
448
449 The CELLS subcommand controls the contents of each cell in the displayed
450 crosstabulation table.  The possible settings are:
451
452 @table @asis
453 @item COUNT
454 Frequency count.
455 @item ROW
456 Row percent.
457 @item COLUMN
458 Column percent.
459 @item TOTAL
460 Table percent.
461 @item EXPECTED
462 Expected value.
463 @item RESIDUAL 
464 Residual.
465 @item SRESIDUAL
466 Standardized residual.
467 @item ASRESIDUAL
468 Adjusted standardized residual.
469 @item ALL
470 All of the above.
471 @item NONE
472 Suppress cells entirely.
473 @end table
474
475 @samp{/CELLS} without any settings specified requests COUNT, ROW,
476 COLUMN, and TOTAL.  If CELLS is not specified at all then only COUNT
477 will be selected.
478
479 The STATISTICS subcommand selects statistics for computation:
480
481 @table @asis
482 @item CHISQ
483 @cindex chisquare
484 @cindex chi-square
485
486 Pearson chi-square, likelihood ratio, Fisher's exact test, continuity
487 correction, linear-by-linear association.
488 @item PHI
489 Phi.
490 @item CC
491 Contingency coefficient.
492 @item LAMBDA
493 Lambda.
494 @item UC
495 Uncertainty coefficient.
496 @item BTAU
497 Tau-b.
498 @item CTAU
499 Tau-c.
500 @item RISK
501 Risk estimate.
502 @item GAMMA
503 Gamma.
504 @item D
505 Somers' D.
506 @item KAPPA
507 Cohen's Kappa.
508 @item ETA
509 Eta.
510 @item CORR
511 Spearman correlation, Pearson's r.
512 @item ALL
513 All of the above.
514 @item NONE
515 No statistics.
516 @end table
517
518 Selected statistics are only calculated when appropriate for the
519 statistic.  Certain statistics require tables of a particular size, and
520 some statistics are calculated only in integer mode.
521
522 @samp{/STATISTICS} without any settings selects CHISQ.  If the
523 STATISTICS subcommand is not given, no statistics are calculated.
524
525 @strong{Please note:} Currently the implementation of CROSSTABS has the
526 followings bugs:
527
528 @itemize @bullet
529 @item
530 Pearson's R (but not Spearman) is off a little.
531 @item
532 T values for Spearman's R and Pearson's R are wrong.
533 @item
534 Significance of symmetric and directional measures is not calculated.
535 @item
536 Asymmetric ASEs and T values for lambda are wrong.
537 @item
538 ASE of Goodman and Kruskal's tau is not calculated.
539 @item
540 ASE of symmetric somers' d is wrong.
541 @item
542 Approximate T of uncertainty coefficient is wrong.
543 @end itemize
544
545 Fixes for any of these deficiencies would be welcomed.
546
547 @node NPAR TESTS
548 @section NPAR TESTS
549
550 @vindex NPAR TESTS
551 @cindex nonparametric tests
552
553 @display 
554 NPAR TESTS
555      
556      nonparametric test subcommands
557      .
558      .
559      .
560      
561      [ /STATISTICS=@{DESCRIPTIVES@} ]
562
563      [ /MISSING=@{ANALYSIS, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
564
565      [ /METHOD=EXACT [ TIMER [(n)] ] ]
566 @end display
567
568 NPAR TESTS performs nonparametric tests. 
569 Non parametric tests make very few assumptions about the distribution of the 
570 data.
571 One or more tests may be specified by using the corresponding subcommand.
572 If the /STATISTICS subcommand is also specified, then summary statistics are 
573 produces for each variable that is the subject of any test.
574
575 Certain tests may take a long time to execute, if an exact figure is required.
576 Therefore, by default asymptotic approximations are used unless the
577 subcommand /METHOD=EXACT is specified.  
578 Exact tests give more accurate results, but may take an unacceptably long 
579 time to perform.  If the TIMER keyword is used, it sets a maximum time,
580 after which the test will be abandoned, and a warning message printed.
581 The time, in minutes, should be specified in parentheses after the TIMER keyword.
582 If the TIMER keyword is given without this figure, then a default value of 5 minutes 
583 is used.
584
585
586 @menu
587 * BINOMIAL::                Binomial Test
588 * CHISQUARE::               Chisquare Test
589 * WILCOXON::                Wilcoxon Signed Ranks Test
590 * SIGN::                    The Sign Test
591 @end menu
592
593
594 @node    BINOMIAL
595 @subsection Binomial test
596 @vindex BINOMIAL
597 @cindex binomial test
598
599 @display 
600      [ /BINOMIAL[(p)]=var_list[(value1[, value2)] ] ]
601 @end display 
602
603 The /BINOMIAL subcommand compares the observed distribution of a dichotomous 
604 variable with that of a binomial distribution.
605 The variable @var{p} specifies the test proportion of the binomial 
606 distribution.  
607 The default value of 0.5 is assumed if @var{p} is omitted.
608
609 If a single value appears after the variable list, then that value is
610 used as the threshold to partition the observed values. Values less
611 than or equal to the threshold value form the first category.  Values
612 greater than the threshold form the second category. 
613
614 If two values appear after the variable list, then they will be used
615 as the values which a variable must take to be in the respective
616 category. 
617 Cases for which a variable takes a value equal to neither of the specified  
618 values, take no part in the test for that variable.
619
620 If no values appear, then the variable must assume dichotomous
621 values.
622 If more than two distinct, non-missing values for a variable
623 under test are encountered then an error occurs.
624
625 If the test proportion is equal to 0.5, then a two tailed test is
626 reported.   For any other test proportion, a one tailed test is
627 reported.   
628 For one tailed tests, if the test proportion is less than
629 or equal to the observed proportion, then the significance of
630 observing the observed proportion or more is reported.
631 If the test proportion is more than the observed proportion, then the
632 significance of observing the observed proportion or less is reported.
633 That is to say, the test is always performed in the observed
634 direction. 
635
636 PSPP uses a very precise approximation to the gamma function to
637 compute the binomial significance.  Thus, exact results are reported
638 even for very large sample sizes.
639
640
641
642 @node    CHISQUARE
643 @subsection Chisquare Test
644 @vindex CHISQUARE
645 @cindex chisquare test
646
647
648 @display
649      [ /CHISQUARE=var_list[(lo,hi)] [/EXPECTED=@{EQUAL|f1, f2 @dots{} fn@}] ]
650 @end display 
651
652
653 The /CHISQUARE subcommand produces a chi-square statistic for the differences 
654 between the expected and observed frequencies of the categories of a variable. 
655 Optionally, a range of values may appear after the variable list.  
656 If a range is given, then non integer values are truncated, and values
657 outside the  specified range are excluded from the analysis.
658
659 The /EXPECTED subcommand specifies the expected values of each
660 category.  
661 There must be exactly one non-zero expected value, for each observed
662 category, or the EQUAL keywork must be specified.
663 You may use the notation @var{n}*@var{f} to specify @var{n}
664 consecutive expected categories all taking a frequency of @var{f}.
665 The frequencies given are proportions, not absolute frequencies.  The
666 sum of the frequencies need not be 1.
667 If no /EXPECTED subcommand is given, then then equal frequencies 
668 are expected.
669
670 @node WILCOXON
671 @subsection Wilcoxon Matched Pairs Signed Ranks Test
672 @comment  node-name,  next,  previous,  up
673 @vindex WILCOXON
674 @cindex wilcoxon matched pairs signed ranks test
675
676 @display
677      [ /WILCOXON varlist [ WITH varlist [ (PAIRED) ]]]
678 @end display
679
680 The /WILCOXON subcommand tests for differences between medians of the 
681 variables listed.
682 The test does not make any assumptions about the variances of the samples.
683 It does however assume that the distribution is symetrical.
684
685 If the @code{WITH} keyword is omitted, then tests for all
686 combinations of the listed variables are performed.
687 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
688 is also given, then the number of variables preceding @code{WITH}
689 must be the same as the number following it.
690 In this case, tests for each respective pair of variables are
691 performed.
692 If the @code{WITH} keyword is given, but the
693 @code{(PAIRED)} keyword is omitted, then tests for each combination
694 of variable preceding @code{WITH} against variable following
695 @code{WITH} are performed.
696
697
698 @node SIGN
699 @subsection Sign Test
700 @vindex SIGN
701 @cindex sign test
702
703 @display
704      [ /SIGN varlist [ WITH varlist [ (PAIRED) ]]]
705 @end display
706
707 The /SIGN subcommand tests for differences between medians of the 
708 variables listed.
709 The test does not make any assumptions about the
710 distribution of the data.
711
712 If the @code{WITH} keyword is omitted, then tests for all
713 combinations of the listed variables are performed.
714 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
715 is also given, then the number of variables preceding @code{WITH}
716 must be the same as the number following it.
717 In this case, tests for each respective pair of variables are
718 performed.
719 If the @code{WITH} keyword is given, but the
720 @code{(PAIRED)} keyword is omitted, then tests for each combination
721 of variable preceding @code{WITH} against variable following
722 @code{WITH} are performed.
723
724 @node T-TEST
725 @comment  node-name,  next,  previous,  up
726 @section T-TEST
727
728 @vindex T-TEST
729
730 @display
731 T-TEST
732         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
733         /CRITERIA=CIN(confidence)
734
735
736 (One Sample mode.)
737         TESTVAL=test_value
738         /VARIABLES=var_list
739
740
741 (Independent Samples mode.)
742         GROUPS=var(value1 [, value2])
743         /VARIABLES=var_list
744
745
746 (Paired Samples mode.)
747         PAIRS=var_list [WITH var_list [(PAIRED)] ]
748
749 @end display
750
751
752 The @cmd{T-TEST} procedure outputs tables used in testing hypotheses about 
753 means.  
754 It operates in one of three modes:
755 @itemize
756 @item One Sample mode.
757 @item Independent Groups mode.
758 @item Paired mode.
759 @end itemize
760
761 @noindent
762 Each of these modes are described in more detail below.
763 There are two optional subcommands which are common to all modes.
764
765 The @cmd{/CRITERIA} subcommand tells PSPP the confidence interval used
766 in the tests.  The default value is 0.95.
767
768
769 The @cmd{MISSING} subcommand determines the handling of missing
770 variables.  
771 If INCLUDE is set, then user-missing values are included in the
772 calculations, but system-missing values are not.
773 If EXCLUDE is set, which is the default, user-missing
774 values are excluded as well as system-missing values. 
775 This is the default.
776
777 If LISTWISE is set, then the entire case is excluded from analysis
778 whenever any variable  specified in the @cmd{/VARIABLES}, @cmd{/PAIRS} or 
779 @cmd{/GROUPS} subcommands contains a missing value.   
780 If ANALYSIS is set, then missing values are excluded only in the analysis for
781 which they would be needed. This is the default.
782
783
784 @menu
785 * One Sample Mode::             Testing against a hypothesised mean
786 * Independent Samples Mode::    Testing two independent groups for equal mean
787 * Paired Samples Mode::         Testing two interdependent groups for equal mean
788 @end menu
789
790 @node One Sample Mode
791 @subsection One Sample Mode
792
793 The @cmd{TESTVAL} subcommand invokes the One Sample mode.
794 This mode is used to test a population mean against a hypothesised
795 mean. 
796 The value given to the @cmd{TESTVAL} subcommand is the value against
797 which you wish to test.
798 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
799 tell PSPP which variables you wish to test.
800
801 @node Independent Samples Mode
802 @comment  node-name,  next,  previous,  up
803 @subsection Independent Samples Mode
804
805 The @cmd{GROUPS} subcommand invokes Independent Samples mode or
806 `Groups' mode. 
807 This mode is used to test whether two groups of values have the
808 same population mean.
809 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
810 tell PSPP the dependent variables you wish to test.
811
812 The variable given in the @cmd{GROUPS} subcommand is the independent
813 variable which determines to which group the samples belong.
814 The values in parentheses are the specific values of the independent
815 variable for each group.
816 If the parentheses are omitted and no values are given, the default values 
817 of 1.0 and 2.0 are assumed.
818
819 If the independent variable is numeric, 
820 it is acceptable to specify only one value inside the parentheses.
821 If you do this, cases where the independent variable is
822 greater than or equal to this value belong to the first group, and cases
823 less than this value belong to the second group.
824 When using this form of the @cmd{GROUPS} subcommand, missing values in
825 the independent variable are excluded on a listwise basis, regardless
826 of whether @cmd{/MISSING=LISTWISE} was specified.
827
828
829 @node Paired Samples Mode
830 @comment  node-name,  next,  previous,  up
831 @subsection Paired Samples Mode
832
833 The @cmd{PAIRS} subcommand introduces Paired Samples mode.
834 Use this mode when repeated measures have been taken from the same
835 samples.
836 If the @code{WITH} keyword is omitted, then tables for all
837 combinations of variables given in the @cmd{PAIRS} subcommand are
838 generated. 
839 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
840 is also given, then the number of variables preceding @code{WITH}
841 must be the same as the number following it.
842 In this case, tables for each respective pair of variables are
843 generated.
844 In the event that the @code{WITH} keyword is given, but the
845 @code{(PAIRED)} keyword is omitted, then tables for each combination
846 of variable preceding @code{WITH} against variable following
847 @code{WITH} are generated.
848
849
850 @node ONEWAY
851 @comment  node-name,  next,  previous,  up
852 @section ONEWAY
853
854 @vindex ONEWAY
855 @cindex analysis of variance
856 @cindex ANOVA
857
858 @display
859 ONEWAY
860         [/VARIABLES = ] var_list BY var
861         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
862         /CONTRAST= value1 [, value2] ... [,valueN]
863         /STATISTICS=@{DESCRIPTIVES,HOMOGENEITY@}
864
865 @end display
866
867 The @cmd{ONEWAY} procedure performs a one-way analysis of variance of
868 variables factored by a single independent variable.
869 It is used to compare the means of a population
870 divided into more than two groups. 
871
872 The  variables to be analysed should be given in the @code{VARIABLES}
873 subcommand.  
874 The list of variables must be followed by the @code{BY} keyword and
875 the name of the independent (or factor) variable.
876
877 You can use the @code{STATISTICS} subcommand to tell PSPP to display
878 ancilliary information.  The options accepted are:
879 @itemize
880 @item DESCRIPTIVES
881 Displays descriptive statistics about the groups factored by the independent
882 variable.
883 @item HOMOGENEITY
884 Displays the Levene test of Homogeneity of Variance for the
885 variables and their groups.
886 @end itemize
887
888 The @code{CONTRAST} subcommand is used when you anticipate certain
889 differences between the groups.
890 The subcommand must be followed by a list of numerals which are the
891 coefficients of the groups to be tested.
892 The number of coefficients must correspond to the number of distinct
893 groups (or values of the independent variable).
894 If the total sum of the coefficients are not zero, then PSPP will
895 display a warning, but will proceed with the analysis.
896 The @code{CONTRAST} subcommand may be given up to 10 times in order
897 to specify different contrast tests.
898
899 @node RANK
900 @comment  node-name,  next,  previous,  up
901 @section RANK
902
903 @vindex RANK
904 @display
905 RANK
906         [VARIABLES=] var_list [@{A,D@}] [BY var_list]
907         /TIES=@{MEAN,LOW,HIGH,CONDENSE@}
908         /FRACTION=@{BLOM,TUKEY,VW,RANKIT@}
909         /PRINT[=@{YES,NO@}
910         /MISSING=@{EXCLUDE,INCLUDE@}
911
912         /RANK [INTO var_list]
913         /NTILES(k) [INTO var_list]
914         /NORMAL [INTO var_list]
915         /PERCENT [INTO var_list]
916         /RFRACTION [INTO var_list]
917         /PROPORTION [INTO var_list]
918         /N [INTO var_list]
919         /SAVAGE [INTO var_list]
920 @end display
921
922 The @cmd{RANK} command ranks variables and stores the results into new
923 variables. 
924
925 The VARIABLES subcommand, which is mandatory, specifies one or
926 more variables whose values are to be ranked.  
927 After each variable, @samp{A} or @samp{D} may appear, indicating that
928 the variable is to be ranked in ascending or descending order.
929 Ascending is the default.
930 If a BY keyword appears, it should be followed by a list of variables
931 which are to serve as group variables.  
932 In this case, the cases are gathered into groups, and ranks calculated
933 for each group.
934
935 The TIES subcommand specifies how tied values are to be treated.  The
936 default is to take the mean value of all the tied cases.
937
938 The FRACTION subcommand specifies how proportional ranks are to be
939 calculated.  This only has any effect if NORMAL or PROPORTIONAL rank
940 functions are requested.
941
942 The PRINT subcommand may be used to specify that a summary of the rank
943 variables created should appear in the output.
944
945 The function subcommands are RANK, NTILES, NORMAL, PERCENT, RFRACTION,
946 PROPORTION and SAVAGE.  Any number of function subcommands may appear.
947 If none are given, then the default is RANK.
948 The NTILES subcommand must take an integer specifying the number of
949 partitions into which values should be ranked.
950 Each subcommand may be followed by the INTO keyword and a list of
951 variables which are the variables to be created and receive the rank
952 scores.  There may be as many variables specified as there are
953 variables named on the VARIABLES subcommand.  If fewer are specified,
954 then the variable names are automatically created.
955
956 The MISSING subcommand determines how user missing values are to be
957 treated. A setting of EXCLUDE means that variables whose values are
958 user-missing are to be excluded from the rank scores. A setting of
959 INCLUDE means they are to be included.  The default is EXCLUDE.
960
961 @include regression.texi
962
963
964 @node RELIABILITY
965 @section RELIABILITY
966
967 @vindex RELIABILITY
968 @display
969 RELIABILITY
970         /VARIABLES=var_list
971         /SCALE (@var{name}) = @{var_list, ALL@}
972         /MODEL=@{ALPHA, SPLIT[(N)]@}
973         /SUMMARY=@{TOTAL,ALL@}
974         /MISSING=@{EXCLUDE,INCLUDE@}
975 @end display
976
977 @cindex Cronbach's Alpha
978 The @cmd{RELIABILTY} command performs reliablity analysis on the data.
979
980 The VARIABLES subcommand is required. It determines the set of variables 
981 upon which analysis is to be performed.
982
983 The SCALE subcommand determines which variables reliability is to be 
984 calculated for.  If it is omitted, then analysis for all variables named
985 in the VARIABLES subcommand will be used.
986 Optionally, the @var{name} parameter may be specified to set a string name 
987 for the scale.
988
989 The MODEL subcommand determines the type of analysis. If ALPHA is specified, 
990 then Cronbach's Alpha is calculated for the scale.  If the model is SPLIT, 
991 then the variables  are divided into 2 subsets.  An optional parameter 
992 @var{N} may be given, to specify how many variables to be in the first subset.
993 If @var{N} is omitted, then it defaults to one half of the variables in the 
994 scale, or one half minus one if there are an odd number of variables.
995 The default model is ALPHA.
996
997 By default, any cases with user missing, or system missing values for 
998 any variables given 
999 in the VARIABLES subcommand will be omitted from analysis.
1000 The MISSING subcommand determines whether user missing values are to 
1001 be included or excluded in the analysis.
1002
1003 The SUMMARY subcommand determines the type of summary analysis to be performed.
1004 Currently there is only one type: SUMMARY=TOTAL, which displays per-item
1005 analysis tested against the totals.
1006
1007
1008
1009 @node ROC
1010 @section ROC
1011
1012 @vindex ROC
1013 @cindex Receiver Operating Characterstic
1014 @cindex Area under curve
1015
1016 @display
1017 ROC     @var{var_list} BY @var{state_var} (@var{state_value})
1018         /PLOT = @{ CURVE [(REFERENCE)], NONE @}
1019         /PRINT = [ SE ] [ COORDINATES ]
1020         /CRITERIA = [ CUTOFF(@{INCLUDE,EXCLUDE@}) ]
1021           [ TESTPOS (@{LARGE,SMALL@}) ]
1022           [ CI (@var{confidence}) ]
1023           [ DISTRIBUTION (@{FREE, NEGEXPO @}) ]
1024         /MISSING=@{EXCLUDE,INCLUDE@}
1025 @end display
1026
1027
1028 The @cmd{ROC} command is used to plot the receiver operating characteristic curve 
1029 of a dataset, and to estimate the area under the curve.
1030 This is useful for analysing the efficacy of a variable as a predictor of a state of nature.
1031
1032 The mandatory @var{var_list} is the list of predictor variables.
1033 The variable @var{state_var} is the variable whose values represent the actual states, 
1034 and @var{state_value} is the value of this variable which represents the positive state.
1035
1036 The optional subcommand PLOT is used to determine if and how the ROC curve is drawn.
1037 The keyword CURVE means that the ROC curve should be drawn, and the optional keyword REFERENCE,
1038 which should be enclosed in parentheses, says that the diagonal reference line should be drawn.
1039 If the keyword NONE is given, then no ROC curve is drawn.
1040 By default, the curve is drawn with no reference line.
1041
1042 The optional subcommand PRINT determines which additional tables should be printed.
1043 Two additional tables are available. 
1044 The SE keyword says that standard error of the area under the curve should be printed as well as
1045 the area itself.
1046 In addition, a p-value under the null hypothesis that the area under the curve equals 0.5 will be
1047 printed.
1048 The COORDINATES keyword says that a table of coordinates of the ROC curve should be printed.
1049
1050 The CRITERIA subcommand has four optional parameters:
1051 @itemize @bullet
1052 @item The TESTPOS parameter may be LARGE or SMALL.
1053 LARGE is the default, and says that larger values in the predictor variables are to be 
1054 considered positive.  SMALL indicates that smaller values should be considered positive.
1055
1056 @item The CI parameter specifies the confidence interval that should be printed.
1057 It has no effect if the SE keyword in the PRINT subcommand has not been given.
1058
1059 @item The DISTRIBUTION parameter determines the method to be used when estimating the area
1060 under the curve.  
1061 There are two possibilities, @i{viz}: FREE and NEGEXPO.
1062 The FREE method uses a non-parametric estimate, and the NEGEXPO method a bi-negative 
1063 exponential distribution estimate.
1064 The NEGEXPO method should only be used when the number of positive actual states is
1065 equal to the number of negative actual states.
1066 The default is FREE.
1067
1068 @item The CUTOFF parameter is for compatibility and is ignored.
1069 @end itemize
1070
1071 The MISSING subcommand determines whether user missing values are to 
1072 be included or excluded in the analysis.  The default behaviour is to
1073 exclude them.
1074 Cases are excluded on a listwise basis; if any of the variables in @var{var_list} 
1075 or if the variable @var{state_var} is missing, then the entire case will be 
1076 excluded.
1077
1078