work on value labels
[pspp] / doc / invoking.texi
1 @c PSPP - a program for statistical analysis.
2 @c Copyright (C) 2017, 2020 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 Invoking PSPP
11 @chapter Invoking @command{pspp}
12 @cindex invocation
13 @cindex @pspp{}, invoking
14
15 @pspp{} has two separate user interfaces.  This chapter describes
16 @command{pspp}, @pspp{}'s command-line driven text-based user interface.
17 The following chapter briefly describes PSPPIRE, the graphical user
18 interface to @pspp{}.
19
20 The sections below describe the @command{pspp} program's command-line
21 interface.
22
23 @menu
24 * Main Options::
25 * PDF PostScript SVG and PNG Output Options::
26 * Plain Text Output Options::
27 * SPV Output Options::
28 * TeX Output Options::
29 * HTML Output Options::
30 * OpenDocument Output Options::
31 * Comma-Separated Value Output Options::
32 @end menu
33
34 @node Main Options
35 @section Main Options
36
37 Here is a summary of all the options, grouped by type, followed by
38 explanations in the same order.
39
40 In the table, arguments to long options also apply to any
41 corresponding short options.
42
43 @table @emph
44 @item Non-option arguments
45 @example
46 @var{syntax-file}
47 @end example
48
49 @item Output options
50 @example
51 -o, --output=@var{output-file}
52 -O @var{option}=@var{value}
53 -O format=@var{format}
54 -O device=@{terminal|listing@}
55 --no-output
56 --table-look=@var{file}
57 -e, --error-file=@var{error-file}
58 @end example
59
60 @item Language options
61 @example
62 -I, --include=@var{dir}
63 -I-, --no-include
64 -b, --batch
65 -i, --interactive
66 -r, --no-statrc
67 -a, --algorithm=@{compatible|enhanced@}
68 -x, --syntax=@{compatible|enhanced@}
69 --syntax-encoding=@var{encoding}
70 @end example
71
72 @item Informational options
73 @example
74 -h, --help
75 -V, --version
76 @end example
77
78 @item Other options
79 @example
80 -s, --safer
81 --testing-mode
82 @end example
83 @end table
84
85 @table @asis
86 @item @var{syntax-file}
87 Read and execute the named syntax file.  If no syntax files are
88 specified, @pspp{} prompts for commands.  If any syntax files are
89 specified, @pspp{} by default exits after it runs them, but you may make
90 it prompt for commands by specifying @samp{-} as an additional syntax
91 file.
92
93 @item @option{-o @var{output-file}}
94 Write output to @var{output-file}.  @pspp{} has several different output
95 drivers that support output in various formats (use @option{--help} to
96 list the available formats).  Specify this option more than once to
97 produce multiple output files, presumably in different formats.
98
99 Use @samp{-} as @var{output-file} to write output to standard output.
100
101 If no @option{-o} option is used, then @pspp{} writes text and CSV
102 output to standard output and other kinds of output to whose name is
103 based on the format, @i{e.g.}@: @file{pspp.pdf} for PDF output.
104
105 @item @option{-O @var{option}=@var{value}}
106 Sets an option for the output file configured by a preceding
107 @option{-o}.  Most options are specific to particular output formats.
108 A few options that apply generically are listed below.
109
110 @item @option{-O format=@var{format}}
111 @pspp{} uses the extension of the file name given on @option{-o} to
112 select an output format.  Use this option to override this choice by
113 specifying an alternate format, @i{e.g.}@: @option{-o pspp.out -O format=html} to
114 write HTML to a file named @file{pspp.out}.  Use @option{--help} to
115 list the available formats.
116
117 @item @option{-O device=@{terminal|listing@}}
118 Sets whether @pspp{} considers the output device configured by the
119 preceding @option{-o} to be a terminal or a listing device.  This
120 affects what output will be sent to the device, as configured by the
121 SET command's output routing subcommands (@pxref{SET}).  By default,
122 output written to standard output is considered a terminal device and
123 other output is considered a listing device.
124
125 @item @option{--no-output}
126 Disables output entirely, if neither @option{-o} nor @option{-O} is
127 also used.  If one of those options is used, @option{--no-output} has
128 no effect.
129
130 @item @option{--table-look=@var{file}}
131 Reads a table style from @var{file} and applies it to all @pspp{}
132 table output.  The file should be a TableLook @file{.stt} or
133 @file{.tlo} file.  @pspp{} searches for @var{file} in the current
134 directory, then in @file{.pspp/looks} in the user's home directory,
135 then in a @file{looks} subdirectory inside @pspp{}'s data directory
136 (usually @file{/usr/local/share/pspp}).  If @pspp{} cannot find
137 @var{file} under the given name, it also tries adding a @file{.stt}
138 extension.
139
140 When this option is not specified, @pspp{} looks for
141 @file{default.stt} using the algorithm above, and otherwise it falls
142 back to a default built-in style.
143
144 Using @code{SET TLOOK} in @pspp{} syntax overrides the style set on
145 the command line (@pxref{SET}).
146
147 @item @option{-e @var{error-file}}
148 @itemx @option{--error-file=@var{error-file}}
149 Configures a file to receive @pspp{} error, warning, and note messages in
150 plain text format.  Use @samp{-} as @var{error-file} to write messages
151 to standard output.  The default error file is standard output in the
152 absence of these options, but this is suppressed if an output device
153 writes to standard output (or another terminal), to avoid printing
154 every message twice.  Use @samp{none} as @var{error-file} to
155 explicitly suppress the default.
156
157 @item @option{-I @var{dir}}
158 @itemx @option{--include=@var{dir}}
159 Appends @var{dir} to the set of directories searched by the @cmd{INCLUDE}
160 (@pxref{INCLUDE}) and @cmd{INSERT} (@pxref{INSERT}) commands.
161
162 @item @option{-I-}
163 @itemx @option{--no-include}
164 Clears all directories from the include path, including directories
165 inserted in the include path by default.  The default include path is
166 @file{.} (the current directory), followed by @file{.pspp} in the
167 user's home directory, followed by @pspp{}'s system configuration
168 directory (usually @file{/etc/pspp} or @file{/usr/local/etc/pspp}).
169
170 @item @option{-b}
171 @item @option{--batch}
172 @item @option{-i}
173 @itemx @option{--interactive}
174 These options forces syntax files to be interpreted in batch mode or
175 interactive mode, respectively, rather than the default ``auto'' mode.
176 @xref{Syntax Variants}, for a description of the differences.
177
178 @item @option{-r}
179 @itemx @option{--no-statrc}
180 By default, at startup @pspp{} searches for a file named @file{rc} in
181 the include path (described above) and, if it finds one, runs the
182 commands in it.  This option disables this behavior.
183
184 @item @option{-a @{enhanced|compatible@}}
185 @itemx @option{--algorithm=@{enhanced|compatible@}}
186 With @code{enhanced}, the default, @pspp{} uses the best implemented
187 algorithms for statistical procedures.  With @code{compatible},
188 however, @pspp{} will in some cases use inferior algorithms to produce
189 the same results as the proprietary program SPSS.
190
191 Some commands have subcommands that override this setting on a per
192 command basis.
193
194 @item @option{-x @{enhanced|compatible@}}
195 @itemx @option{--syntax=@{enhanced|compatible@}}
196 With @code{enhanced}, the default, @pspp{} accepts its own extensions
197 beyond those compatible with the proprietary program SPSS.  With
198 @code{compatible}, @pspp{} rejects syntax that uses these extensions.
199
200 @item @option{--syntax-encoding=@var{encoding}}
201 Specifies @var{encoding} as the encoding for syntax files named on the
202 command line.  The @var{encoding} also becomes the default encoding
203 for other syntax files read during the @pspp{} session by the
204 @cmd{INCLUDE} and @cmd{INSERT} commands.  @xref{INSERT}, for the
205 accepted forms of @var{encoding}.
206
207 @item @option{--help}
208 Prints a message describing @pspp{} command-line syntax and the available
209 device formats, then exits.
210
211 @item @option{-V}
212 @itemx @option{--version}
213 Prints a brief message listing @pspp{}'s version, warranties you don't
214 have, copying conditions and copyright, and e-mail address for bug
215 reports, then exits.
216
217 @item @option{-s}
218 @itemx @option{--safer}
219 Disables certain unsafe operations.  This includes the @subcmd{ERASE} and
220 @subcmd{HOST} commands, as well as use of pipes as input and output files.
221
222 @item @option{--testing-mode}
223 Invoke heuristics to assist with testing @pspp{}.  For use
224 by @command{make check} and similar scripts.
225 @end table
226
227 @node PDF PostScript SVG and PNG Output Options
228 @section PDF, PostScript, SVG, and PNG Output Options
229 @cindex PDF
230 @cindex Postscript
231 @cindex SVG
232 @cindex PNG
233
234 To produce output in PDF, PostScript, SVG, or PNG format, specify
235 @option{-o @var{file}} on the @pspp{} command line, optionally
236 followed by any of the options shown in the table below to customize
237 the output format.
238
239 PDF, PostScript, and SVG use real units: each dimension among the
240 options listed below may have a suffix @samp{mm} for millimeters,
241 @samp{in} for inches, or @samp{pt} for points.  Lacking a suffix,
242 numbers below 50 are assumed to be in inches and those above 50 are
243 assumed to be in millimeters.
244
245 PNG files are pixel-based, so dimensions in PNG output must ultimately
246 be measured in pixels.  For output to these files, PSPP translates the
247 specified dimensions to pixels at 72 pixels per inch.  For PNG output
248 only, fonts are by default rendered larger than this, at 96 pixels per
249 inch.
250
251 An SVG or PNG file can only hold a single page.  When PSPP outputs
252 more than one page to SVG or PNG, it creates multiple files.  It
253 outputs the second page to a file named with a @code{-2} suffix, the
254 third with a @code{-3} suffix, and so on.
255
256 @table @asis
257 @item @option{-O format=@{pdf|ps|svg|png@}}
258 Specify the output format.  This is only necessary if the file name
259 given on @option{-o} does not end in @file{.pdf}, @file{.ps},
260 @file{.svg}, or @file{.png}.
261
262 @item @option{-O paper-size=@var{paper-size}}
263 Paper size, as a name (@i{e.g.}@: @code{a4}, @code{letter}) or
264 measurements (@i{e.g.}@: @code{210x297}, @code{8.5x11in}).
265
266 The default paper size is taken from the @env{PAPERSIZE} environment
267 variable or the file indicated by the @env{PAPERCONF} environment
268 variable, if either variable is set.  If not, and your system supports
269 the @code{LC_PAPER} locale category, then the default paper size is
270 taken from the locale.  Otherwise, if @file{/etc/papersize} exists,
271 the default paper size is read from it.  As a last resort, A4 paper is
272 assumed.
273
274 @item @option{-O foreground-color=@var{color}}
275 Sets @var{color} as the default color for lines and text.  Use a CSS
276 color format (e.g.@: @code{#@var{rr}@var{gg}@var{bb}}) or name (e.g.@:
277 @code{black}) as @var{color}.
278
279 @item @option{-O orientation=@var{orientation}}
280 Either @code{portrait} or @code{landscape}.  Default: @code{portrait}.
281
282 @item @option{-O left-margin=@var{dimension}}
283 @itemx @option{-O right-margin=@var{dimension}}
284 @itemx @option{-O top-margin=@var{dimension}}
285 @itemx @option{-O bottom-margin=@var{dimension}}
286 Sets the margins around the page.  See
287 below for the allowed forms of @var{dimension}. Default: @code{0.5in}.
288
289 @item @option{-O object-spacing=@var{dimension}}
290 Sets the amount of vertical space between objects (such as headings or
291 tables).
292
293 @item @option{-O prop-font=@var{font-name}}
294 Sets the default font used for ordinary text.  Most systems support
295 CSS-like font names such as ``Sans Serif'', but a wide range of
296 system-specific fonts are likely to be supported as well.
297
298 Default: proportional font @code{Sans Serif}.
299
300 @item @option{-O font-size=@var{font-size}}
301 Sets the size of the default fonts, in thousandths of a point.  Default:
302 10000 (10 point).
303
304 @item @option{-O trim=true}
305 This option makes PSPP trim empty space around each page of output,
306 before adding the margins.  This can make the output easier to include
307 in other documents.
308
309 @item @option{-O outline=@var{boolean}}
310 For PDF output only, this option controls whether PSPP includes an
311 outline in the output file.  PDF viewers usually display the outline
312 as a side bar that allows for easy navigation of the file.
313 The default is true unless @option{-O trim=true} is also specified.
314 (The Cairo graphics library that PSPP uses to produce PDF output has a
315 bug that can cause a crash when outlines and trimming are used
316 together.)
317
318 @item @option{-O font-resolution=@var{dpi}}
319 Sets the resolution for font rendering, in dots per inch.  For PDF,
320 PostScript, and SVG output, the default is 72 dpi, so that a 10-point
321 font is rendered with a height of 10 points.  For PNG output, the
322 default is 96 dpi, so that a 10-point font is rendered with a height
323 of @math{10 / 72 * 96 = 13.3} pixels.  Use a larger @var{dpi} to
324 enlarge text output, or a smaller @var{dpi} to shrink it.
325 @end table
326
327 @node Plain Text Output Options
328 @section Plain Text Output Options
329
330 @pspp{} can produce plain text output, drawing boxes using ASCII or
331 Unicode line drawing characters.  To produce plain text output,
332 specify @option{-o @var{file}} on the @pspp{} command line, optionally
333 followed by options from the table below to customize the output
334 format.
335
336 Plain text output is encoded in UTF-8.
337
338 @table @asis
339 @item @option{-O format=txt}
340 Specify the output format.  This is only necessary if the file name
341 given on @option{-o} does not end in @file{.txt} or @file{.list}.
342
343 @item @option{-O charts=@{@var{template}.png|none@}}
344 Name for chart files included in output.  The value should be a file
345 name that includes a single @samp{#} and ends in @file{png}.  When a
346 chart is output, the @samp{#} is replaced by the chart number.  The
347 default is the file name specified on @option{-o} with the extension
348 stripped off and replaced by @file{-#.png}.
349
350 Specify @code{none} to disable chart output.
351
352 @item @option{-O foreground-color=@var{color}}
353 @itemx @option{-O background-color=@var{color}}
354 Sets @var{color} as the color to be used for the background or foreground to
355 be used for charts.
356 Color should be given in the format @code{#@var{RRRR}@var{GGGG}@var{BBBB}},
357 where @var{RRRR}, @var{GGGG} and @var{BBBB} are 4 character hexadecimal
358 representations of the red, green and blue components respectively.
359 If charts are disabled, this option has no effect.
360
361 @item @option{-O width=@var{columns}}
362 Width of a page, in columns.  If unspecified or given as @code{auto},
363 the default is the width of the terminal, for interactive output, or
364 the WIDTH setting (@pxref{SET}), for output to a file.
365
366 @item @option{-O box=@{ascii|unicode@}}
367 Sets the characters used for lines in tables.
368 If set to
369 @code{ascii}, output uses use the characters @samp{-}, @samp{|}, and @samp{+} for single-width
370 lines and @samp{=} and @samp{#} for double-width lines.
371 If set to @code{unicode} then, output uses Unicode box drawing characters.
372 The default is @code{unicode} if the locale's character encoding is "UTF-8"
373 or @code{ascii} otherwise.
374
375 @item @option{-O emphasis=@{none|bold|underline@}}
376 How to emphasize text.  Bold and underline emphasis are achieved with
377 overstriking, which may not be supported by all the software to which
378 you might pass the output.  Default: @code{none}.
379 @end table
380
381 @node SPV Output Options
382 @section SPV Output Options
383
384 SPSS 16 and later write @file{.spv} files to represent the contents of
385 its output editor.  To produce output in @file{.spv} format, specify
386 @option{-o @var{file}} on the @pspp{} command line, optionally
387 followed by any of the options shown in the table below to customize
388 the output format.
389
390 @table @asis
391 @item @option{-O format=spv}
392 Specify the output format.  This is only necessary if the file name
393 given on @option{-o} does not end in @file{.spv}.
394
395 @item @option{-O paper-size=@var{paper-size}}
396 @itemx @option{-O left-margin=@var{dimension}}
397 @itemx @option{-O right-margin=@var{dimension}}
398 @itemx @option{-O top-margin=@var{dimension}}
399 @itemx @option{-O bottom-margin=@var{dimension}}
400 @itemx @option{-O object-spacing=@var{dimension}}
401 These have the same syntax and meaning as for PDF output.  @xref{PDF
402 PostScript SVG and PNG Output Options}, for details.
403 @end table
404
405 @node TeX Output Options
406 @section TeX Output Options
407 @cindex @TeX{}
408 @cindex tex
409
410 If you want to publish statistical results in professional or academic
411 journals, you will probably want to provide results in @TeX{} format.
412 To do this, specify @option{-o @var{file}} on the @pspp{} command line where
413 @var{file} is a file name ending in @file{.tex}, or you can specify
414 @option{-O format=tex}.
415
416 The resulting file can be directly processed using @TeX{} or you can manually
417 edit the file to add commentary text.
418 Alternatively, you can cut and paste desired sections to another @TeX{} file.
419
420 @node HTML Output Options
421 @section HTML Output Options
422 @cindex HTML
423 To produce output in HTML format, specify @option{-o @var{file}} on
424 the @pspp{} command line, optionally followed by any of the options shown
425 in the table below to customize the output format.
426
427 @table @asis
428 @item @option{-O format=html}
429 Specify the output format.  This is only necessary if the file name
430 given on @option{-o} does not end in @file{.html}.
431
432 @item @option{-O charts=@{@var{template}.png|none@}}
433 Sets the name used for chart files.  @xref{Plain Text Output Options},
434 for details.
435
436 @item @option{-O borders=@var{boolean}}
437 Decorate the tables with borders.  If set to false, the tables produced
438 will have no borders.  The default value is true.
439
440 @item @option{-O bare=@var{boolean}}
441 The HTML output driver ordinarily outputs a complete HTML document.
442 If set to true, the driver instead outputs only what would normally be
443 the contents of the @code{body} element.  The default value is false.
444
445 @item @option{-O css=@var{boolean}}
446 Use cascading style sheets.  Cascading style sheets give an improved appearance
447 and can be used to produce pages which fit a certain web site's style.
448 The default value is true.
449
450 @end table
451
452 @node OpenDocument Output Options
453 @section OpenDocument Output Options
454
455 To produce output as an OpenDocument text (ODT) document, specify
456 @option{-o @var{file}} on the @pspp{} command line.  If @var{file} does
457 not end in @file{.odt}, you must also specify @option{-O format=odt}.
458
459 ODT support is only available if your installation of @pspp{} was
460 compiled with the libxml2 library.
461
462 The OpenDocument output format does not have any configurable options.
463
464 @node Comma-Separated Value Output Options
465 @section Comma-Separated Value Output Options
466
467 To produce output in comma-separated value (CSV) format, specify
468 @option{-o @var{file}} on the @pspp{} command line, optionally followed
469 by any of the options shown in the table below to customize the output
470 format.
471
472 @table @asis
473 @item @option{-O format=csv}
474 Specify the output format.  This is only necessary if the file name
475 given on @option{-o} does not end in @file{.csv}.
476
477 @item @option{-O separator=@var{field-separator}}
478 Sets the character used to separate fields.  Default: a comma
479 (@samp{,}).
480
481 @item @option{-O quote=@var{qualifier}}
482 Sets @var{qualifier} as the character used to quote fields that
483 contain white space, the separator (or any of the characters in the
484 separator, if it contains more than one character), or the quote
485 character itself.  If @var{qualifier} is longer than one character,
486 only the first character is used; if @var{qualifier} is the empty
487 string, then fields are never quoted.
488
489 @item @option{-O titles=@var{boolean}}
490 Whether table titles (brief descriptions) should be printed.  Default:
491 @code{on}.
492
493 @item @option{-O captions=@var{boolean}}
494 Whether table captions (more extensive descriptions) should be
495 printed.  Default: on.
496 @end table
497
498 The CSV format used is an extension to that specified in RFC 4180:
499
500 @table @asis
501 @item Tables
502 Each table row is output on a separate line, and each column is output
503 as a field.  The contents of a cell that spans multiple rows or
504 columns is output only for the top-left row and column; the rest are
505 output as empty fields.
506
507 @item Titles
508 When a table has a title and titles are enabled, the title is output
509 just above the table as a single field prefixed by @samp{Table:}.
510
511 @item Captions
512 When a table has a caption and captions are enabled, the caption is
513 output just below the table as a single field prefixed by
514 @samp{Caption:}.
515
516 @item Footnotes
517 Within a table, footnote markers are output as bracketed letters
518 following the cell's contents, @i{e.g.}@tie{}@samp{[a]}, @samp{[b]},
519 @enddots{}  The footnotes themselves are output following the body of
520 the table, as a separate two-column table introduced with a line that
521 says @samp{Footnotes:}.  Each row in the table represent one footnote:
522 the first column is the marker, the second column is the text.
523
524 @item Text
525 Text in output is printed as a field on a line by itself.  The TITLE
526 and SUBTITLE produce similar output, prefixed by @samp{Title:} or
527 @samp{Subtitle:}, respectively.
528
529 @item Messages
530 Errors, warnings, and notes are printed the same way as text.
531
532 @item Charts
533 Charts are not included in CSV output.
534 @end table
535
536 Successive output items are separated by a blank line.
537
538 @node Invoking PSPPIRE
539 @chapter Invoking @command{psppire}
540 @section The graphic user interface
541 @cindex Graphic user interface
542 @cindex PSPPIRE
543
544 The PSPPIRE graphic user interface for @pspp{} can perform all
545 functionality of the command line interface.  In addition it gives an
546 instantaneous view of the data, variables and statistical output.
547
548 The graphic user interface can be started by typing @command{psppire} at a
549 command prompt.
550 Alternatively many systems have a system of interactive menus or buttons
551 from which @command{psppire} can be started by a series of mouse clicks.
552
553 Once the principles of the @pspp{} system are understood,
554 the graphic user interface is designed to be largely intuitive, and
555 for this reason is covered only very briefly by this manual.