1 @node Statistics, Utilities, Conditionals and Looping, Top
4 This chapter documents the statistical procedures that PSPP supports so
8 * DESCRIPTIVES:: Descriptive statistics.
9 * FREQUENCIES:: Frequency tables.
10 * EXAMINE:: Testing data for normality.
11 * CROSSTABS:: Crosstabulation tables.
12 * T-TEST:: Test hypotheses about means.
13 * ONEWAY:: One way analysis of variance.
14 * RANK:: Compute rank scores.
15 * REGRESSION:: Linear regression.
18 @node DESCRIPTIVES, FREQUENCIES, Statistics, Statistics
25 /MISSING=@{VARIABLE,LISTWISE@} @{INCLUDE,NOINCLUDE@}
26 /FORMAT=@{LABELS,NOLABELS@} @{NOINDEX,INDEX@} @{LINE,SERIAL@}
28 /STATISTICS=@{ALL,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,
29 SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,DEFAULT,
30 SESKEWNESS,SEKURTOSIS@}
31 /SORT=@{NONE,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,SKEWNESS,
32 RANGE,MINIMUM,MAXIMUM,SUM,SESKEWNESS,SEKURTOSIS,NAME@}
36 The @cmd{DESCRIPTIVES} procedure reads the active file and outputs
38 statistics requested by the user. In addition, it can optionally
41 The VARIABLES subcommand, which is required, specifies the list of
42 variables to be analyzed. Keyword VARIABLES is optional.
44 All other subcommands are optional:
46 The MISSING subcommand determines the handling of missing variables. If
47 INCLUDE is set, then user-missing values are included in the
48 calculations. If NOINCLUDE is set, which is the default, user-missing
49 values are excluded. If VARIABLE is set, then missing values are
50 excluded on a variable by variable basis; if LISTWISE is set, then
51 the entire case is excluded whenever any value in that case has a
52 system-missing or, if INCLUDE is set, user-missing value.
54 The FORMAT subcommand affects the output format. Currently the
55 LABELS/NOLABELS and NOINDEX/INDEX settings are not used. When SERIAL is
56 set, both valid and missing number of cases are listed in the output;
57 when NOSERIAL is set, only valid cases are listed.
59 The SAVE subcommand causes @cmd{DESCRIPTIVES} to calculate Z scores for all
60 the specified variables. The Z scores are saved to new variables.
61 Variable names are generated by trying first the original variable name
62 with Z prepended and truncated to a maximum of 8 characters, then the
63 names ZSC000 through ZSC999, STDZ00 through STDZ09, ZZZZ00 through
64 ZZZZ09, ZQZQ00 through ZQZQ09, in that sequence. In addition, Z score
65 variable names can be specified explicitly on VARIABLES in the variable
66 list by enclosing them in parentheses after each variable.
68 The STATISTICS subcommand specifies the statistics to be displayed:
72 All of the statistics below.
76 Standard error of the mean.
82 Kurtosis and standard error of the kurtosis.
84 Skewness and standard error of the skewness.
94 Mean, standard deviation of the mean, minimum, maximum.
96 Standard error of the kurtosis.
98 Standard error of the skewness.
101 The SORT subcommand specifies how the statistics should be sorted. Most
102 of the possible values should be self-explanatory. NAME causes the
103 statistics to be sorted by name. By default, the statistics are listed
104 in the order that they are specified on the VARIABLES subcommand. The A
105 and D settings request an ascending or descending sort order,
108 @node FREQUENCIES, EXAMINE, DESCRIPTIVES, Statistics
115 /FORMAT=@{TABLE,NOTABLE,LIMIT(limit)@}
116 @{STANDARD,CONDENSE,ONEPAGE[(onepage_limit)]@}
118 @{AVALUE,DVALUE,AFREQ,DFREQ@}
121 /MISSING=@{EXCLUDE,INCLUDE@}
122 /STATISTICS=@{DEFAULT,MEAN,SEMEAN,MEDIAN,MODE,STDDEV,VARIANCE,
123 KURTOSIS,SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,
124 SESKEWNESS,SEKURTOSIS,ALL,NONE@}
126 /PERCENTILES=percent@dots{}
127 /HISTOGRAM=[MINIMUM(x_min)] [MAXIMUM(x_max)]
128 [@{FREQ,PCNT@}] [@{NONORMAL,NORMAL@}]
129 /PIECHART=[MINIMUM(x_min)] [MAXIMUM(x_max)] @{NOMISSING,MISSING@}
131 (These options are not currently implemented.)
137 /VARIABLES=var_list (low,high)@dots{}
140 The @cmd{FREQUENCIES} procedure outputs frequency tables for specified
142 @cmd{FREQUENCIES} can also calculate and display descriptive statistics
143 (including median and mode) and percentiles.
145 @cmd{FREQUENCIES} also support graphical output in the form of
146 histograms and pie charts. In the future, it will be able to produce
147 bar charts and output percentiles for grouped data.
149 The VARIABLES subcommand is the only required subcommand. Specify the
150 variables to be analyzed. In most cases, this is all that is required.
151 This is known as @dfn{general mode}.
153 Occasionally, one may want to invoke a special mode called @dfn{integer
154 mode}. Normally, in general mode, PSPP will automatically determine
155 what values occur in the data. In integer mode, the user specifies the
156 range of values that the data assumes. To invoke this mode, specify a
157 range of data values in parentheses, separated by a comma. Data values
158 inside the range are truncated to the nearest integer, then assigned to
159 that value. If values occur outside this range, they are discarded.
161 The FORMAT subcommand controls the output format. It has several
166 TABLE, the default, causes a frequency table to be output for every
167 variable specified. NOTABLE prevents them from being output. LIMIT
168 with a numeric argument causes them to be output except when there are
169 more than the specified number of values in the table.
172 STANDARD frequency tables contain more complete information, but also to
173 take up more space on the printed page. CONDENSE frequency tables are
174 less informative but take up less space. ONEPAGE with a numeric
175 argument will output standard frequency tables if there are the
176 specified number of values or less, condensed tables otherwise. ONEPAGE
177 without an argument defaults to a threshold of 50 values.
180 LABELS causes value labels to be displayed in STANDARD frequency
181 tables. NOLABLES prevents this.
184 Normally frequency tables are sorted in ascending order by value. This
185 is AVALUE. DVALUE tables are sorted in descending order by value.
186 AFREQ and DFREQ tables are sorted in ascending and descending order,
187 respectively, by frequency count.
190 SINGLE spaced frequency tables are closely spaced. DOUBLE spaced
191 frequency tables have wider spacing.
194 OLDPAGE and NEWPAGE are not currently used.
197 The MISSING subcommand controls the handling of user-missing values.
198 When EXCLUDE, the default, is set, user-missing values are not included
199 in frequency tables or statistics. When INCLUDE is set, user-missing
200 are included. System-missing values are never included in statistics,
201 but are listed in frequency tables.
203 The available STATISTICS are the same as available in @cmd{DESCRIPTIVES}
204 (@pxref{DESCRIPTIVES}), with the addition of MEDIAN, the data's median
205 value, and MODE, the mode. (If there are multiple modes, the smallest
206 value is reported.) By default, the mean, standard deviation of the
207 mean, minimum, and maximum are reported for each variable.
210 PERCENTILES causes the specified percentiles to be reported.
211 The percentiles should be presented at a list of numbers between 0
213 The NTILES subcommand causes the percentiles to be reported at the
214 boundaries of the data set divided into the specified number of ranges.
215 For instance, @code{/NTILES=4} would cause quartiles to be reported.
217 The HISTOGRAM subcommand causes the output to include a histogram for
218 each specified variable. The X axis by default ranges from the
219 minimum to the maximum value observed in the data, but the MINIMUM and
220 MAXIMUM keywords can set an explicit range. The Y axis by default is
221 labeled in frequencies; use the PERCENT keyword to causes it to be
222 labeled in percent of the total observed count. Specify NORMAL to
223 superimpose a normal curve on the histogram.
225 The PIECHART adds a pie chart for each variable to the data. Each
226 slice represents one value, with the size of the slice proportional to
227 the value's frequency. By default, all non-missing values are given
228 slices. The MINIMUM and MAXIMUM keywords can be used to limit the
229 displayed slices to a given range of values. The MISSING keyword adds
230 slices for missing values.
232 @node EXAMINE, CROSSTABS, FREQUENCIES, Statistics
233 @comment node-name, next, previous, up
237 @cindex Normality, testing for
241 VARIABLES=var_list [BY factor_list ]
242 /STATISTICS=@{DESCRIPTIVES, EXTREME[(n)], ALL, NONE@}
243 /PLOT=@{BOXPLOT, NPPLOT, HISTOGRAM, ALL, NONE@}
245 /COMPARE=@{GROUPS,VARIABLES@}
246 /ID=@{case_number, var_name@}
248 /PERCENTILE=[value_list]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @}
249 /MISSING=@{LISTWISE, PAIRWISE@} [@{EXCLUDE, INCLUDE@}]
250 [@{NOREPORT,REPORT@}]
254 The @cmd{EXAMINE} command is used to test how closely a distribution is to a
255 normal distribution. It also shows you outliers and extreme values.
257 The VARIABLES subcommand specifies the dependent variables and the
258 independent variable to use as factors for the analysis. Variables
259 listed before the first BY keyword are the dependent variables.
260 The dependent variables may optionally be followed by a list of
261 factors which tell PSPP how to break down the analysis for each
262 dependent variable. The format for each factor is
268 The STATISTICS subcommand specifies the analysis to be done.
269 DESCRIPTIVES will produce a table showing some parametric and
270 non-parametrics statistics. EXTREME produces a table showing extreme
271 values of the dependent variable. A number in parentheses determines
272 how many upper and lower extremes to show. The default number is 5.
275 The PLOT subcommand specifies which plots are to be produced if any.
277 The COMPARE subcommand is only relevant if producing boxplots, and it is only
278 useful there is more than one dependent variable and at least one factor. If
279 /COMPARE=GROUPS is specified, then one plot per dependent variable is produced,
280 containing boxplots for all the factors.
281 If /COMPARE=VARIABLES is specified, then one plot per factor is produced, each
282 each containing one boxplot per dependent variable.
283 If the /COMPARE subcommand is ommitted, then PSPP uses the default value of
286 The CINTERVAL subcommand specifies the confidence interval to use in
287 calculation of the descriptives command. The default it 95%.
290 The PERCENTILES subcommand specifies which percentiles are to be calculated,
291 and which algorithm to use for calculating them. The default is to
292 calculate the 5, 10, 25, 50, 75, 90, 95 percentiles using the
295 The TOTAL and NOTOTAL subcommands are mutually exclusive. If NOTOTAL
296 is given and factors have been specified in the VARIABLES subcommand,
297 then then statistics for the unfactored dependent variables are
298 produced in addition to the factored variables. If there are no
299 factors specified then TOTAL and NOTOTAL have no effect.
302 If many dependent variable are given, or factors are given for which
303 there are many distinct values, then @cmd{EXAMINE} will produce a very
304 large quantity of output.
307 @node CROSSTABS, T-TEST, EXAMINE, Statistics
313 /TABLES=var_list BY var_list [BY var_list]@dots{}
314 /MISSING=@{TABLE,INCLUDE,REPORT@}
315 /WRITE=@{NONE,CELLS,ALL@}
316 /FORMAT=@{TABLES,NOTABLES@}
317 @{LABELS,NOLABELS,NOVALLABS@}
322 /CELLS=@{COUNT,ROW,COLUMN,TOTAL,EXPECTED,RESIDUAL,SRESIDUAL,
323 ASRESIDUAL,ALL,NONE@}
324 /STATISTICS=@{CHISQ,PHI,CC,LAMBDA,UC,BTAU,CTAU,RISK,GAMMA,D,
325 KAPPA,ETA,CORR,ALL,NONE@}
328 /VARIABLES=var_list (low,high)@dots{}
331 The @cmd{CROSSTABS} procedure displays crosstabulation
332 tables requested by the user. It can calculate several statistics for
333 each cell in the crosstabulation tables. In addition, a number of
334 statistics can be calculated for each table itself.
336 The TABLES subcommand is used to specify the tables to be reported. Any
337 number of dimensions is permitted, and any number of variables per
338 dimension is allowed. The TABLES subcommand may be repeated as many
339 times as needed. This is the only required subcommand in @dfn{general
342 Occasionally, one may want to invoke a special mode called @dfn{integer
343 mode}. Normally, in general mode, PSPP automatically determines
344 what values occur in the data. In integer mode, the user specifies the
345 range of values that the data assumes. To invoke this mode, specify the
346 VARIABLES subcommand, giving a range of data values in parentheses for
347 each variable to be used on the TABLES subcommand. Data values inside
348 the range are truncated to the nearest integer, then assigned to that
349 value. If values occur outside this range, they are discarded. When it
350 is present, the VARIABLES subcommand must precede the TABLES
353 In general mode, numeric and string variables may be specified on
354 TABLES. Although long string variables are allowed, only their
355 initial short-string parts are used. In integer mode, only numeric
356 variables are allowed.
358 The MISSING subcommand determines the handling of user-missing values.
359 When set to TABLE, the default, missing values are dropped on a table by
360 table basis. When set to INCLUDE, user-missing values are included in
361 tables and statistics. When set to REPORT, which is allowed only in
362 integer mode, user-missing values are included in tables but marked with
363 an @samp{M} (for ``missing'') and excluded from statistical
366 Currently the WRITE subcommand is ignored.
368 The FORMAT subcommand controls the characteristics of the
369 crosstabulation tables to be displayed. It has a number of possible
374 TABLES, the default, causes crosstabulation tables to be output.
375 NOTABLES suppresses them.
378 LABELS, the default, allows variable labels and value labels to appear
379 in the output. NOLABELS suppresses them. NOVALLABS displays variable
380 labels but suppresses value labels.
383 PIVOT, the default, causes each TABLES subcommand to be displayed in a
384 pivot table format. NOPIVOT causes the old-style crosstabulation format
388 AVALUE, the default, causes values to be sorted in ascending order.
389 DVALUE asserts a descending sort order.
392 INDEX/NOINDEX is currently ignored.
395 BOX/NOBOX is currently ignored.
398 The CELLS subcommand controls the contents of each cell in the displayed
399 crosstabulation table. The possible settings are:
415 Standardized residual.
417 Adjusted standardized residual.
421 Suppress cells entirely.
424 @samp{/CELLS} without any settings specified requests COUNT, ROW,
425 COLUMN, and TOTAL. If CELLS is not specified at all then only COUNT
428 The STATISTICS subcommand selects statistics for computation:
435 Pearson chi-square, likelihood ratio, Fisher's exact test, continuity
436 correction, linear-by-linear association.
440 Contingency coefficient.
444 Uncertainty coefficient.
460 Spearman correlation, Pearson's r.
467 Selected statistics are only calculated when appropriate for the
468 statistic. Certain statistics require tables of a particular size, and
469 some statistics are calculated only in integer mode.
471 @samp{/STATISTICS} without any settings selects CHISQ. If the
472 STATISTICS subcommand is not given, no statistics are calculated.
474 @strong{Please note:} Currently the implementation of CROSSTABS has the
479 Pearson's R (but not Spearman) is off a little.
481 T values for Spearman's R and Pearson's R are wrong.
483 Significance of symmetric and directional measures is not calculated.
485 Asymmetric ASEs and T values for lambda are wrong.
487 ASE of Goodman and Kruskal's tau is not calculated.
489 ASE of symmetric somers' d is wrong.
491 Approximate T of uncertainty coefficient is wrong.
494 Fixes for any of these deficiencies would be welcomed.
496 @node T-TEST, ONEWAY, CROSSTABS, Statistics
497 @comment node-name, next, previous, up
503 /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
504 /CRITERIA=CIN(confidence)
512 (Independent Samples mode.)
513 GROUPS=var(value1 [, value2])
517 (Paired Samples mode.)
518 PAIRS=var_list [WITH var_list [(PAIRED)] ]
523 The @cmd{T-TEST} procedure outputs tables used in testing hypotheses about
525 It operates in one of three modes:
527 @item One Sample mode.
528 @item Independent Groups mode.
533 Each of these modes are described in more detail below.
534 There are two optional subcommands which are common to all modes.
536 The @cmd{/CRITERIA} subcommand tells PSPP the confidence interval used
537 in the tests. The default value is 0.95.
540 The @cmd{MISSING} subcommand determines the handling of missing
542 If INCLUDE is set, then user-missing values are included in the
543 calculations, but system-missing values are not.
544 If EXCLUDE is set, which is the default, user-missing
545 values are excluded as well as system-missing values.
548 If LISTWISE is set, then the entire case is excluded from analysis
549 whenever any variable specified in the @cmd{/VARIABLES}, @cmd{/PAIRS} or
550 @cmd{/GROUPS} subcommands contains a missing value.
551 If ANALYSIS is set, then missing values are excluded only in the analysis for
552 which they would be needed. This is the default.
556 * One Sample Mode:: Testing against a hypothesised mean
557 * Independent Samples Mode:: Testing two independent groups for equal mean
558 * Paired Samples Mode:: Testing two interdependent groups for equal mean
561 @node One Sample Mode, Independent Samples Mode, T-TEST, T-TEST
562 @subsection One Sample Mode
564 The @cmd{TESTVAL} subcommand invokes the One Sample mode.
565 This mode is used to test a population mean against a hypothesised
567 The value given to the @cmd{TESTVAL} subcommand is the value against
568 which you wish to test.
569 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
570 tell PSPP which variables you wish to test.
572 @node Independent Samples Mode, Paired Samples Mode, One Sample Mode, T-TEST
573 @comment node-name, next, previous, up
574 @subsection Independent Samples Mode
576 The @cmd{GROUPS} subcommand invokes Independent Samples mode or
578 This mode is used to test whether two groups of values have the
579 same population mean.
580 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
581 tell PSPP the dependent variables you wish to test.
583 The variable given in the @cmd{GROUPS} subcommand is the independent
584 variable which determines to which group the samples belong.
585 The values in parentheses are the specific values of the independent
586 variable for each group.
587 If the parentheses are omitted and no values are given, the default values
588 of 1.0 and 2.0 are assumed.
590 If the independent variable is numeric,
591 it is acceptable to specify only one value inside the parentheses.
592 If you do this, cases where the independent variable is
593 less than or equal to this value belong to the first group, and cases
594 greater than this value belong to the second group.
595 When using this form of the @cmd{GROUPS} subcommand, missing values in
596 the independent variable are excluded on a listwise basis, regardless
597 of whether @cmd{/MISSING=LISTWISE} was specified.
600 @node Paired Samples Mode, , Independent Samples Mode, T-TEST
601 @comment node-name, next, previous, up
602 @subsection Paired Samples Mode
604 The @cmd{PAIRS} subcommand introduces Paired Samples mode.
605 Use this mode when repeated measures have been taken from the same
607 If the the @code{WITH} keyword is omitted, then tables for all
608 combinations of variables given in the @cmd{PAIRS} subcommand are
610 If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
611 is also given, then the number of variables preceding @code{WITH}
612 must be the same as the number following it.
613 In this case, tables for each respective pair of variables are
615 In the event that the @code{WITH} keyword is given, but the
616 @code{(PAIRED)} keyword is omitted, then tables for each combination
617 of variable preceding @code{WITH} against variable following
618 @code{WITH} are generated.
621 @node ONEWAY, RANK, T-TEST, Statistics
622 @comment node-name, next, previous, up
626 @cindex analysis of variance
631 [/VARIABLES = ] var_list BY var
632 /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
633 /CONTRASTS= value1 [, value2] ... [,valueN]
634 /STATISTICS=@{DESCRIPTIVES,HOMOGENEITY@}
638 The @cmd{ONEWAY} procedure performs a one-way analysis of variance of
639 variables factored by a single independent variable.
640 It is used to compare the means of a population
641 divided into more than two groups.
643 The variables to be analysed should be given in the @code{VARIABLES}
645 The list of variables must be followed by the @code{BY} keyword and
646 the name of the independent (or factor) variable.
648 You can use the @code{STATISTICS} subcommand to tell PSPP to display
649 ancilliary information. The options accepted are:
652 Displays descriptive statistics about the groups factored by the independent
655 Displays the Levene test of Homogeneity of Variance for the
656 variables and their groups.
659 The @code{CONTRASTS} subcommand is used when you anticipate certain
660 differences between the groups.
661 The subcommand must be followed by a list of numerals which are the
662 coefficients of the groups to be tested.
663 The number of coefficients must correspond to the number of distinct
664 groups (or values of the independent variable).
665 If the total sum of the coefficients are not zero, then PSPP will
666 display a warning, but will proceed with the analysis.
667 The @code{CONTRASTS} subcommand may be given up to 10 times in order
668 to specify different contrast tests.
671 @node RANK, REGRESSION, ONEWAY, Statistics
672 @comment node-name, next, previous, up
678 [VARIABLES=] var_list [@{A,D@}] [BY var_list]
679 /TIES=@{MEAN,LOW,HIGH,CONDENSE@}
680 /FRACTION=@{BLOM,TUKEY,VW,RANKIT@}
682 /MISSING=@{EXCLUDE,INCLUDE@}
684 /RANK [INTO var_list]
685 /NTILES(k) [INTO var_list]
686 /NORMAL [INTO var_list]
687 /PERCENT [INTO var_list]
688 /RFRACTION [INTO var_list]
689 /PROPORTION [INTO var_list]
691 /SAVAGE [INTO var_list]
694 The @cmd{RANK} command ranks variables and stores the results into new
697 The VARIABLES subcommand, which is mandatory, specifies one or
698 more variables whose values are to be ranked.
699 After each variable, @samp{A} or @samp{D} may appear, indicating that
700 the variable is to be ranked in ascending or descending order.
701 Ascending is the default.
702 If a BY keyword appears, it should be followed by a list of variables
703 which are to serve as group variables.
704 In this case, the cases are gathered into groups, and ranks calculated
707 The TIES subcommand specifies how tied values are to be treated. The
708 default is to take the mean value of all the tied cases.
710 The FRACTION subcommand specifies how proportional ranks are to be
711 calculated. This only has any effect if NORMAL or PROPORTIONAL rank
712 functions are requested.
714 The PRINT subcommand may be used to specify that a summary of the rank
715 variables created should appear in the output.
717 The function subcommands are RANK, NTILES, NORMAL, PERCENT, RFRACTION,
718 PROPORTION and SAVAGE. Any number of function subcommands may appear.
719 If none are given, then the default is RANK.
720 The NTILES subcommand must take an integer specifying the number of
721 partitions into which values should be ranked.
722 Each subcommand may be followed by the INTO keyword and a list of
723 variables which are the variables to be created and receive the rank
724 scores. There may be as many variables specified as there are
725 variables named on the VARIABLES subcommand. If fewer are specified,
726 then the variable names are automatically created.
728 The MISSING subcommand determines how user missing values are to be
729 treated. A setting of EXCLUDE means that variables whose values are
730 user-missing are to be excluded from the rank scores. A setting of
731 INCLUDE means they are to be included. The default is EXCLUDE.
733 @include regression.texi