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