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