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