Merge remote-tracking branch 'origin/master' into sheet
[pspp] / doc / statistics.texi
1 @node Statistics
2 @chapter Statistics
3
4 This chapter documents the statistical procedures that @pspp{} supports so
5 far.
6
7 @menu
8 * DESCRIPTIVES::                Descriptive statistics.
9 * FREQUENCIES::                 Frequency tables.
10 * EXAMINE::                     Testing data for normality.
11 * GRAPH::                       Plot data.
12 * CORRELATIONS::                Correlation tables.
13 * CROSSTABS::                   Crosstabulation tables.
14 * FACTOR::                      Factor analysis and Principal Components analysis.
15 * GLM::                         Univariate Linear Models.
16 * LOGISTIC REGRESSION::         Bivariate Logistic Regression.
17 * MEANS::                       Average values and other statistics.
18 * NPAR TESTS::                  Nonparametric tests.
19 * T-TEST::                      Test hypotheses about means.
20 * ONEWAY::                      One way analysis of variance.
21 * QUICK CLUSTER::               K-Means clustering.
22 * RANK::                        Compute rank scores.
23 * REGRESSION::                  Linear regression.
24 * RELIABILITY::                 Reliability analysis.
25 * ROC::                         Receiver Operating Characteristic.
26 @end menu
27
28 @node DESCRIPTIVES
29 @section DESCRIPTIVES
30
31 @vindex DESCRIPTIVES
32 @display
33 DESCRIPTIVES
34         /VARIABLES=@var{var_list}
35         /MISSING=@{VARIABLE,LISTWISE@} @{INCLUDE,NOINCLUDE@}
36         /FORMAT=@{LABELS,NOLABELS@} @{NOINDEX,INDEX@} @{LINE,SERIAL@}
37         /SAVE
38         /STATISTICS=@{ALL,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,
39                      SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,DEFAULT,
40                      SESKEWNESS,SEKURTOSIS@}
41         /SORT=@{NONE,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,SKEWNESS,
42                RANGE,MINIMUM,MAXIMUM,SUM,SESKEWNESS,SEKURTOSIS,NAME@}
43               @{A,D@}
44 @end display
45
46 The @cmd{DESCRIPTIVES} procedure reads the active dataset and outputs
47 descriptive
48 statistics requested by the user.  In addition, it can optionally
49 compute Z-scores.
50
51 The @subcmd{VARIABLES} subcommand, which is required, specifies the list of
52 variables to be analyzed.  Keyword @subcmd{VARIABLES} is optional.
53
54 All other subcommands are optional:
55
56 The @subcmd{MISSING} subcommand determines the handling of missing variables.  If
57 @subcmd{INCLUDE} is set, then user-missing values are included in the
58 calculations.  If @subcmd{NOINCLUDE} is set, which is the default, user-missing
59 values are excluded.  If @subcmd{VARIABLE} is set, then missing values are
60 excluded on a variable by variable basis; if @subcmd{LISTWISE} is set, then
61 the entire case is excluded whenever any value in that case has a
62 system-missing or, if @subcmd{INCLUDE} is set, user-missing value.
63
64 The @subcmd{FORMAT} subcommand affects the output format.  Currently the
65 @subcmd{LABELS/NOLABELS} and @subcmd{NOINDEX/INDEX} settings are not used.
66 When @subcmd{SERIAL} is
67 set, both valid and missing number of cases are listed in the output;
68 when @subcmd{NOSERIAL} is set, only valid cases are listed.
69
70 The @subcmd{SAVE} subcommand causes @cmd{DESCRIPTIVES} to calculate Z scores for all
71 the specified variables.  The Z scores are saved to new variables.
72 Variable names are generated by trying first the original variable name
73 with Z prepended and truncated to a maximum of 8 characters, then the
74 names ZSC000 through ZSC999, STDZ00 through STDZ09, ZZZZ00 through
75 ZZZZ09, ZQZQ00 through ZQZQ09, in that sequence.  In addition, Z score
76 variable names can be specified explicitly on @subcmd{VARIABLES} in the variable
77 list by enclosing them in parentheses after each variable.
78 When Z scores are calculated, @pspp{} ignores @cmd{TEMPORARY},
79 treating temporary transformations as permanent.
80
81 The @subcmd{STATISTICS} subcommand specifies the statistics to be displayed:
82
83 @table @code
84 @item @subcmd{ALL}
85 All of the statistics below.
86 @item @subcmd{MEAN}
87 Arithmetic mean.
88 @item @subcmd{SEMEAN}
89 Standard error of the mean.
90 @item @subcmd{STDDEV}
91 Standard deviation.
92 @item @subcmd{VARIANCE}
93 Variance.
94 @item @subcmd{KURTOSIS}
95 Kurtosis and standard error of the kurtosis.
96 @item @subcmd{SKEWNESS}
97 Skewness and standard error of the skewness.
98 @item @subcmd{RANGE}
99 Range.
100 @item MINIMUM
101 Minimum value.
102 @item MAXIMUM
103 Maximum value.
104 @item SUM
105 Sum.
106 @item DEFAULT
107 Mean, standard deviation of the mean, minimum, maximum.
108 @item SEKURTOSIS
109 Standard error of the kurtosis.
110 @item SESKEWNESS
111 Standard error of the skewness.
112 @end table
113
114 The @subcmd{SORT} subcommand specifies how the statistics should be sorted.  Most
115 of the possible values should be self-explanatory.  @subcmd{NAME} causes the
116 statistics to be sorted by name.  By default, the statistics are listed
117 in the order that they are specified on the @subcmd{VARIABLES} subcommand.
118 The @subcmd{A} and @subcmd{D} settings request an ascending or descending
119 sort order, respectively.
120
121 @node FREQUENCIES
122 @section FREQUENCIES
123
124 @vindex FREQUENCIES
125 @display
126 FREQUENCIES
127         /VARIABLES=@var{var_list}
128         /FORMAT=@{TABLE,NOTABLE,LIMIT(@var{limit})@}
129                 @{AVALUE,DVALUE,AFREQ,DFREQ@}
130         /MISSING=@{EXCLUDE,INCLUDE@}
131         /STATISTICS=@{DEFAULT,MEAN,SEMEAN,MEDIAN,MODE,STDDEV,VARIANCE,
132                      KURTOSIS,SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,
133                      SESKEWNESS,SEKURTOSIS,ALL,NONE@}
134         /NTILES=@var{ntiles}
135         /PERCENTILES=percent@dots{}
136         /HISTOGRAM=[MINIMUM(@var{x_min})] [MAXIMUM(@var{x_max})] 
137                    [@{FREQ[(@var{y_max})],PERCENT[(@var{y_max})]@}] [@{NONORMAL,NORMAL@}]
138         /PIECHART=[MINIMUM(@var{x_min})] [MAXIMUM(@var{x_max})]
139                   [@{FREQ,PERCENT@}] [@{NOMISSING,MISSING@}]
140         /BARCHART=[MINIMUM(@var{x_min})] [MAXIMUM(@var{x_max})]
141                   [@{FREQ,PERCENT@}]
142         /ORDER=@{ANALYSIS,VARIABLE@}
143
144
145 (These options are not currently implemented.)
146         /HBAR=@dots{}
147         /GROUPED=@dots{}
148 @end display
149
150 The @cmd{FREQUENCIES} procedure outputs frequency tables for specified
151 variables.
152 @cmd{FREQUENCIES} can also calculate and display descriptive statistics
153 (including median and mode) and percentiles, and various graphical representations
154 of the frequency distribution.
155
156 The @subcmd{VARIABLES} subcommand is the only required subcommand.  Specify the
157 variables to be analyzed.
158
159 The @subcmd{FORMAT} subcommand controls the output format.  It has several
160 possible settings:  
161
162 @itemize @subcmd{}
163 @item
164 @subcmd{TABLE}, the default, causes a frequency table to be output for every
165 variable specified.  @subcmd{NOTABLE} prevents them from being output.  @subcmd{LIMIT}
166 with a numeric argument causes them to be output except when there are
167 more than the specified number of values in the table.
168
169 @item
170 Normally frequency tables are sorted in ascending order by value.  This
171 is @subcmd{AVALUE}.  @subcmd{DVALUE} tables are sorted in descending order by value.
172 @subcmd{AFREQ} and @subcmd{DFREQ} tables are sorted in ascending and descending order,
173 respectively, by frequency count.
174 @end itemize
175
176 The @subcmd{MISSING} subcommand controls the handling of user-missing values.
177 When @subcmd{EXCLUDE}, the default, is set, user-missing values are not included
178 in frequency tables or statistics.  When @subcmd{INCLUDE} is set, user-missing
179 are included.  System-missing values are never included in statistics,
180 but are listed in frequency tables.
181
182 The available @subcmd{STATISTICS} are the same as available 
183 in @cmd{DESCRIPTIVES} (@pxref{DESCRIPTIVES}), with the addition 
184 of @subcmd{MEDIAN}, the data's median
185 value, and MODE, the mode.  (If there are multiple modes, the smallest
186 value is reported.)  By default, the mean, standard deviation of the
187 mean, minimum, and maximum are reported for each variable.
188
189 @cindex percentiles
190 @subcmd{PERCENTILES} causes the specified percentiles to be reported.
191 The percentiles should  be presented at a list of numbers between 0
192 and 100 inclusive.  
193 The @subcmd{NTILES} subcommand causes the percentiles to be reported at the
194 boundaries of the data set divided into the specified number of ranges.
195 For instance, @subcmd{/NTILES=4} would cause quartiles to be reported.
196
197 @cindex histogram
198 The @subcmd{HISTOGRAM} subcommand causes the output to include a histogram for
199 each specified numeric variable.  The X axis by default ranges from
200 the minimum to the maximum value observed in the data, but the @subcmd{MINIMUM}
201 and @subcmd{MAXIMUM} keywords can set an explicit range. 
202 @footnote{The number of
203 bins is chosen according to the Freedman-Diaconis rule:
204 @math{2 \times IQR(x)n^{-1/3}}, where @math{IQR(x)} is the interquartile range of @math{x}
205 and @math{n} is the number of samples.    Note that
206 @cmd{EXAMINE} uses a different algorithm to determine bin sizes.}
207 Histograms are not created for string variables.
208
209 Specify @subcmd{NORMAL} to superimpose a normal curve on the
210 histogram.
211
212 @cindex piechart
213 The @subcmd{PIECHART} subcommand adds a pie chart for each variable to the data.  Each
214 slice represents one value, with the size of the slice proportional to
215 the value's frequency.  By default, all non-missing values are given
216 slices.  
217 The @subcmd{MINIMUM} and @subcmd{MAXIMUM} keywords can be used to limit the
218 displayed slices to a given range of values.  
219 The keyword @subcmd{NOMISSING} causes missing values to be omitted from the
220 piechart.  This is the default.
221 If instead, @subcmd{MISSING} is specified, then a single slice
222 will be included representing all system missing and user-missing cases.
223
224 @cindex bar chart
225 The @subcmd{BARCHART} subcommand produces a bar chart for each variable.
226 The @subcmd{MINIMUM} and @subcmd{MAXIMUM} keywords can be used to omit
227 categories whose counts which lie outside the specified limits.
228 The @subcmd{FREQ} option (default) causes the ordinate to display the frequency
229 of each category, whereas the @subcmd{PERCENT} option will display relative
230 percentages.
231
232 The @subcmd{FREQ} and @subcmd{PERCENT} options on @subcmd{HISTOGRAM} and 
233 @subcmd{PIECHART} are accepted but not currently honoured.
234
235 The @subcmd{ORDER} subcommand is accepted but ignored.
236
237 @node EXAMINE
238 @section EXAMINE
239
240 @vindex EXAMINE
241 @cindex Exploratory data analysis
242 @cindex normality, testing
243
244 @display
245 EXAMINE
246         VARIABLES= @var{var1} [@var{var2}] @dots{} [@var{varN}]
247            [BY @var{factor1} [BY @var{subfactor1}]
248              [ @var{factor2} [BY @var{subfactor2}]]
249              @dots{}
250              [ @var{factor3} [BY @var{subfactor3}]]
251             ]
252         /STATISTICS=@{DESCRIPTIVES, EXTREME[(@var{n})], ALL, NONE@}
253         /PLOT=@{BOXPLOT, NPPLOT, HISTOGRAM, SPREADLEVEL[(@var{t})], ALL, NONE@}
254         /CINTERVAL @var{p}
255         /COMPARE=@{GROUPS,VARIABLES@}
256         /ID=@var{identity_variable}
257         /@{TOTAL,NOTOTAL@}
258         /PERCENTILE=[@var{percentiles}]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @}
259         /MISSING=@{LISTWISE, PAIRWISE@} [@{EXCLUDE, INCLUDE@}] 
260                 [@{NOREPORT,REPORT@}]
261
262 @end display
263
264 The @cmd{EXAMINE} command is used to perform exploratory data analysis.
265 In particular, it is useful for testing how closely a distribution follows a
266 normal distribution, and for finding outliers and extreme values.
267
268 The @subcmd{VARIABLES} subcommand is mandatory.  
269 It specifies the dependent variables and optionally variables to use as
270 factors for the analysis.
271 Variables listed before the first @subcmd{BY} keyword (if any) are the 
272 dependent variables.
273 The dependent variables may optionally be followed by a list of
274 factors which tell @pspp{} how to break down the analysis for each
275 dependent variable. 
276
277 Following the dependent variables, factors may be specified.
278 The factors (if desired) should be preceded by a single @subcmd{BY} keyword.
279 The format for each factor is 
280 @display
281 @var{factorvar} [BY @var{subfactorvar}].
282 @end display
283 Each unique combination of the values of  @var{factorvar} and
284 @var{subfactorvar} divide the dataset into @dfn{cells}.
285 Statistics will be calculated for each cell
286 and for the entire dataset (unless @subcmd{NOTOTAL} is given).
287
288 The @subcmd{STATISTICS} subcommand specifies which statistics to show.
289 @subcmd{DESCRIPTIVES} will produce a table showing some parametric and
290 non-parametrics statistics.
291 @subcmd{EXTREME} produces a table showing the extremities of each cell.
292 A number in parentheses, @var{n} determines
293 how many upper and lower extremities to show.
294 The default number is 5.
295
296 The subcommands @subcmd{TOTAL} and @subcmd{NOTOTAL} are mutually exclusive.
297 If @subcmd{TOTAL} appears, then statistics will be produced for the entire dataset
298 as well as for each cell.
299 If @subcmd{NOTOTAL} appears, then statistics will be produced only for the cells
300 (unless no factor variables have been given).
301 These subcommands have no effect if there have  been no factor variables
302 specified.
303
304 @cindex boxplot
305 @cindex histogram
306 @cindex npplot
307 @cindex spreadlevel plot
308 The @subcmd{PLOT} subcommand specifies which plots are to be produced if any.
309 Available plots are @subcmd{HISTOGRAM}, @subcmd{NPPLOT},  @subcmd{BOXPLOT} and
310 @subcmd{SPREADLEVEL}.
311 The first three can be used to visualise how closely each cell conforms to a 
312 normal distribution, whilst the spread vs.@: level plot can be useful to visualise
313 how the variance of differs between factors.
314 Boxplots will also show you the outliers and extreme values.
315 @footnote{@subcmd{HISTOGRAM} uses Sturges' rule to determine the number of
316 bins, as approximately @math{1 + \log2(n)}, where @math{n} is the number of samples.
317 Note that @cmd{FREQUENCIES} uses a different algorithm to find the bin size.}
318
319 The @subcmd{SPREADLEVEL} plot displays the interquartile range versus the 
320 median.  It takes an optional parameter @var{t}, which specifies how the data
321 should be transformed prior to plotting.
322 The given value @var{t} is a power to which the data is raised.  For example, if
323 @var{t} is given as 2, then the data will be squared.
324 Zero, however is a special value.  If @var{t} is 0 or 
325 is omitted, then data will be transformed by taking its natural logarithm instead of
326 raising to the power of @var{t}.
327
328 The @subcmd{COMPARE} subcommand is only relevant if producing boxplots, and it is only 
329 useful there is more than one dependent variable and at least one factor.
330 If 
331 @subcmd{/COMPARE=GROUPS} is specified, then one plot per dependent variable is produced,
332 each of which contain boxplots for all the cells.
333 If @subcmd{/COMPARE=VARIABLES} is specified, then one plot per cell is produced,
334 each containing one boxplot per dependent variable.
335 If the @subcmd{/COMPARE} subcommand is omitted, then @pspp{} behaves as if
336 @subcmd{/COMPARE=GROUPS} were given.
337  
338 The @subcmd{ID} subcommand is relevant only if @subcmd{/PLOT=BOXPLOT} or 
339 @subcmd{/STATISTICS=EXTREME} has been given.
340 If given, it should provide the name of a variable which is to be used
341 to labels extreme values and outliers.
342 Numeric or string variables are permissible.  
343 If the @subcmd{ID} subcommand is not given, then the case number will be used for
344 labelling.
345
346 The @subcmd{CINTERVAL} subcommand specifies the confidence interval to use in
347 calculation of the descriptives command.  The default is 95%.
348
349 @cindex percentiles
350 The @subcmd{PERCENTILES} subcommand specifies which percentiles are to be calculated, 
351 and which algorithm to use for calculating them.  The default is to
352 calculate the 5, 10, 25, 50, 75, 90, 95 percentiles using the
353 @subcmd{HAVERAGE} algorithm.
354
355 The @subcmd{TOTAL} and @subcmd{NOTOTAL} subcommands are mutually exclusive.  If @subcmd{NOTOTAL}
356 is given and factors have been specified in the @subcmd{VARIABLES} subcommand,
357 then then statistics for the unfactored dependent variables are
358 produced in addition to the factored variables.  If there are no
359 factors specified then @subcmd{TOTAL} and @subcmd{NOTOTAL} have no effect.
360
361
362 The following example will generate descriptive statistics and histograms for
363 two variables @var{score1} and @var{score2}.
364 Two factors are given, @i{viz}: @var{gender} and @var{gender} BY @var{culture}.
365 Therefore, the descriptives and histograms will be generated for each
366 distinct  value
367 of @var{gender} @emph{and} for each distinct combination of the values
368 of @var{gender} and @var{race}.
369 Since the @subcmd{NOTOTAL} keyword is given, statistics and histograms for 
370 @var{score1} and @var{score2} covering the  whole dataset are not produced.
371 @example
372 EXAMINE @var{score1} @var{score2} BY 
373         @var{gender}
374         @var{gender} BY @var{culture}
375         /STATISTICS = DESCRIPTIVES
376         /PLOT = HISTOGRAM
377         /NOTOTAL.
378 @end example
379
380 Here is a second example showing how the @cmd{examine} command can be used to find extremities.
381 @example
382 EXAMINE @var{height} @var{weight} BY 
383         @var{gender}
384         /STATISTICS = EXTREME (3)
385         /PLOT = BOXPLOT
386         /COMPARE = GROUPS
387         /ID = @var{name}.
388 @end example
389 In this example, we look at the height and weight of a sample of individuals and
390 how they differ between male and female.
391 A table showing the 3 largest and the 3 smallest values of @var{height} and 
392 @var{weight} for each gender, and for the whole dataset will be shown.
393 Boxplots will also be produced.
394 Because @subcmd{/COMPARE = GROUPS} was given, boxplots for male and female will be
395 shown in the same graphic, allowing us to easily see the difference between
396 the genders.
397 Since the variable @var{name} was specified on the @subcmd{ID} subcommand, this will be
398 used to label the extreme values.
399
400 @strong{Warning!}
401 If many dependent variables are specified, or if factor variables are
402 specified for which
403 there are many distinct values, then @cmd{EXAMINE} will produce a very
404 large quantity of output.
405
406 @node GRAPH
407 @section GRAPH
408
409 @vindex GRAPH
410 @cindex Exploratory data analysis
411 @cindex normality, testing
412
413 @display
414 GRAPH
415         /HISTOGRAM [(NORMAL)]= @var{var}
416         /SCATTERPLOT [(BIVARIATE)] = @var{var1} WITH @var{var2} [BY @var{var3}]
417         /BAR = @{@var{summary-function}(@var{var1}) | @var{count-function}@} BY @var{var2} [BY @var{var3}] 
418         [ /MISSING=@{LISTWISE, VARIABLE@} [@{EXCLUDE, INCLUDE@}] ] 
419                 [@{NOREPORT,REPORT@}]
420
421 @end display
422
423 The @cmd{GRAPH} produces graphical plots of data. Only one of the subcommands 
424 @subcmd{HISTOGRAM} or @subcmd{SCATTERPLOT} can be specified, i.e. only one plot
425 can be produced per call of @cmd{GRAPH}. The @subcmd{MISSING} is optional. 
426
427 @menu
428 * SCATTERPLOT::             Cartesian Plots
429 * HISTOGRAM::               Histograms
430 * BAR CHART::               Bar Charts
431 @end menu
432
433 @node SCATTERPLOT
434 @subsection Scatterplot
435 @cindex scatterplot
436
437 The subcommand @subcmd{SCATTERPLOT} produces an xy plot of the
438 data. The different values of the optional third variable @var{var3}
439 will result in different colours and/or markers for the plot. The
440 following is an example for producing a scatterplot.
441
442 @example
443 GRAPH   
444         /SCATTERPLOT = @var{height} WITH @var{weight} BY @var{gender}.
445 @end example
446
447 This example will produce a scatterplot where @var{height} is plotted versus @var{weight}. Depending
448 on the value of the @var{gender} variable, the colour of the datapoint is different. With
449 this plot it is possible to analyze gender differences for @var{height} vs.@: @var{weight} relation.
450
451 @node HISTOGRAM
452 @subsection Histogram
453 @cindex histogram
454
455 The subcommand @subcmd{HISTOGRAM} produces a histogram. Only one variable is allowed for
456 the histogram plot.
457 The keyword @subcmd{NORMAL} may be specified in parentheses, to indicate that the ideal normal curve
458 should be superimposed over the histogram.
459 For an alternative method to produce histograms @pxref{EXAMINE}. The
460 following example produces a histogram plot for the variable @var{weight}.
461
462 @example
463 GRAPH   
464         /HISTOGRAM = @var{weight}.
465 @end example
466
467 @node BAR CHART
468 @subsection Bar Chart
469 @cindex bar chart
470
471 The subcommand @subcmd{BAR} produces a bar chart.
472 This subcommand requires that a @var{count-function} be specified (with no arguments) or a @var{summary-function} with a variable @var{var1} in parentheses.
473 Following the summary or count function, the keyword @subcmd{BY} should be specified and then a catagorical variable, @var{var2}.
474 The values of the variable @var{var2} determine the labels of the bars to be plotted.
475 Optionally a second categorical variable @var{var3} may be specified in which case a clustered (grouped) bar chart is produced.
476
477 Valid count functions are
478 @table @subcmd
479 @item COUNT
480 The weighted counts of the cases in each category.
481 @item PCT
482 The weighted counts of the cases in each category expressed as a percentage of the total weights of the cases.
483 @item CUFREQ
484 The cumulative weighted counts of the cases in each category.
485 @item CUPCT
486 The cumulative weighted counts of the cases in each category expressed as a percentage of the total weights of the cases.
487 @end table
488
489 The summary function is applied to @var{var1} across all cases in each category.
490 The recognised summary functions are:
491 @table @subcmd
492 @item SUM
493 The sum.
494 @item MEAN
495 The arithmetic mean.
496 @item MAXIMUM
497 The maximum value.
498 @item MINIMUM
499 The minimum value.
500 @end table
501
502 The following examples assume a dataset which is the results of a survey.
503 Each respondent has indicated annual income, their sex and city of residence.
504 One could create a bar chart showing how the mean income varies between of residents of different cities, thus:
505 @example
506 GRAPH  /BAR  = MEAN(@var{income}) BY @var{city}.
507 @end example
508
509 This can be extended to also indicate how income in each city differs between the sexes.
510 @example
511 GRAPH  /BAR  = MEAN(@var{income}) BY @var{city} BY @var{sex}.
512 @end example
513
514 One might also want to see how many respondents there are from each city.  This can be achieved as follows:
515 @example
516 GRAPH  /BAR  = COUNT BY @var{city}.
517 @end example
518
519 Bar charts can also be produced using the @ref{FREQUENCIES} and @ref{CROSSTABS} commands.
520
521 @node CORRELATIONS
522 @section CORRELATIONS
523
524 @vindex CORRELATIONS
525 @display
526 CORRELATIONS
527      /VARIABLES = @var{var_list} [ WITH @var{var_list} ]
528      [
529       .
530       .
531       .
532       /VARIABLES = @var{var_list} [ WITH @var{var_list} ]
533       /VARIABLES = @var{var_list} [ WITH @var{var_list} ]
534      ]
535
536      [ /PRINT=@{TWOTAIL, ONETAIL@} @{SIG, NOSIG@} ]
537      [ /STATISTICS=DESCRIPTIVES XPROD ALL]
538      [ /MISSING=@{PAIRWISE, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
539 @end display    
540
541 @cindex correlation
542 The @cmd{CORRELATIONS} procedure produces tables of the Pearson correlation coefficient
543 for a set of variables.  The significance of the coefficients are also given.
544
545 At least one @subcmd{VARIABLES} subcommand is required. If the @subcmd{WITH} 
546 keyword is used, then a non-square correlation table will be produced.
547 The variables preceding @subcmd{WITH}, will be used as the rows of the table,
548 and the variables following will be the columns of the table.
549 If no @subcmd{WITH} subcommand is given, then a square, symmetrical table using all variables is produced.
550
551
552 The @cmd{MISSING} subcommand determines the handling of missing variables.  
553 If @subcmd{INCLUDE} is set, then user-missing values are included in the
554 calculations, but system-missing values are not.
555 If @subcmd{EXCLUDE} is set, which is the default, user-missing
556 values are excluded as well as system-missing values. 
557
558 If @subcmd{LISTWISE} is set, then the entire case is excluded from analysis
559 whenever any variable  specified in any @cmd{/VARIABLES} subcommand
560 contains a missing value.   
561 If @subcmd{PAIRWISE} is set, then a case is considered missing only if either of the
562 values  for the particular coefficient are missing.
563 The default is @subcmd{PAIRWISE}.
564
565 The @subcmd{PRINT} subcommand is used to control how the reported significance values are printed.
566 If the @subcmd{TWOTAIL} option is used, then a two-tailed test of significance is 
567 printed.  If the @subcmd{ONETAIL} option is given, then a one-tailed test is used.
568 The default is @subcmd{TWOTAIL}.
569
570 If the @subcmd{NOSIG} option is specified, then correlation coefficients with significance less than
571 0.05 are highlighted.
572 If @subcmd{SIG} is specified, then no highlighting is performed.  This is the default.
573
574 @cindex covariance
575 The @subcmd{STATISTICS} subcommand requests additional statistics to be displayed.  The keyword 
576 @subcmd{DESCRIPTIVES} requests that the mean, number of non-missing cases, and the non-biased
577 estimator of the standard deviation are displayed.
578 These statistics will be displayed in a separated table, for all the variables listed
579 in any @subcmd{/VARIABLES} subcommand.
580 The @subcmd{XPROD} keyword requests cross-product deviations and covariance estimators to 
581 be displayed for each pair of variables.
582 The keyword @subcmd{ALL} is the union of @subcmd{DESCRIPTIVES} and @subcmd{XPROD}.
583
584 @node CROSSTABS
585 @section CROSSTABS
586
587 @vindex CROSSTABS
588 @display
589 CROSSTABS
590         /TABLES=@var{var_list} BY @var{var_list} [BY @var{var_list}]@dots{}
591         /MISSING=@{TABLE,INCLUDE,REPORT@}
592         /WRITE=@{NONE,CELLS,ALL@}
593         /FORMAT=@{TABLES,NOTABLES@}
594                 @{PIVOT,NOPIVOT@}
595                 @{AVALUE,DVALUE@}
596                 @{NOINDEX,INDEX@}
597                 @{BOX,NOBOX@}
598         /CELLS=@{COUNT,ROW,COLUMN,TOTAL,EXPECTED,RESIDUAL,SRESIDUAL,
599                 ASRESIDUAL,ALL,NONE@}
600         /COUNT=@{ASIS,CASE,CELL@}
601                @{ROUND,TRUNCATE@}
602         /STATISTICS=@{CHISQ,PHI,CC,LAMBDA,UC,BTAU,CTAU,RISK,GAMMA,D,
603                      KAPPA,ETA,CORR,ALL,NONE@}
604         /BARCHART
605         
606 (Integer mode.)
607         /VARIABLES=@var{var_list} (@var{low},@var{high})@dots{}
608 @end display
609
610 The @cmd{CROSSTABS} procedure displays crosstabulation
611 tables requested by the user.  It can calculate several statistics for
612 each cell in the crosstabulation tables.  In addition, a number of
613 statistics can be calculated for each table itself.
614
615 The @subcmd{TABLES} subcommand is used to specify the tables to be reported.  Any
616 number of dimensions is permitted, and any number of variables per
617 dimension is allowed.  The @subcmd{TABLES} subcommand may be repeated as many
618 times as needed.  This is the only required subcommand in @dfn{general
619 mode}.  
620
621 Occasionally, one may want to invoke a special mode called @dfn{integer
622 mode}.  Normally, in general mode, @pspp{} automatically determines
623 what values occur in the data.  In integer mode, the user specifies the
624 range of values that the data assumes.  To invoke this mode, specify the
625 @subcmd{VARIABLES} subcommand, giving a range of data values in parentheses for
626 each variable to be used on the @subcmd{TABLES} subcommand.  Data values inside
627 the range are truncated to the nearest integer, then assigned to that
628 value.  If values occur outside this range, they are discarded.  When it
629 is present, the @subcmd{VARIABLES} subcommand must precede the @subcmd{TABLES}
630 subcommand.
631
632 In general mode, numeric and string variables may be specified on
633 TABLES.  In integer mode, only numeric variables are allowed.
634
635 The @subcmd{MISSING} subcommand determines the handling of user-missing values.
636 When set to @subcmd{TABLE}, the default, missing values are dropped on a table by
637 table basis.  When set to @subcmd{INCLUDE}, user-missing values are included in
638 tables and statistics.  When set to @subcmd{REPORT}, which is allowed only in
639 integer mode, user-missing values are included in tables but marked with
640 an @samp{M} (for ``missing'') and excluded from statistical
641 calculations.
642
643 Currently the @subcmd{WRITE} subcommand is ignored.
644
645 The @subcmd{FORMAT} subcommand controls the characteristics of the
646 crosstabulation tables to be displayed.  It has a number of possible
647 settings:
648
649 @itemize @w{}
650 @item
651 @subcmd{TABLES}, the default, causes crosstabulation tables to be output.
652 @subcmd{NOTABLES} suppresses them.
653
654 @item
655 @subcmd{PIVOT}, the default, causes each @subcmd{TABLES} subcommand to be displayed in a
656 pivot table format.  @subcmd{NOPIVOT} causes the old-style crosstabulation format
657 to be used.
658
659 @item
660 @subcmd{AVALUE}, the default, causes values to be sorted in ascending order.
661 @subcmd{DVALUE} asserts a descending sort order.
662
663 @item
664 @subcmd{INDEX} and @subcmd{NOINDEX} are currently ignored.
665
666 @item
667 @subcmd{BOX} and @subcmd{NOBOX} is currently ignored.
668 @end itemize
669
670 The @subcmd{CELLS} subcommand controls the contents of each cell in the displayed
671 crosstabulation table.  The possible settings are:
672
673 @table @asis
674 @item COUNT
675 Frequency count.
676 @item ROW
677 Row percent.
678 @item COLUMN
679 Column percent.
680 @item TOTAL
681 Table percent.
682 @item EXPECTED
683 Expected value.
684 @item RESIDUAL 
685 Residual.
686 @item SRESIDUAL
687 Standardized residual.
688 @item ASRESIDUAL
689 Adjusted standardized residual.
690 @item ALL
691 All of the above.
692 @item NONE
693 Suppress cells entirely.
694 @end table
695
696 @samp{/CELLS} without any settings specified requests @subcmd{COUNT}, @subcmd{ROW},
697 @subcmd{COLUMN}, and @subcmd{TOTAL}.  
698 If @subcmd{CELLS} is not specified at all then only @subcmd{COUNT}
699 will be selected.
700
701 By default, crosstabulation and statistics use raw case weights,
702 without rounding.  Use the @subcmd{/COUNT} subcommand to perform
703 rounding: CASE rounds the weights of individual weights as cases are
704 read, CELL rounds the weights of cells within each crosstabulation
705 table after it has been constructed, and ASIS explicitly specifies the
706 default non-rounding behavior.  When rounding is requested, ROUND, the
707 default, rounds to the nearest integer and TRUNCATE rounds toward
708 zero.
709
710 The @subcmd{STATISTICS} subcommand selects statistics for computation:
711
712 @table @asis
713 @item CHISQ
714 @cindex chisquare
715 @cindex chi-square
716
717 Pearson chi-square, likelihood ratio, Fisher's exact test, continuity
718 correction, linear-by-linear association.
719 @item PHI
720 Phi.
721 @item CC
722 Contingency coefficient.
723 @item LAMBDA
724 Lambda.
725 @item UC
726 Uncertainty coefficient.
727 @item BTAU
728 Tau-b.
729 @item CTAU
730 Tau-c.
731 @item RISK
732 Risk estimate.
733 @item GAMMA
734 Gamma.
735 @item D
736 Somers' D.
737 @item KAPPA
738 Cohen's Kappa.
739 @item ETA
740 Eta.
741 @item CORR
742 Spearman correlation, Pearson's r.
743 @item ALL
744 All of the above.
745 @item NONE
746 No statistics.
747 @end table
748
749 Selected statistics are only calculated when appropriate for the
750 statistic.  Certain statistics require tables of a particular size, and
751 some statistics are calculated only in integer mode.
752
753 @samp{/STATISTICS} without any settings selects CHISQ.  If the
754 @subcmd{STATISTICS} subcommand is not given, no statistics are calculated.
755
756 @cindex bar chart
757 The @samp{/BARCHART} subcommand produces a clustered bar chart for the first two
758 variables on each table.
759 If a table has more than two variables, the counts for the third and subsequent levels 
760 will be aggregated and the chart will be produces as if there were only two variables.  
761
762
763 @strong{Please note:} Currently the implementation of @cmd{CROSSTABS} has the
764 following limitations:
765
766 @itemize @bullet
767 @item
768 Significance of some symmetric and directional measures is not calculated.
769 @item
770 Asymptotic standard error is not calculated for
771 Goodman and Kruskal's tau or symmetric Somers' d.
772 @item
773 Approximate T is not calculated for symmetric uncertainty coefficient.
774 @end itemize
775
776 Fixes for any of these deficiencies would be welcomed.
777
778 @node FACTOR
779 @section FACTOR
780
781 @vindex FACTOR
782 @cindex factor analysis
783 @cindex principal components analysis
784 @cindex principal axis factoring
785 @cindex data reduction
786
787 @display
788 FACTOR  VARIABLES=@var{var_list}
789
790         [ /METHOD = @{CORRELATION, COVARIANCE@} ]
791
792         [ /ANALYSIS=@var{var_list} ]
793
794         [ /EXTRACTION=@{PC, PAF@}] 
795
796         [ /ROTATION=@{VARIMAX, EQUAMAX, QUARTIMAX, PROMAX[(@var{k})], NOROTATE@}]
797
798         [ /PRINT=[INITIAL] [EXTRACTION] [ROTATION] [UNIVARIATE] [CORRELATION] [COVARIANCE] [DET] [KMO] [SIG] [ALL] [DEFAULT] ]
799
800         [ /PLOT=[EIGEN] ]
801
802         [ /FORMAT=[SORT] [BLANK(@var{n})] [DEFAULT] ]
803
804         [ /CRITERIA=[FACTORS(@var{n})] [MINEIGEN(@var{l})] [ITERATE(@var{m})] [ECONVERGE (@var{delta})] [DEFAULT] ]
805
806         [ /MISSING=[@{LISTWISE, PAIRWISE@}] [@{INCLUDE, EXCLUDE@}] ]
807 @end display
808
809 The @cmd{FACTOR} command performs Factor Analysis or Principal Axis Factoring on a dataset.  It may be used to find
810 common factors in the data or for data reduction purposes.
811
812 The @subcmd{VARIABLES} subcommand is required.  It lists the variables
813 which are to partake in the analysis.  (The @subcmd{ANALYSIS}
814 subcommand may optionally further limit the variables that
815 participate; it is not useful and implemented only for compatibility.)
816
817 The @subcmd{/EXTRACTION} subcommand is used to specify the way in which factors (components) are extracted from the data.
818 If @subcmd{PC} is specified, then Principal Components Analysis is used.  
819 If @subcmd{PAF} is specified, then Principal Axis Factoring is
820 used. By default Principal Components Analysis will be used.
821
822 The @subcmd{/ROTATION} subcommand is used to specify the method by which the extracted solution will be rotated.
823 Three orthogonal rotation methods are available: 
824 @subcmd{VARIMAX} (which is the default), @subcmd{EQUAMAX}, and @subcmd{QUARTIMAX}.
825 There is one oblique rotation method, @i{viz}: @subcmd{PROMAX}.
826 Optionally you may enter the power of the promax rotation @var{k}, which must be enclosed in parentheses.
827 The default value of @var{k} is 5.
828 If you don't want any rotation to be performed, the word @subcmd{NOROTATE} will prevent the command from performing any
829 rotation on the data. 
830
831 The @subcmd{/METHOD} subcommand should be used to determine whether the covariance matrix or the correlation matrix of the data is
832 to be analysed.  By default, the correlation matrix is analysed.
833
834 The @subcmd{/PRINT} subcommand may be used to select which features of the analysis are reported:
835
836 @itemize 
837 @item @subcmd{UNIVARIATE}
838       A table of mean values, standard deviations and total weights are printed.
839 @item @subcmd{INITIAL}
840       Initial communalities and eigenvalues are printed.
841 @item @subcmd{EXTRACTION}
842       Extracted communalities and eigenvalues are printed.
843 @item @subcmd{ROTATION}
844       Rotated communalities and eigenvalues are printed.
845 @item @subcmd{CORRELATION}
846       The correlation matrix is printed.
847 @item @subcmd{COVARIANCE}
848       The covariance matrix is printed.
849 @item @subcmd{DET}
850       The determinant of the correlation or covariance matrix is printed.
851 @item @subcmd{KMO}
852       The Kaiser-Meyer-Olkin measure of sampling adequacy and the Bartlett test of sphericity is printed.
853 @item @subcmd{SIG}
854       The significance of the elements of correlation matrix is printed.
855 @item @subcmd{ALL}
856       All of the above are printed.
857 @item @subcmd{DEFAULT}
858       Identical to @subcmd{INITIAL} and @subcmd{EXTRACTION}.
859 @end itemize
860
861 If @subcmd{/PLOT=EIGEN} is given, then a ``Scree'' plot of the eigenvalues will be printed.  This can be useful for visualizing
862 which factors (components) should be retained.
863
864 The @subcmd{/FORMAT} subcommand determined how data are to be displayed in loading matrices.  If @subcmd{SORT} is specified, then the variables
865 are sorted in descending order of significance.  If @subcmd{BLANK(@var{n})} is specified, then coefficients whose absolute value is less
866 than @var{n} will not be printed.  If the keyword @subcmd{DEFAULT} is given, or if no @subcmd{/FORMAT} subcommand is given, then no sorting is 
867 performed, and all coefficients will be printed.
868
869 The @subcmd{/CRITERIA} subcommand is used to specify how the number of extracted factors (components) are chosen.
870 If @subcmd{FACTORS(@var{n})} is
871 specified, where @var{n} is an integer, then @var{n} factors will be extracted.  Otherwise, the @subcmd{MINEIGEN} setting will
872 be used.  
873 @subcmd{MINEIGEN(@var{l})} requests that all factors whose eigenvalues are greater than or equal to @var{l} are extracted.
874 The default value of @var{l} is 1.    
875 The @subcmd{ECONVERGE} setting has effect only when iterative algorithms for factor
876 extraction (such as Principal Axis Factoring) are used.   
877 @subcmd{ECONVERGE(@var{delta})} specifies that
878 iteration should cease when
879 the maximum absolute value of the communality estimate between one iteration and the previous is less than @var{delta}. The
880 default value of @var{delta} is 0.001.
881 The @subcmd{ITERATE(@var{m})} may appear any number of times and is used for two different purposes.  
882 It is used to set the maximum number of iterations (@var{m}) for convergence and also to set the maximum number of iterations
883 for rotation.
884 Whether it affects convergence or rotation depends upon which subcommand follows the @subcmd{ITERATE} subcommand.
885 If @subcmd{EXTRACTION} follows, it affects convergence.  
886 If @subcmd{ROTATION} follows, it affects rotation.  
887 If neither @subcmd{ROTATION} nor @subcmd{EXTRACTION} follow a @subcmd{ITERATE} subcommand it will be ignored.
888 The default value of @var{m} is 25.
889
890 The @cmd{MISSING} subcommand determines the handling of missing variables.  
891 If @subcmd{INCLUDE} is set, then user-missing values are included in the
892 calculations, but system-missing values are not.
893 If @subcmd{EXCLUDE} is set, which is the default, user-missing
894 values are excluded as well as system-missing values. 
895 This is the default.
896 If @subcmd{LISTWISE} is set, then the entire case is excluded from analysis
897 whenever any variable  specified in the @cmd{VARIABLES} subcommand
898 contains a missing value.   
899 If @subcmd{PAIRWISE} is set, then a case is considered missing only if either of the
900 values  for the particular coefficient are missing.
901 The default is @subcmd{LISTWISE}.
902
903 @node GLM
904 @section GLM
905
906 @vindex GLM
907 @cindex univariate analysis of variance
908 @cindex fixed effects
909 @cindex factorial anova
910 @cindex analysis of variance
911 @cindex ANOVA
912
913
914 @display
915 GLM @var{dependent_vars} BY @var{fixed_factors}
916      [/METHOD = SSTYPE(@var{type})]
917      [/DESIGN = @var{interaction_0} [@var{interaction_1} [... @var{interaction_n}]]]
918      [/INTERCEPT = @{INCLUDE|EXCLUDE@}]
919      [/MISSING = @{INCLUDE|EXCLUDE@}]
920 @end display
921
922 The @cmd{GLM} procedure can be used for fixed effects factorial Anova.
923
924 The @var{dependent_vars} are the variables to be analysed.
925 You may analyse several variables in the same command in which case they should all
926 appear before the @code{BY} keyword.
927
928 The @var{fixed_factors} list must be one or more categorical variables.  Normally it
929 will not make sense to enter a scalar variable in the @var{fixed_factors} and doing
930 so may cause @pspp{} to do a lot of unnecessary processing.
931
932 The @subcmd{METHOD} subcommand is used to change the method for producing the sums of
933 squares.  Available values of @var{type} are 1, 2 and 3.  The default is type 3.
934
935 You may specify a custom design using the @subcmd{DESIGN} subcommand.
936 The design comprises a list of interactions where each interaction is a 
937 list of variables separated by a @samp{*}.  For example the command
938 @display
939 GLM subject BY sex age_group race
940     /DESIGN = age_group sex group age_group*sex age_group*race
941 @end display
942 @noindent specifies the model @math{subject = age_group + sex + race + age_group*sex + age_group*race}.
943 If no @subcmd{DESIGN} subcommand is specified, then the default is all possible combinations
944 of the fixed factors.  That is to say
945 @display
946 GLM subject BY sex age_group race
947 @end display
948 implies the model
949 @math{subject = age_group + sex + race + age_group*sex + age_group*race + sex*race + age_group*sex*race}.
950
951
952 The @subcmd{MISSING} subcommand determines the handling of missing
953 variables.  
954 If @subcmd{INCLUDE} is set then, for the purposes of GLM analysis,
955 only system-missing values are considered
956 to be missing; user-missing values are not regarded as missing.
957 If @subcmd{EXCLUDE} is set, which is the default, then user-missing
958 values are considered to be missing as well as system-missing values. 
959 A case for which any dependent variable or any factor
960 variable has a missing value is excluded from the analysis.
961
962 @node LOGISTIC REGRESSION
963 @section LOGISTIC REGRESSION
964
965 @vindex LOGISTIC REGRESSION
966 @cindex logistic regression
967 @cindex bivariate logistic regression
968
969 @display
970 LOGISTIC REGRESSION [VARIABLES =] @var{dependent_var} WITH @var{predictors}
971
972      [/CATEGORICAL = @var{categorical_predictors}]
973
974      [@{/NOCONST | /ORIGIN | /NOORIGIN @}]
975
976      [/PRINT = [SUMMARY] [DEFAULT] [CI(@var{confidence})] [ALL]]
977
978      [/CRITERIA = [BCON(@var{min_delta})] [ITERATE(@var{max_interations})]
979                   [LCON(@var{min_likelihood_delta})] [EPS(@var{min_epsilon})]
980                   [CUT(@var{cut_point})]]
981
982      [/MISSING = @{INCLUDE|EXCLUDE@}]
983 @end display
984
985 Bivariate Logistic Regression is used when you want to explain a dichotomous dependent
986 variable in terms of one or more predictor variables.
987
988 The minimum command is
989 @example
990 LOGISTIC REGRESSION @var{y} WITH @var{x1} @var{x2} @dots{} @var{xn}.
991 @end example
992 Here, @var{y} is the dependent variable, which must be dichotomous and @var{x1} @dots{} @var{xn}
993 are the predictor variables whose coefficients the procedure estimates.
994
995 By default, a constant term is included in the model.
996 Hence, the full model is
997 @math{
998 {\bf y} 
999 = b_0 + b_1 {\bf x_1} 
1000 + b_2 {\bf x_2} 
1001 + \dots
1002 + b_n {\bf x_n}
1003 }
1004
1005 Predictor variables which are categorical in nature should be listed on the @subcmd{/CATEGORICAL} subcommand.
1006 Simple variables as well as interactions between variables may be listed here.
1007
1008 If you want a model without the constant term @math{b_0}, use the keyword @subcmd{/ORIGIN}.
1009 @subcmd{/NOCONST} is a synonym for @subcmd{/ORIGIN}.
1010
1011 An iterative Newton-Raphson procedure is used to fit the model.
1012 The @subcmd{/CRITERIA} subcommand is used to specify the stopping criteria of the procedure,
1013 and other parameters.
1014 The value of @var{cut_point} is used in the classification table.  It is the 
1015 threshold above which predicted values are considered to be 1.  Values
1016 of @var{cut_point} must lie in the range [0,1].
1017 During iterations, if any one of the stopping criteria are satisfied, the procedure is
1018 considered complete.
1019 The stopping criteria are:
1020 @itemize
1021 @item The number of iterations exceeds @var{max_iterations}.  
1022       The default value of @var{max_iterations} is 20.
1023 @item The change in the all coefficient estimates are less than @var{min_delta}.
1024 The default value of @var{min_delta} is 0.001.
1025 @item The magnitude of change in the likelihood estimate is less than @var{min_likelihood_delta}.
1026 The default value of @var{min_delta} is zero.
1027 This means that this criterion is disabled.
1028 @item The differential of the estimated probability for all cases is less than @var{min_epsilon}.
1029 In other words, the probabilities are close to zero or one.
1030 The default value of @var{min_epsilon} is 0.00000001.
1031 @end itemize
1032
1033
1034 The @subcmd{PRINT} subcommand controls the display of optional statistics.
1035 Currently there is one such option, @subcmd{CI}, which indicates that the 
1036 confidence interval of the odds ratio should be displayed as well as its value.
1037 @subcmd{CI} should be followed by an integer in parentheses, to indicate the
1038 confidence level of the desired confidence interval.
1039
1040 The @subcmd{MISSING} subcommand determines the handling of missing
1041 variables.  
1042 If @subcmd{INCLUDE} is set, then user-missing values are included in the
1043 calculations, but system-missing values are not.
1044 If @subcmd{EXCLUDE} is set, which is the default, user-missing
1045 values are excluded as well as system-missing values. 
1046 This is the default.
1047
1048 @node MEANS
1049 @section MEANS
1050
1051 @vindex MEANS
1052 @cindex means
1053
1054 @display 
1055 MEANS [TABLES =] 
1056       @{@var{var_list}@} 
1057         [ BY @{@var{var_list}@} [BY @{@var{var_list}@} [BY @{@var{var_list}@} @dots{} ]]]
1058
1059       [ /@{@var{var_list}@} 
1060          [ BY @{@var{var_list}@} [BY @{@var{var_list}@} [BY @{@var{var_list}@} @dots{} ]]] ]
1061
1062       [/CELLS = [MEAN] [COUNT] [STDDEV] [SEMEAN] [SUM] [MIN] [MAX] [RANGE]
1063         [VARIANCE] [KURT] [SEKURT] 
1064         [SKEW] [SESKEW] [FIRST] [LAST] 
1065         [HARMONIC] [GEOMETRIC] 
1066         [DEFAULT]
1067         [ALL]
1068         [NONE] ]
1069
1070       [/MISSING = [TABLE] [INCLUDE] [DEPENDENT]]
1071 @end display 
1072
1073 You can use the @cmd{MEANS} command to calculate the arithmetic mean and similar
1074 statistics, either for the dataset as a whole or for categories of data.
1075
1076 The simplest form of the command is
1077 @example
1078 MEANS @var{v}.
1079 @end example
1080 @noindent which calculates the mean, count and standard deviation for @var{v}.
1081 If you specify a grouping variable, for example
1082 @example
1083 MEANS @var{v} BY @var{g}.
1084 @end example
1085 @noindent then the means, counts and standard deviations for @var{v} after having
1086 been grouped by @var{g} will be calculated.
1087 Instead of the mean, count and standard deviation, you could specify the statistics
1088 in which you are interested:
1089 @example
1090 MEANS @var{x} @var{y} BY @var{g}
1091       /CELLS = HARMONIC SUM MIN.
1092 @end example
1093 This example calculates the harmonic mean, the sum and the minimum values of @var{x} and @var{y}
1094 grouped by @var{g}.
1095
1096 The @subcmd{CELLS} subcommand specifies which statistics to calculate.  The available statistics
1097 are:
1098 @itemize
1099 @item @subcmd{MEAN}
1100 @cindex arithmetic mean
1101       The arithmetic mean.
1102 @item @subcmd{COUNT}
1103       The count of the values.
1104 @item @subcmd{STDDEV}
1105       The standard deviation.
1106 @item @subcmd{SEMEAN}
1107       The standard error of the mean.
1108 @item @subcmd{SUM}
1109       The sum of the values.
1110 @item @subcmd{MIN}
1111       The minimum value.
1112 @item @subcmd{MAX}
1113       The maximum value.
1114 @item @subcmd{RANGE}
1115       The difference between the maximum and minimum values.
1116 @item @subcmd{VARIANCE}
1117       The variance.
1118 @item @subcmd{FIRST}
1119       The first value in the category.
1120 @item @subcmd{LAST}
1121       The last value in the category.
1122 @item @subcmd{SKEW}
1123       The skewness.
1124 @item @subcmd{SESKEW}
1125       The standard error of the skewness.
1126 @item @subcmd{KURT}
1127       The kurtosis
1128 @item @subcmd{SEKURT}
1129       The standard error of the kurtosis.
1130 @item @subcmd{HARMONIC}
1131 @cindex harmonic mean
1132       The harmonic mean.
1133 @item @subcmd{GEOMETRIC}
1134 @cindex geometric mean
1135       The geometric mean.
1136 @end itemize
1137
1138 In addition, three special keywords are recognized:
1139 @itemize
1140 @item @subcmd{DEFAULT}
1141       This is the same as @subcmd{MEAN} @subcmd{COUNT} @subcmd{STDDEV}.
1142 @item @subcmd{ALL}
1143       All of the above statistics will be calculated.
1144 @item @subcmd{NONE}
1145       No statistics will be calculated (only a summary will be shown).
1146 @end itemize
1147
1148
1149 More than one @dfn{table} can be specified in a single command. 
1150 Each table is separated by a @samp{/}. For
1151 example
1152 @example
1153 MEANS TABLES =
1154       @var{c} @var{d} @var{e} BY @var{x}
1155       /@var{a} @var{b} BY @var{x} @var{y}
1156       /@var{f} BY @var{y} BY @var{z}.
1157 @end example
1158 has three tables (the @samp{TABLE =} is optional).
1159 The first table has three dependent variables @var{c}, @var{d} and @var{e}
1160 and a single categorical variable @var{x}.
1161 The second table has two dependent variables @var{a} and @var{b}, 
1162 and two categorical variables @var{x} and @var{y}.
1163 The third table has a single dependent variables @var{f}
1164 and a categorical variable formed by the combination of @var{y} and @var{z}.
1165
1166
1167 By default values are omitted from the analysis only if missing values
1168 (either system missing or user missing)
1169 for any of the variables directly involved in their calculation are 
1170 encountered.
1171 This behaviour can be modified with the  @subcmd{/MISSING} subcommand.
1172 Three options are possible: @subcmd{TABLE}, @subcmd{INCLUDE} and @subcmd{DEPENDENT}.
1173
1174 @subcmd{/MISSING = TABLE} causes cases to be dropped if any variable is missing 
1175 in the table specification currently being processed, regardless of 
1176 whether it is needed to calculate the statistic.
1177
1178 @subcmd{/MISSING = INCLUDE} says that user missing values, either in the dependent
1179 variables or in the categorical variables should be taken at their face
1180 value, and not excluded.
1181
1182 @subcmd{/MISSING = DEPENDENT} says that user missing values, in the dependent
1183 variables should be taken at their face value, however cases which 
1184 have user missing values for the categorical variables should be omitted 
1185 from the calculation.
1186
1187 @node NPAR TESTS
1188 @section NPAR TESTS
1189
1190 @vindex NPAR TESTS
1191 @cindex nonparametric tests
1192
1193 @display 
1194 NPAR TESTS
1195      
1196      nonparametric test subcommands
1197      .
1198      .
1199      .
1200      
1201      [ /STATISTICS=@{DESCRIPTIVES@} ]
1202
1203      [ /MISSING=@{ANALYSIS, LISTWISE@} @{INCLUDE, EXCLUDE@} ]
1204
1205      [ /METHOD=EXACT [ TIMER [(@var{n})] ] ]
1206 @end display
1207
1208 @cmd{NPAR TESTS} performs nonparametric tests. 
1209 Non parametric tests make very few assumptions about the distribution of the 
1210 data.
1211 One or more tests may be specified by using the corresponding subcommand.
1212 If the @subcmd{/STATISTICS} subcommand is also specified, then summary statistics are 
1213 produces for each variable that is the subject of any test.
1214
1215 Certain tests may take a long time to execute, if an exact figure is required.
1216 Therefore, by default asymptotic approximations are used unless the
1217 subcommand @subcmd{/METHOD=EXACT} is specified.  
1218 Exact tests give more accurate results, but may take an unacceptably long 
1219 time to perform.  If the @subcmd{TIMER} keyword is used, it sets a maximum time,
1220 after which the test will be abandoned, and a warning message printed.
1221 The time, in minutes, should be specified in parentheses after the @subcmd{TIMER} keyword.
1222 If the @subcmd{TIMER} keyword is given without this figure, then a default value of 5 minutes 
1223 is used.
1224
1225
1226 @menu
1227 * BINOMIAL::                Binomial Test
1228 * CHISQUARE::               Chisquare Test
1229 * COCHRAN::                 Cochran Q Test
1230 * FRIEDMAN::                Friedman Test
1231 * KENDALL::                 Kendall's W Test
1232 * KOLMOGOROV-SMIRNOV::      Kolmogorov Smirnov Test
1233 * KRUSKAL-WALLIS::          Kruskal-Wallis Test
1234 * MANN-WHITNEY::            Mann Whitney U Test
1235 * MCNEMAR::                 McNemar Test
1236 * MEDIAN::                  Median Test
1237 * RUNS::                    Runs Test
1238 * SIGN::                    The Sign Test
1239 * WILCOXON::                Wilcoxon Signed Ranks Test
1240 @end menu
1241
1242
1243 @node    BINOMIAL
1244 @subsection Binomial test
1245 @vindex BINOMIAL
1246 @cindex binomial test
1247
1248 @display 
1249      [ /BINOMIAL[(@var{p})]=@var{var_list}[(@var{value1}[, @var{value2})] ] ]
1250 @end display 
1251
1252 The @subcmd{/BINOMIAL} subcommand compares the observed distribution of a dichotomous 
1253 variable with that of a binomial distribution.
1254 The variable @var{p} specifies the test proportion of the binomial 
1255 distribution.  
1256 The default value of 0.5 is assumed if @var{p} is omitted.
1257
1258 If a single value appears after the variable list, then that value is
1259 used as the threshold to partition the observed values. Values less
1260 than or equal to the threshold value form the first category.  Values
1261 greater than the threshold form the second category. 
1262
1263 If two values appear after the variable list, then they will be used
1264 as the values which a variable must take to be in the respective
1265 category. 
1266 Cases for which a variable takes a value equal to neither of the specified  
1267 values, take no part in the test for that variable.
1268
1269 If no values appear, then the variable must assume dichotomous
1270 values.
1271 If more than two distinct, non-missing values for a variable
1272 under test are encountered then an error occurs.
1273
1274 If the test proportion is equal to 0.5, then a two tailed test is
1275 reported.   For any other test proportion, a one tailed test is
1276 reported.   
1277 For one tailed tests, if the test proportion is less than
1278 or equal to the observed proportion, then the significance of
1279 observing the observed proportion or more is reported.
1280 If the test proportion is more than the observed proportion, then the
1281 significance of observing the observed proportion or less is reported.
1282 That is to say, the test is always performed in the observed
1283 direction. 
1284
1285 @pspp{} uses a very precise approximation to the gamma function to
1286 compute the binomial significance.  Thus, exact results are reported
1287 even for very large sample sizes.
1288
1289
1290
1291 @node    CHISQUARE
1292 @subsection Chisquare Test
1293 @vindex CHISQUARE
1294 @cindex chisquare test
1295
1296
1297 @display
1298      [ /CHISQUARE=@var{var_list}[(@var{lo},@var{hi})] [/EXPECTED=@{EQUAL|@var{f1}, @var{f2} @dots{} @var{fn}@}] ]
1299 @end display 
1300
1301
1302 The @subcmd{/CHISQUARE} subcommand produces a chi-square statistic for the differences 
1303 between the expected and observed frequencies of the categories of a variable. 
1304 Optionally, a range of values may appear after the variable list.  
1305 If a range is given, then non integer values are truncated, and values
1306 outside the  specified range are excluded from the analysis.
1307
1308 The @subcmd{/EXPECTED} subcommand specifies the expected values of each
1309 category.  
1310 There must be exactly one non-zero expected value, for each observed
1311 category, or the @subcmd{EQUAL} keyword must be specified.
1312 You may use the notation @subcmd{@var{n}*@var{f}} to specify @var{n}
1313 consecutive expected categories all taking a frequency of @var{f}.
1314 The frequencies given are proportions, not absolute frequencies.  The
1315 sum of the frequencies need not be 1.
1316 If no @subcmd{/EXPECTED} subcommand is given, then then equal frequencies 
1317 are expected.
1318
1319
1320 @node COCHRAN
1321 @subsection Cochran Q Test
1322 @vindex Cochran
1323 @cindex Cochran Q test
1324 @cindex Q, Cochran Q
1325
1326 @display
1327      [ /COCHRAN = @var{var_list} ]
1328 @end display
1329
1330 The Cochran Q test is used to test for differences between three or more groups.
1331 The data for @var{var_list} in all cases must assume exactly two distinct values (other than missing values). 
1332
1333 The value of Q will be displayed and its Asymptotic significance based on a chi-square distribution.
1334
1335 @node FRIEDMAN
1336 @subsection Friedman Test
1337 @vindex FRIEDMAN
1338 @cindex Friedman test
1339
1340 @display
1341      [ /FRIEDMAN = @var{var_list} ]
1342 @end display
1343
1344 The Friedman test is used to test for differences between repeated measures when
1345 there is no indication that the distributions are normally distributed.
1346
1347 A list of variables which contain the measured data must be given.  The procedure
1348 prints the sum of ranks for each variable, the test statistic and its significance.
1349
1350 @node KENDALL
1351 @subsection Kendall's W Test
1352 @vindex KENDALL
1353 @cindex Kendall's W test
1354 @cindex coefficient of concordance
1355
1356 @display
1357      [ /KENDALL = @var{var_list} ]
1358 @end display
1359
1360 The Kendall test investigates whether an arbitrary number of related samples come from the 
1361 same population.
1362 It is identical to the Friedman test except that the additional statistic W, Kendall's Coefficient of Concordance is printed.
1363 It has the range [0,1] --- a value of zero indicates no agreement between the samples whereas a value of
1364 unity indicates complete agreement.
1365
1366
1367 @node KOLMOGOROV-SMIRNOV
1368 @subsection Kolmogorov-Smirnov Test
1369 @vindex KOLMOGOROV-SMIRNOV
1370 @vindex K-S
1371 @cindex Kolmogorov-Smirnov test
1372
1373 @display
1374      [ /KOLMOGOROV-SMIRNOV (@{NORMAL [@var{mu}, @var{sigma}], UNIFORM [@var{min}, @var{max}], POISSON [@var{lambda}], EXPONENTIAL [@var{scale}] @}) = @var{var_list} ]
1375 @end display
1376
1377 The one sample Kolmogorov-Smirnov subcommand is used to test whether or not a dataset is
1378 drawn from a particular distribution.  Four distributions are supported, @i{viz:}
1379 Normal, Uniform, Poisson and Exponential.
1380
1381 Ideally you should provide the parameters of the distribution against which you wish to test
1382 the data. For example, with the normal distribution  the mean (@var{mu})and standard deviation (@var{sigma})
1383 should be given; with the uniform distribution, the minimum (@var{min})and maximum (@var{max}) value should
1384 be provided.
1385 However, if the parameters are omitted they will be imputed from the data. Imputing the
1386 parameters reduces the power of the test so should be avoided if possible.
1387
1388 In the following example, two variables @var{score} and @var{age} are tested to see if
1389 they follow a normal distribution with a mean of 3.5 and a standard deviation of 2.0.
1390 @example
1391   NPAR TESTS
1392         /KOLMOGOROV-SMIRNOV (normal 3.5 2.0) = @var{score} @var{age}.
1393 @end example
1394 If the variables need to be tested against different distributions, then a separate
1395 subcommand must be used.  For example the following syntax tests @var{score} against
1396 a normal distribution with mean of 3.5 and standard deviation of 2.0 whilst @var{age}
1397 is tested against a normal distribution of mean 40 and standard deviation 1.5.
1398 @example
1399   NPAR TESTS
1400         /KOLMOGOROV-SMIRNOV (normal 3.5 2.0) = @var{score}
1401         /KOLMOGOROV-SMIRNOV (normal 40 1.5) =  @var{age}.
1402 @end example
1403
1404 The abbreviated subcommand  @subcmd{K-S} may be used in place of @subcmd{KOLMOGOROV-SMIRNOV}.
1405
1406 @node KRUSKAL-WALLIS
1407 @subsection Kruskal-Wallis Test
1408 @vindex KRUSKAL-WALLIS
1409 @vindex K-W
1410 @cindex Kruskal-Wallis test
1411
1412 @display
1413      [ /KRUSKAL-WALLIS = @var{var_list} BY var (@var{lower}, @var{upper}) ]
1414 @end display
1415
1416 The Kruskal-Wallis test is used to compare data from an 
1417 arbitrary number of populations.  It does not assume normality.
1418 The data to be compared are specified by @var{var_list}.
1419 The categorical variable determining the groups to which the
1420 data belongs is given by @var{var}. The limits @var{lower} and
1421 @var{upper} specify the valid range of @var{var}. Any cases for
1422 which @var{var} falls outside [@var{lower}, @var{upper}] will be
1423 ignored.
1424
1425 The mean rank of each group as well as the chi-squared value and significance
1426 of the test will be printed.
1427 The abbreviated subcommand  @subcmd{K-W} may be used in place of @subcmd{KRUSKAL-WALLIS}.
1428
1429
1430 @node MANN-WHITNEY
1431 @subsection Mann-Whitney U Test
1432 @vindex MANN-WHITNEY
1433 @vindex M-W
1434 @cindex Mann-Whitney U test
1435 @cindex U, Mann-Whitney U
1436
1437 @display
1438      [ /MANN-WHITNEY = @var{var_list} BY var (@var{group1}, @var{group2}) ]
1439 @end display
1440
1441 The Mann-Whitney subcommand is used to test whether two groups of data come from different populations.
1442 The variables to be tested should be specified in @var{var_list} and the grouping variable, that determines to which group the test variables belong, in @var{var}.
1443 @var{Var} may be either a string or an alpha variable.
1444 @var{Group1} and @var{group2} specify the
1445 two values of @var{var} which determine the groups of the test data.
1446 Cases for which the @var{var} value is neither @var{group1} or @var{group2} will be ignored.
1447
1448 The value of the Mann-Whitney U statistic, the Wilcoxon W, and the significance will be printed.
1449 The abbreviated subcommand  @subcmd{M-W} may be used in place of @subcmd{MANN-WHITNEY}.
1450
1451 @node MCNEMAR
1452 @subsection McNemar Test
1453 @vindex MCNEMAR
1454 @cindex McNemar test
1455
1456 @display
1457      [ /MCNEMAR @var{var_list} [ WITH @var{var_list} [ (PAIRED) ]]]
1458 @end display
1459
1460 Use McNemar's test to analyse the significance of the difference between
1461 pairs of correlated proportions.
1462
1463 If the @code{WITH} keyword is omitted, then tests for all
1464 combinations of the listed variables are performed.
1465 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
1466 is also given, then the number of variables preceding @code{WITH}
1467 must be the same as the number following it.
1468 In this case, tests for each respective pair of variables are
1469 performed.
1470 If the @code{WITH} keyword is given, but the
1471 @code{(PAIRED)} keyword is omitted, then tests for each combination
1472 of variable preceding @code{WITH} against variable following
1473 @code{WITH} are performed.
1474
1475 The data in each variable must be dichotomous.  If there are more
1476 than two distinct variables an error will occur and the test will
1477 not be run.
1478
1479 @node MEDIAN
1480 @subsection Median Test
1481 @vindex MEDIAN
1482 @cindex Median test
1483
1484 @display
1485      [ /MEDIAN [(@var{value})] = @var{var_list} BY @var{variable} (@var{value1}, @var{value2}) ]
1486 @end display
1487
1488 The median test is used to test whether independent samples come from 
1489 populations with a common median.
1490 The median of the populations against which the samples are to be tested
1491 may be given in parentheses immediately after the 
1492 @subcmd{/MEDIAN} subcommand.  If it is not given, the median will be imputed from the 
1493 union of all the samples.
1494
1495 The variables of the samples to be tested should immediately follow the @samp{=} sign. The
1496 keyword @code{BY} must come next, and then the grouping variable.  Two values
1497 in parentheses should follow.  If the first value is greater than the second,
1498 then a 2 sample test is performed using these two values to determine the groups.
1499 If however, the first variable is less than the second, then a @i{k} sample test is
1500 conducted and the group values used are all values encountered which lie in the
1501 range [@var{value1},@var{value2}].
1502
1503
1504 @node RUNS
1505 @subsection Runs Test
1506 @vindex RUNS
1507 @cindex runs test
1508
1509 @display 
1510      [ /RUNS (@{MEAN, MEDIAN, MODE, @var{value}@})  = @var{var_list} ]
1511 @end display
1512
1513 The @subcmd{/RUNS} subcommand tests whether a data sequence is randomly ordered.
1514
1515 It works by examining the number of times a variable's value crosses a given threshold. 
1516 The desired threshold must be specified within parentheses.
1517 It may either be specified as a number or as one of @subcmd{MEAN}, @subcmd{MEDIAN} or @subcmd{MODE}.
1518 Following the threshold specification comes the list of variables whose values are to be
1519 tested.
1520
1521 The subcommand shows the number of runs, the asymptotic significance based on the
1522 length of the data.
1523
1524 @node SIGN
1525 @subsection Sign Test
1526 @vindex SIGN
1527 @cindex sign test
1528
1529 @display
1530      [ /SIGN @var{var_list} [ WITH @var{var_list} [ (PAIRED) ]]]
1531 @end display
1532
1533 The @subcmd{/SIGN} subcommand tests for differences between medians of the 
1534 variables listed.
1535 The test does not make any assumptions about the
1536 distribution of the data.
1537
1538 If the @code{WITH} keyword is omitted, then tests for all
1539 combinations of the listed variables are performed.
1540 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
1541 is also given, then the number of variables preceding @code{WITH}
1542 must be the same as the number following it.
1543 In this case, tests for each respective pair of variables are
1544 performed.
1545 If the @code{WITH} keyword is given, but the
1546 @code{(PAIRED)} keyword is omitted, then tests for each combination
1547 of variable preceding @code{WITH} against variable following
1548 @code{WITH} are performed.
1549
1550 @node WILCOXON
1551 @subsection Wilcoxon Matched Pairs Signed Ranks Test
1552 @vindex WILCOXON
1553 @cindex wilcoxon matched pairs signed ranks test
1554
1555 @display
1556      [ /WILCOXON @var{var_list} [ WITH @var{var_list} [ (PAIRED) ]]]
1557 @end display
1558
1559 The @subcmd{/WILCOXON} subcommand tests for differences between medians of the 
1560 variables listed.
1561 The test does not make any assumptions about the variances of the samples.
1562 It does however assume that the distribution is symmetrical.
1563
1564 If the @subcmd{WITH} keyword is omitted, then tests for all
1565 combinations of the listed variables are performed.
1566 If the @subcmd{WITH} keyword is given, and the @subcmd{(PAIRED)} keyword
1567 is also given, then the number of variables preceding @subcmd{WITH}
1568 must be the same as the number following it.
1569 In this case, tests for each respective pair of variables are
1570 performed.
1571 If the @subcmd{WITH} keyword is given, but the
1572 @subcmd{(PAIRED)} keyword is omitted, then tests for each combination
1573 of variable preceding @subcmd{WITH} against variable following
1574 @subcmd{WITH} are performed.
1575
1576 @node T-TEST
1577 @section T-TEST
1578
1579 @vindex T-TEST
1580
1581 @display
1582 T-TEST
1583         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
1584         /CRITERIA=CI(@var{confidence})
1585
1586
1587 (One Sample mode.)
1588         TESTVAL=@var{test_value}
1589         /VARIABLES=@var{var_list}
1590
1591
1592 (Independent Samples mode.)
1593         GROUPS=var(@var{value1} [, @var{value2}])
1594         /VARIABLES=@var{var_list}
1595
1596
1597 (Paired Samples mode.)
1598         PAIRS=@var{var_list} [WITH @var{var_list} [(PAIRED)] ]
1599
1600 @end display
1601
1602
1603 The @cmd{T-TEST} procedure outputs tables used in testing hypotheses about 
1604 means.  
1605 It operates in one of three modes:
1606 @itemize
1607 @item One Sample mode.
1608 @item Independent Groups mode.
1609 @item Paired mode.
1610 @end itemize
1611
1612 @noindent
1613 Each of these modes are described in more detail below.
1614 There are two optional subcommands which are common to all modes.
1615
1616 The @cmd{/CRITERIA} subcommand tells @pspp{} the confidence interval used
1617 in the tests.  The default value is 0.95.
1618
1619
1620 The @cmd{MISSING} subcommand determines the handling of missing
1621 variables.  
1622 If @subcmd{INCLUDE} is set, then user-missing values are included in the
1623 calculations, but system-missing values are not.
1624 If @subcmd{EXCLUDE} is set, which is the default, user-missing
1625 values are excluded as well as system-missing values. 
1626 This is the default.
1627
1628 If @subcmd{LISTWISE} is set, then the entire case is excluded from analysis
1629 whenever any variable  specified in the @subcmd{/VARIABLES}, @subcmd{/PAIRS} or 
1630 @subcmd{/GROUPS} subcommands contains a missing value.   
1631 If @subcmd{ANALYSIS} is set, then missing values are excluded only in the analysis for
1632 which they would be needed. This is the default.
1633
1634
1635 @menu
1636 * One Sample Mode::             Testing against a hypothesized mean
1637 * Independent Samples Mode::    Testing two independent groups for equal mean
1638 * Paired Samples Mode::         Testing two interdependent groups for equal mean
1639 @end menu
1640
1641 @node One Sample Mode
1642 @subsection One Sample Mode
1643
1644 The @subcmd{TESTVAL} subcommand invokes the One Sample mode.
1645 This mode is used to test a population mean against a hypothesized
1646 mean. 
1647 The value given to the @subcmd{TESTVAL} subcommand is the value against
1648 which you wish to test.
1649 In this mode, you must also use the @subcmd{/VARIABLES} subcommand to
1650 tell @pspp{} which variables you wish to test.
1651
1652 @node Independent Samples Mode
1653 @subsection Independent Samples Mode
1654
1655 The @subcmd{GROUPS} subcommand invokes Independent Samples mode or
1656 `Groups' mode. 
1657 This mode is used to test whether two groups of values have the
1658 same population mean.
1659 In this mode, you must also use the @subcmd{/VARIABLES} subcommand to
1660 tell @pspp{} the dependent variables you wish to test.
1661
1662 The variable given in the @subcmd{GROUPS} subcommand is the independent
1663 variable which determines to which group the samples belong.
1664 The values in parentheses are the specific values of the independent
1665 variable for each group.
1666 If the parentheses are omitted and no values are given, the default values 
1667 of 1.0 and 2.0 are assumed.
1668
1669 If the independent variable is numeric, 
1670 it is acceptable to specify only one value inside the parentheses.
1671 If you do this, cases where the independent variable is
1672 greater than or equal to this value belong to the first group, and cases
1673 less than this value belong to the second group.
1674 When using this form of the @subcmd{GROUPS} subcommand, missing values in
1675 the independent variable are excluded on a listwise basis, regardless
1676 of whether @subcmd{/MISSING=LISTWISE} was specified.
1677
1678
1679 @node Paired Samples Mode
1680 @subsection Paired Samples Mode
1681
1682 The @cmd{PAIRS} subcommand introduces Paired Samples mode.
1683 Use this mode when repeated measures have been taken from the same
1684 samples.
1685 If the @subcmd{WITH} keyword is omitted, then tables for all
1686 combinations of variables given in the @cmd{PAIRS} subcommand are
1687 generated. 
1688 If the @subcmd{WITH} keyword is given, and the @subcmd{(PAIRED)} keyword
1689 is also given, then the number of variables preceding @subcmd{WITH}
1690 must be the same as the number following it.
1691 In this case, tables for each respective pair of variables are
1692 generated.
1693 In the event that the @subcmd{WITH} keyword is given, but the
1694 @subcmd{(PAIRED)} keyword is omitted, then tables for each combination
1695 of variable preceding @subcmd{WITH} against variable following
1696 @subcmd{WITH} are generated.
1697
1698
1699 @node ONEWAY
1700 @section ONEWAY
1701
1702 @vindex ONEWAY
1703 @cindex analysis of variance
1704 @cindex ANOVA
1705
1706 @display
1707 ONEWAY
1708         [/VARIABLES = ] @var{var_list} BY @var{var}
1709         /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
1710         /CONTRAST= @var{value1} [, @var{value2}] ... [,@var{valueN}]
1711         /STATISTICS=@{DESCRIPTIVES,HOMOGENEITY@}
1712         /POSTHOC=@{BONFERRONI, GH, LSD, SCHEFFE, SIDAK, TUKEY, ALPHA ([@var{value}])@}
1713 @end display
1714
1715 The @cmd{ONEWAY} procedure performs a one-way analysis of variance of
1716 variables factored by a single independent variable.
1717 It is used to compare the means of a population
1718 divided into more than two groups. 
1719
1720 The dependent variables to be analysed should be given in the @subcmd{VARIABLES}
1721 subcommand.  
1722 The list of variables must be followed by the @subcmd{BY} keyword and
1723 the name of the independent (or factor) variable.
1724
1725 You can use the @subcmd{STATISTICS} subcommand to tell @pspp{} to display
1726 ancillary information.  The options accepted are:
1727 @itemize
1728 @item DESCRIPTIVES
1729 Displays descriptive statistics about the groups factored by the independent
1730 variable.
1731 @item HOMOGENEITY
1732 Displays the Levene test of Homogeneity of Variance for the
1733 variables and their groups.
1734 @end itemize
1735
1736 The @subcmd{CONTRAST} subcommand is used when you anticipate certain
1737 differences between the groups.
1738 The subcommand must be followed by a list of numerals which are the
1739 coefficients of the groups to be tested.
1740 The number of coefficients must correspond to the number of distinct
1741 groups (or values of the independent variable).
1742 If the total sum of the coefficients are not zero, then @pspp{} will
1743 display a warning, but will proceed with the analysis.
1744 The @subcmd{CONTRAST} subcommand may be given up to 10 times in order
1745 to specify different contrast tests.
1746 The @subcmd{MISSING} subcommand defines how missing values are handled.
1747 If @subcmd{LISTWISE} is specified then cases which have missing values for 
1748 the independent variable or any dependent variable will be ignored.
1749 If @subcmd{ANALYSIS} is specified, then cases will be ignored if the independent
1750 variable is missing or if the dependent variable currently being 
1751 analysed is missing.  The default is @subcmd{ANALYSIS}.
1752 A setting of @subcmd{EXCLUDE} means that variables whose values are
1753 user-missing are to be excluded from the analysis. A setting of
1754 @subcmd{INCLUDE} means they are to be included.  The default is @subcmd{EXCLUDE}.
1755
1756 Using the @code{POSTHOC} subcommand you can perform multiple
1757 pairwise comparisons on the data. The following comparison methods
1758 are available:
1759 @itemize
1760 @item @subcmd{LSD}
1761 Least Significant Difference.
1762 @item @subcmd{TUKEY}
1763 Tukey Honestly Significant Difference.
1764 @item @subcmd{BONFERRONI}
1765 Bonferroni test.
1766 @item @subcmd{SCHEFFE}
1767 Scheff@'e's test.
1768 @item @subcmd{SIDAK}
1769 Sidak test.
1770 @item @subcmd{GH}
1771 The Games-Howell test.
1772 @end itemize
1773
1774 @noindent
1775 The optional syntax @code{ALPHA(@var{value})} is used to indicate
1776 that @var{value} should be used as the
1777 confidence level for which the posthoc tests will be performed.
1778 The default is 0.05.
1779
1780 @node QUICK CLUSTER
1781 @section QUICK CLUSTER
1782 @vindex QUICK CLUSTER
1783
1784 @cindex K-means clustering
1785 @cindex clustering
1786
1787 @display
1788 QUICK CLUSTER @var{var_list}
1789       [/CRITERIA=CLUSTERS(@var{k}) [MXITER(@var{max_iter})] CONVERGE(@var{epsilon}) [NOINITIAL]]
1790       [/MISSING=@{EXCLUDE,INCLUDE@} @{LISTWISE, PAIRWISE@}]
1791       [/PRINT=@{INITIAL@} @{CLUSTER@}]
1792 @end display
1793
1794 The @cmd{QUICK CLUSTER} command performs k-means clustering on the
1795 dataset.  This is useful when you wish to allocate cases into clusters
1796 of similar values and you already know the number of clusters.
1797
1798 The minimum specification is @samp{QUICK CLUSTER} followed by the names
1799 of the variables which contain the cluster data.  Normally you will also
1800 want to specify @subcmd{/CRITERIA=CLUSTERS(@var{k})} where @var{k} is the
1801 number of clusters.  If this is not specified, then @var{k} defaults to 2.
1802
1803 If you use @subcmd{/CRITERIA=NOINITIAL} then a naive algorithm to select
1804 the initial clusters is used.   This will provide for faster execution but
1805 less well separated initial clusters and hence possibly an inferior final
1806 result.
1807
1808
1809 @cmd{QUICK CLUSTER} uses an iterative algorithm to select the clusters centers.
1810 The subcommand  @subcmd{/CRITERIA=MXITER(@var{max_iter})} sets the maximum number of iterations.
1811 During classification, @pspp{} will continue iterating until until @var{max_iter}
1812 iterations have been done or the convergence criterion (see below) is fulfilled.
1813 The default value of @var{max_iter} is 2.
1814
1815 If however, you specify @subcmd{/CRITERIA=NOUPDATE} then after selecting the initial centers,
1816 no further update to the cluster centers is done.  In this case, @var{max_iter}, if specified.
1817 is ignored.
1818
1819 The subcommand  @subcmd{/CRITERIA=CONVERGE(@var{epsilon})} is used
1820 to set the convergence criterion.  The value of convergence criterion is  @var{epsilon}
1821 times the minimum distance between the @emph{initial} cluster centers.  Iteration stops when
1822 the  mean cluster distance between  one iteration and the next  
1823 is less than the convergence criterion.  The default value of @var{epsilon} is zero.
1824
1825 The @subcmd{MISSING} subcommand determines the handling of missing variables.  
1826 If @subcmd{INCLUDE} is set, then user-missing values are considered at their face
1827 value and not as missing values.
1828 If @subcmd{EXCLUDE} is set, which is the default, user-missing
1829 values are excluded as well as system-missing values. 
1830
1831 If @subcmd{LISTWISE} is set, then the entire case is excluded from the analysis
1832 whenever any of the clustering variables contains a missing value.   
1833 If @subcmd{PAIRWISE} is set, then a case is considered missing only if all the
1834 clustering variables contain missing values.  Otherwise it is clustered
1835 on the basis of the non-missing values.
1836 The default is @subcmd{LISTWISE}.
1837
1838 The @subcmd{PRINT} subcommand requests additional output to be printed.
1839 If @subcmd{INITIAL} is set, then the initial cluster memberships will
1840 be printed.
1841 If @subcmd{CLUSTER} is set, the cluster memberships of the individual
1842 cases will be displayed (potentially generating lengthy output).
1843
1844
1845 @node RANK
1846 @section RANK
1847
1848 @vindex RANK
1849 @display
1850 RANK
1851         [VARIABLES=] @var{var_list} [@{A,D@}] [BY @var{var_list}]
1852         /TIES=@{MEAN,LOW,HIGH,CONDENSE@}
1853         /FRACTION=@{BLOM,TUKEY,VW,RANKIT@}
1854         /PRINT[=@{YES,NO@}
1855         /MISSING=@{EXCLUDE,INCLUDE@}
1856
1857         /RANK [INTO @var{var_list}]
1858         /NTILES(k) [INTO @var{var_list}]
1859         /NORMAL [INTO @var{var_list}]
1860         /PERCENT [INTO @var{var_list}]
1861         /RFRACTION [INTO @var{var_list}]
1862         /PROPORTION [INTO @var{var_list}]
1863         /N [INTO @var{var_list}]
1864         /SAVAGE [INTO @var{var_list}]
1865 @end display
1866
1867 The @cmd{RANK} command ranks variables and stores the results into new
1868 variables. 
1869
1870 The @subcmd{VARIABLES} subcommand, which is mandatory, specifies one or
1871 more variables whose values are to be ranked.  
1872 After each variable, @samp{A} or @samp{D} may appear, indicating that
1873 the variable is to be ranked in ascending or descending order.
1874 Ascending is the default.
1875 If a @subcmd{BY} keyword appears, it should be followed by a list of variables
1876 which are to serve as group variables.  
1877 In this case, the cases are gathered into groups, and ranks calculated
1878 for each group.
1879
1880 The @subcmd{TIES} subcommand specifies how tied values are to be treated.  The
1881 default is to take the mean value of all the tied cases.
1882
1883 The @subcmd{FRACTION} subcommand specifies how proportional ranks are to be
1884 calculated.  This only has any effect if @subcmd{NORMAL} or @subcmd{PROPORTIONAL} rank
1885 functions are requested.
1886
1887 The @subcmd{PRINT} subcommand may be used to specify that a summary of the rank
1888 variables created should appear in the output.
1889
1890 The function subcommands are @subcmd{RANK}, @subcmd{NTILES}, @subcmd{NORMAL}, @subcmd{PERCENT}, @subcmd{RFRACTION},
1891 @subcmd{PROPORTION} and @subcmd{SAVAGE}.  Any number of function subcommands may appear.
1892 If none are given, then the default is RANK.
1893 The @subcmd{NTILES} subcommand must take an integer specifying the number of
1894 partitions into which values should be ranked.
1895 Each subcommand may be followed by the @subcmd{INTO} keyword and a list of
1896 variables which are the variables to be created and receive the rank
1897 scores.  There may be as many variables specified as there are
1898 variables named on the @subcmd{VARIABLES} subcommand.  If fewer are specified,
1899 then the variable names are automatically created.
1900
1901 The @subcmd{MISSING} subcommand determines how user missing values are to be
1902 treated. A setting of @subcmd{EXCLUDE} means that variables whose values are
1903 user-missing are to be excluded from the rank scores. A setting of
1904 @subcmd{INCLUDE} means they are to be included.  The default is @subcmd{EXCLUDE}.
1905
1906 @include regression.texi
1907
1908
1909 @node RELIABILITY
1910 @section RELIABILITY
1911
1912 @vindex RELIABILITY
1913 @display
1914 RELIABILITY
1915         /VARIABLES=@var{var_list}
1916         /SCALE (@var{name}) = @{@var{var_list}, ALL@}
1917         /MODEL=@{ALPHA, SPLIT[(@var{n})]@}
1918         /SUMMARY=@{TOTAL,ALL@}
1919         /MISSING=@{EXCLUDE,INCLUDE@}
1920 @end display
1921
1922 @cindex Cronbach's Alpha
1923 The @cmd{RELIABILITY} command performs reliability analysis on the data.
1924
1925 The @subcmd{VARIABLES} subcommand is required. It determines the set of variables 
1926 upon which analysis is to be performed.
1927
1928 The @subcmd{SCALE} subcommand determines which variables reliability is to be 
1929 calculated for.  If it is omitted, then analysis for all variables named
1930 in the @subcmd{VARIABLES} subcommand will be used.
1931 Optionally, the @var{name} parameter may be specified to set a string name 
1932 for the scale.
1933
1934 The @subcmd{MODEL} subcommand determines the type of analysis. If @subcmd{ALPHA} is specified, 
1935 then Cronbach's Alpha is calculated for the scale.  If the model is @subcmd{SPLIT}, 
1936 then the variables  are divided into 2 subsets.  An optional parameter 
1937 @var{n} may be given, to specify how many variables to be in the first subset.
1938 If @var{n} is omitted, then it defaults to one half of the variables in the 
1939 scale, or one half minus one if there are an odd number of variables.
1940 The default model is @subcmd{ALPHA}.
1941
1942 By default, any cases with user missing, or system missing values for 
1943 any variables given 
1944 in the @subcmd{VARIABLES} subcommand will be omitted from analysis.
1945 The @subcmd{MISSING} subcommand determines whether user missing values are to 
1946 be included or excluded in the analysis.
1947
1948 The @subcmd{SUMMARY} subcommand determines the type of summary analysis to be performed.
1949 Currently there is only one type: @subcmd{SUMMARY=TOTAL}, which displays per-item
1950 analysis tested against the totals.
1951
1952
1953
1954 @node ROC
1955 @section ROC
1956
1957 @vindex ROC
1958 @cindex Receiver Operating Characteristic
1959 @cindex Area under curve
1960
1961 @display
1962 ROC     @var{var_list} BY @var{state_var} (@var{state_value})
1963         /PLOT = @{ CURVE [(REFERENCE)], NONE @}
1964         /PRINT = [ SE ] [ COORDINATES ]
1965         /CRITERIA = [ CUTOFF(@{INCLUDE,EXCLUDE@}) ]
1966           [ TESTPOS (@{LARGE,SMALL@}) ]
1967           [ CI (@var{confidence}) ]
1968           [ DISTRIBUTION (@{FREE, NEGEXPO @}) ]
1969         /MISSING=@{EXCLUDE,INCLUDE@}
1970 @end display
1971
1972
1973 The @cmd{ROC} command is used to plot the receiver operating characteristic curve 
1974 of a dataset, and to estimate the area under the curve.
1975 This is useful for analysing the efficacy of a variable as a predictor of a state of nature.
1976
1977 The mandatory @var{var_list} is the list of predictor variables.
1978 The variable @var{state_var} is the variable whose values represent the actual states, 
1979 and @var{state_value} is the value of this variable which represents the positive state.
1980
1981 The optional subcommand @subcmd{PLOT} is used to determine if and how the @subcmd{ROC} curve is drawn.
1982 The keyword @subcmd{CURVE} means that the @subcmd{ROC} curve should be drawn, and the optional keyword @subcmd{REFERENCE},
1983 which should be enclosed in parentheses, says that the diagonal reference line should be drawn.
1984 If the keyword @subcmd{NONE} is given, then no @subcmd{ROC} curve is drawn.
1985 By default, the curve is drawn with no reference line.
1986
1987 The optional subcommand @subcmd{PRINT} determines which additional tables should be printed.
1988 Two additional tables are available. 
1989 The @subcmd{SE} keyword says that standard error of the area under the curve should be printed as well as
1990 the area itself.
1991 In addition, a p-value under the null hypothesis that the area under the curve equals 0.5 will be
1992 printed.
1993 The @subcmd{COORDINATES} keyword says that a table of coordinates of the @subcmd{ROC} curve should be printed.
1994
1995 The @subcmd{CRITERIA} subcommand has four optional parameters:
1996 @itemize @bullet
1997 @item The @subcmd{TESTPOS} parameter may be @subcmd{LARGE} or @subcmd{SMALL}.
1998 @subcmd{LARGE} is the default, and says that larger values in the predictor variables are to be 
1999 considered positive.  @subcmd{SMALL} indicates that smaller values should be considered positive.
2000
2001 @item The @subcmd{CI} parameter specifies the confidence interval that should be printed.
2002 It has no effect if the @subcmd{SE} keyword in the @subcmd{PRINT} subcommand has not been given.
2003
2004 @item The @subcmd{DISTRIBUTION} parameter determines the method to be used when estimating the area
2005 under the curve.  
2006 There are two possibilities, @i{viz}: @subcmd{FREE} and @subcmd{NEGEXPO}.
2007 The @subcmd{FREE} method uses a non-parametric estimate, and the @subcmd{NEGEXPO} method a bi-negative 
2008 exponential distribution estimate.
2009 The @subcmd{NEGEXPO} method should only be used when the number of positive actual states is
2010 equal to the number of negative actual states.
2011 The default is @subcmd{FREE}.
2012
2013 @item The @subcmd{CUTOFF} parameter is for compatibility and is ignored.
2014 @end itemize
2015
2016 The @subcmd{MISSING} subcommand determines whether user missing values are to 
2017 be included or excluded in the analysis.  The default behaviour is to
2018 exclude them.
2019 Cases are excluded on a listwise basis; if any of the variables in @var{var_list} 
2020 or if the variable @var{state_var} is missing, then the entire case will be 
2021 excluded.
2022
2023 @c  LocalWords:  subcmd subcommand