Spss Base Users Guide 120
Spss Base Users Guide 120
Spss Base Users Guide 120
SPSS 12.0
SPSS 12.0 is a comprehensive system for analyzing data. SPSS can take data from
almost any type of file and use them to generate tabulated reports, charts and plots of
distributions and trends, descriptive statistics, and complex statistical analyses.
This manual, the SPSS Base 12.0 User's Guide, documents the graphical user
interface of SPSS for Windows. Complete information about using interactive
graphics can be found in SPSS Interactive Graphics 10.0, which is compatible with
release 12.0 of SPSS. Examples using the statistical procedures found in SPSS
Base12.0 are provided in the Help system, installed with the software. Algorithms
used in the statistical procedures are available on the product CD-ROM.
In addition, beneath the menus and dialog boxes, SPSS uses a command language.
Some extended features of the system can be accessed only via command syntax.
(Those features are not available in the Student Version.) Complete command
syntax is documented in the SPSS 12.0 Command Syntax Reference, provided on
the product CD-ROM.
iii
SPSS Options
The following options are available as add-on enhancements to the full (not Student
Version) SPSS Base system:
SPSS Regression Models™ provides techniques for analyzing data that do not fit
traditional linear statistical models. It includes procedures for probit analysis, logistic
regression, weight estimation, two-stage least-squares regression, and general
nonlinear regression.
SPSS Advanced Models™ focuses on techniques often used in sophisticated
experimental and biomedical research. It includes procedures for general linear
models (GLM), linear mixed models, variance components analysis, loglinear
analysis, ordinal regression, actuarial life tables, Kaplan-Meier survival analysis,
and basic and extended Cox regression.
SPSS Tables™ creates a variety of presentation-quality tabular reports, including
complex stub-and-banner tables and displays of multiple response data.
SPSS Trends™ performs comprehensive forecasting and time series analyses with
multiple curve-fitting models, smoothing models, and methods for estimating
autoregressive functions.
SPSS Categories® performs optimal scaling procedures, including correspondence
analysis.
SPSS Conjoint™ performs conjoint analysis.
SPSS CHAID™ simplifies tabular analysis of categorical data, develops predictive
models, screens out extraneous predictor variables, and produces easy-to-read tree
diagrams that segment a population into subgroups that share similar characteristics.
SPSS Exact Tests™ calculates exact p values for statistical tests when small or very
unevenly distributed samples could make the usual tests inaccurate.
SPSS Missing Value Analysis™ describes patterns of missing data, estimates means
and other statistics, and imputes values for missing observations.
SPSS Maps™ turns your geographically distributed data into high-quality maps with
symbols, colors, bar charts, pie charts, and combinations of themes to present not
only what is happening but where it is happening.
iv
SPSS Complex Samples™ allows survey, market, health and public opinion
researchers, as well as social scientists who use sample survey methodology, to
incorporate their complex sample designs into data analysis.
The SPSS family of products also includes applications for data entry, text analysis,
classification, neural networks, and flowcharting.
Compatibility
SPSS is designed to run on many computer systems. See the materials that came with
your system for specific information on minimum and recommended requirements.
Serial Numbers
Your serial number is your identification number with SPSS Inc. You will need
this serial number when you contact SPSS Inc. for information regarding support,
payment, or an upgraded system. The serial number was provided with your Base
system.
Customer Service
If you have any questions concerning your shipment or account, contact your local
office, listed on the SPSS Web site at http://www.spss.com/worldwide/. Please have
your serial number ready for identification.
Training Seminars
SPSS Inc. provides both public and onsite training seminars. All seminars feature
hands-on workshops. Seminars will be offered in major cities on a regular basis. For
more information on these seminars, contact your local office, listed on the SPSS
Web site at http://www.spss.com/worldwide/.
v
Technical Support
The services of SPSS Technical Support are available to registered customers.
Customers may contact Technical Support for assistance in using SPSS products
or for installation help for one of the supported hardware environments. To reach
Technical Support, see the SPSS Web site at http://www.spss.com, or contact your
local office, listed on the SPSS Web site at http://www.spss.com/worldwide/. Be
prepared to identify yourself, your organization, and the serial number of your system.
Additional Publications
Individuals worldwide can order additional product manuals directly from SPSS
Inc. For telephone orders in the United States and Canada, call SPSS Inc. at
800-543-2185. For telephone orders outside of North America, contact your local
office, listed on the SPSS Web site at http://www.spss.com/worldwide.
The SPSS 12.0 Statistical Procedures Companion, by Marija Norusis, is being
prepared for publication by Prentice Hall. It contains overviews of the procedures
in the SPSS Base, plus Logistic Regression, General Linear Models, and Linear
Mixed Models. Further information will be available on the SPSS Web site at
http://www.spss.com (click Store, select your country, click Books).
Contacting SPSS
If you would like to be on our mailing list, contact one of our offices, listed on
our Web site at http://www.spss.com/worldwide/. We will send you a copy of our
newsletter and let you know about SPSS Inc. activities in your area.
vi
Contents
1 Overview 1
What's New in SPSS 12.0? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Variable Names and Variable Labels in Dialog Box Lists . . . . . . . . . . . . . . . . 7
Dialog Box Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Subdialog Boxes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Selecting Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Getting Information about Variables in Dialog Boxes . . . . . . . . . . . . . . . . . . . 9
Getting Information about Dialog Box Controls . . . . . . . . . . . . . . . . . . . . . . 10
Basic Steps in Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Statistics Coach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Finding Out More about SPSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Getting Help 13
Using the Help Table of Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Using the Help Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Getting Help on Dialog Box Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Getting Help on Output Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Using Case Studies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Copying Help Text from a Pop-Up Window . . . . . . . . . . . . . . . . . . . . . . . . . 17
vii
3 Data Files 19
Opening a Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
To Open Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Data File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Opening File Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Reading Excel Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
How the Data Editor Reads Older Excel Files and Other Spreadsheets . . . . 22
How the Data Editor Reads dBASE Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Reading Database Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Selecting a Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Database Login. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Selecting Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Creating a Parameter Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Defining Variables (Database Wizard). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Text Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
File Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Saving Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
To Save Modified Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Saving Data Files in Excel Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Saving Data Files in SAS Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Saving Data Files in Other Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Saving Data: Data File Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Saving Subsets of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Saving File Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Protecting Original Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
viii
Virtual Active File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5 Data Editor 73
Data View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Variable View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Entering Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Editing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Go to Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Case Selection Status in the Data Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Data Editor Display Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Data Editor Printing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6 Data Preparation 95
Defining Variable Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Copying Data Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Identifying Duplicate Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Visual Bander . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Banding Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Automatically Generating Banded Categories . . . . . . . . . . . . . . . . . . . . . . 121
Copying Banded Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
User-Missing Values in the Visual Bander. . . . . . . . . . . . . . . . . . . . . . . . . 125
ix
7 Data Transformations 127
Computing Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Missing Values in Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Random Number Seed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Count Occurrences of Values within Cases . . . . . . . . . . . . . . . . . . . . . . . . 132
Recoding Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Recode into Same Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Recode into Different Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Rank Cases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Automatic Recode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Time Series Data Transformations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
x
Add Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Add Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Aggregate Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Split File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Select Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Weight Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Restructuring Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
xi
Controlling Draft Output Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Fonts in Draft Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
To Print Draft Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
To Save Draft Viewer Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
xii
To Change Cell Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Cell Properties: Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
To Change Value Formats in a Cell. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
To Change Value Formats for a Column . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Cell Properties: Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
To Change Alignment in Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Cell Properties: Margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
To Change Margins in Cells. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Cell Properties: Shading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
To Change Shading in Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Footnote Marker. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Selecting Rows and Columns in Pivot Tables. . . . . . . . . . . . . . . . . . . . . . . 268
To Select a Row or Column in a Pivot Table . . . . . . . . . . . . . . . . . . . . . . . . 269
Modifying Pivot Table Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Printing Pivot Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
To Print Hidden Layers of a Pivot Table . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Controlling Table Breaks for Wide and Long Tables . . . . . . . . . . . . . . . . . . 271
xiii
13 Frequencies 283
Frequencies Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
To Obtain Frequency Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
14 Descriptives 291
Descriptives Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
To Obtain Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
15 Explore 297
Explore Data Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
To Explore Your Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
16 Crosstabs 305
Crosstabs Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
xiv
To Obtain Crosstabulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
17 Summarize 315
Summarize Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
To Obtain Case Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
18 Means 323
Means Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
To Obtain Subgroup Means. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
20 T Tests 337
Independent-Samples T Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Independent-Samples T Test Data Considerations . . . . . . . . . . . . . . . . . . 338
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
To Obtain an Independent-Samples T Test . . . . . . . . . . . . . . . . . . . . . . . . 339
Paired-Samples T Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
xv
Paired-Samples T Test Data Considerations . . . . . . . . . . . . . . . . . . . . . . . 342
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
To Obtain a Paired-Samples T Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
One-Sample T Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
One-Sample T Test Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
To Obtain a One-Sample T Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
xvi
To Obtain Bivariate Correlations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
25 Distances 387
To Obtain Distance Matrices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Distances Dissimilarity Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Distances Similarity Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
xvii
27 Curve Estimation 407
Curve Estimation Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
To Obtain a Curve Estimation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
xviii
30 Choosing a Procedure for Clustering 437
xix
34 Nonparametric Tests 465
Chi-Square Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Chi-Square Test Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
To Obtain a Chi-Square Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Binomial Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Binomial Test Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
To Obtain a Binomial Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Runs Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Runs Test Data Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
To Obtain a Runs Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
One-Sample Kolmogorov-Smirnov Test . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
One-Sample Kolmogorov-Smirnov Test Data Considerations . . . . . . . . . . . 478
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
To Obtain a One-Sample Kolmogorov-Smirnov Test . . . . . . . . . . . . . . . . . . 479
Two-Independent-Samples Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Two-Independent-Samples Tests Data Considerations . . . . . . . . . . . . . . . 482
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
To Obtain Two-Independent-Samples Tests. . . . . . . . . . . . . . . . . . . . . . . . 483
Two-Related-Samples Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Two-Related-Samples Tests Data Considerations . . . . . . . . . . . . . . . . . . . 487
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
To Obtain Two-Related-Samples Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Tests for Several Independent Samples . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Tests for Several Independent Samples Data Considerations . . . . . . . . . . 491
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
xx
To Obtain Tests for Several Independent Samples . . . . . . . . . . . . . . . . . . . 492
Tests for Several Related Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Tests for Several Related Samples Data Considerations . . . . . . . . . . . . . . 495
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
To Obtain Tests for Several Related Samples. . . . . . . . . . . . . . . . . . . . . . . 496
xxi
Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
To Obtain a Reliability Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
RELIABILITY Command Additional Features . . . . . . . . . . . . . . . . . . . . . . . 532
xxii
40 Overview of the Chart Facility 545
Creating and Modifying a Chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Chart Definition Global Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
42 Utilities 561
Variable Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Data File Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Variable Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Define Variable Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Use Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
Reordering Target Variable Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
43 Options 567
General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
Viewer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
Draft Viewer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
xxiii
Output Label Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Chart Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Interactive Chart Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Pivot Table Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Data Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
Currency Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
Script Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
xxiv
46 SPSS Scripting Facility 609
To Run a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Scripts Included with SPSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
Autoscripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Creating and Editing Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
To Edit a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
Script Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Starter Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Creating Autoscripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
How Scripts Work. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Table of Object Classes and Naming Conventions . . . . . . . . . . . . . . . . . . . 624
New Procedure (Scripting) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Adding a Description to a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
xxv
Scripting Custom Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
Debugging Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
Script Files and Syntax Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Appendices
Index 655
xxvi
Chapter
1
Overview
SPSS for Windows provides a powerful statistical analysis and data management
system in a graphical environment, using descriptive menus and simple dialog boxes
to do most of the work for you. Most tasks can be accomplished simply by pointing
and clicking the mouse.
In addition to the simple point-and-click interface for statistical analysis, SPSS for
Windows provides:
Data Editor. A versatile spreadsheet-like system for defining, entering, editing, and
displaying data.
Viewer. The Viewer makes it easy to browse your results, selectively show and hide
output, change the display order results, and move presentation-quality tables and
charts between SPSS and other applications.
Multidimensional pivot tables. Your results come alive with multidimensional pivot
tables. Explore your tables by rearranging rows, columns, and layers. Uncover
important findings that can get lost in standard reports. Compare groups easily by
splitting your table so that only one group is displayed at a time.
High-resolution graphics. High-resolution, full-color pie charts, bar charts, histograms,
scatterplots, 3-D graphics, and more are included as standard features in SPSS.
Database access. Retrieve information from databases by using the Database Wizard
instead of complicated SQL queries.
Data transformations. Transformation features help get your data ready for analysis.
You can easily subset data, combine categories, add, aggregate, merge, split, and
transpose files, and more.
Electronic distribution. Send e-mail reports to others with the click of a button, or
export tables and charts in HTML format for Internet and intranet distribution.
1
2
Chapter 1
Overview
Duplicate record finder. Identify, flag, report, and filter duplicate records with the
new Identify Duplicate Cases feature. For more information, see “Identifying
Duplicate Cases” in Chapter 6 on page 113.
Output management system. Turn output into input with the new OMS command.
With OMS, you can automatically write selected categories of output to different
output files in different formats, including HTML, XML, text, and SPSS-format
data files. For more information, see “Output Management System” in Chapter
47 on page 643.
Command syntax to delete variables. The new DELETE VARIABLES command
makes it easy to delete variables you do not need anymore, such as temporary
variables used in transformations.
Statistical Enhancements
New options for handling weighted data in the Crosstabs procedure. For more
information, see “Crosstabs Cell Display” in Chapter 16 on page 313.
New stepwise function in Multinomial Logisitic Regression (NOMREG command,
Regression Models option).
This new add-on module provides the specialized planning tools and statistics that
you need when working with sample survey data. Most conventional statistical
software assumes your data arise from simple random sampling. In most large-scale
surveys, however, simple random sampling generally is not feasible or cost effective.
Using SPSS Complex Samples with sample survey data reduces the risk of reaching
incorrect or misleading inferences. The new SPSS Complex Samples add-on
module enables you to make more statistically valid inferences for a population by
incorporating the sample design into survey analysis. It is an indispensable statistical
tool for survey and market researchers, public opinion researchers or social scientists,
and it enables you to reach more accurate conclusions when working with sample
survey methodology.
Windows
There are a number of different types of windows in SPSS:
4
Chapter 1
Data Editor. This window displays the contents of the data file. You can create new
data files or modify existing ones with the Data Editor. The Data Editor window
opens automatically when you start an SPSS session. You can have only one data
file open at a time.
Viewer. All statistical results, tables, and charts are displayed in the Viewer. You can
edit the output and save it for later use. A Viewer window opens automatically the
first time you run a procedure that generates output.
Draft Viewer. You can display output as simple text (instead of interactive pivot tables)
in the Draft Viewer.
Pivot Table Editor. Output displayed in pivot tables can be modified in many ways with
the Pivot Table Editor. You can edit text, swap data in rows and columns, add color,
create multidimensional tables, and selectively hide and show results.
Chart Editor. You can modify high-resolution charts and plots in chart windows. You
can change the colors, select different type fonts or sizes, switch the horizontal and
vertical axes, rotate 3-D scatterplots, and even change the chart type.
Text Output Editor. Text output not displayed in pivot tables can be modified with the
Text Output Editor. You can edit the output and change font characteristics (type,
style, color, size).
Syntax Editor. You can paste your dialog box choices into a syntax window, where
your selections appear in the form of command syntax. You can then edit the
command syntax to use special features of SPSS not available through dialog boxes.
You can save these commands in a file for use in subsequent SPSS sessions.
Script Editor. Scripting and OLE automation allow you to customize and automate
many tasks in SPSS. Use the Script Editor to create and modify basic scripts.
5
Overview
Figure 1-1
Data Editor and Viewer
Chapter 1
E Make the window that you want to designate the active window (click anywhere
in the window).
E Click the Designate Window tool on the toolbar (the one with the exclamation point).
or
Menus
Many of the tasks that you want to perform with SPSS start with menu selections.
Each window in SPSS has its own menu bar with menu selections appropriate for
that window type.
The Analyze and Graphs menus are available on all windows, making it easy to
generate new output without having to switch windows.
Status Bar
The status bar at the bottom of each SPSS window provides the following information:
Command status. For each procedure or command that you run, a case counter
indicates the number of cases processed so far. For statistical procedures that require
iterative processing, the number of iterations is displayed.
Filter status. If you have selected a random sample or a subset of cases for analysis,
the message Filter on indicates that some type of case filtering is currently in effect
and not all cases in the data file are included in the analysis.
7
Overview
Weight status. The message Weight on indicates that a weight variable is being used
to weight cases for analysis.
Split File status. The message Split File on indicates that the data file has been split into
separate groups for analysis, based on the values of one or more grouping variables.
Dialog Boxes
Most menu selections open dialog boxes. You use dialog boxes to select variables
and options for analysis.
Dialog boxes for statistical procedures and charts typically have two basic
components:
Source variable list. A list of variables in the working data file. Only variable types
allowed by the selected procedure are displayed in the source list. Use of short string
and long string variables is restricted in many procedures.
Target variable list(s). One or more lists indicating the variables that you have chosen
for the analysis, such as dependent and independent variable lists.
Chapter 1
For long labels, position the mouse pointer over the label in the list to view
the entire label.
If no variable label is defined, the variable name is displayed.
Figure 1-3
Variable labels displayed in a dialog box
Overview
Subdialog Boxes
Since most procedures provide a great deal of flexibility, not all of the possible
choices can be contained in a single dialog box. The main dialog box usually contains
the minimum information required to run a procedure. Additional specifications
are made in subdialog boxes.
In the main dialog box, controls with an ellipsis (...) after the name indicate that a
subdialog box will be displayed.
Selecting Variables
To select a single variable, you simply highlight it on the source variable list and
click the right arrow button next to the target variable list. If there is only one target
variable list, you can double-click individual variables to move them from the source
list to the target list.
Chapter 1
Figure 1-4
Variable information with right mouse button
Overview
Figure 1-5
Right mouse button “What's This?” pop-up Help for dialog box controls
Chapter 1
Statistics Coach
If you are unfamiliar with SPSS or with the statistical procedures available in SPSS,
the Statistics Coach can help you get started by prompting you with simple questions,
nontechnical language, and visual examples that help you select the basic statistical
and charting features that are best suited for your data.
To use the Statistics Coach, from the menus in any SPSS window choose:
Help
Statistics Coach
The Statistics Coach covers only a selected subset of procedures in the SPSS Base
system. It is designed to provide general assistance for many of the basic, commonly
used statistical techniques.
2
Getting Help
13
14
Chapter 2
Figure 2-1
Help window with Contents tab displayed
Getting Help
The Help index uses incremental search to find the text that you enter and selects
the closest match in the index.
Figure 2-2
Index tab and incremental search
Chapter 2
Figure 2-3
Dialog box control Help with right mouse button
Getting Help
Figure 2-4
Activated pivot table glossary Help with right mouse button
3
Data Files
Data files come in a wide variety of formats, and this software is designed to handle
many of them, including:
Spreadsheets created with Lotus 1-2-3 and Excel
Database files created with dBASE and various SQL formats
Tab-delimited and other types of ASCII text files
Data files in SPSS format created on other operating systems
SYSTAT data files
SAS data files
E In the Open File dialog box, select the file that you want to open.
E Click Open.
19
20
Chapter 3
Data Files
Chapter 3
Variable names. If you read the first row of the Excel file (or the first row of the
specified range) as variable names, values that don't conform to variable naming rules
are converted to valid variable names, and the original names are used as variable
labels. If you do not read variable names from the Excel file, default variable names
are assigned.
How the Data Editor Reads Older Excel Files and Other
Spreadsheets
The following rules apply to reading Excel files prior to version 5 and other
spreadsheet data:
Data type and width. The data type and width for each variable are determined by the
column width and data type of the first data cell in the column. Values of other types
are converted to the system-missing value. If the first data cell in the column is blank,
the global default data type for the spreadsheet (usually numeric) is used.
Blank cells. For numeric variables, blank cells are converted to the system-missing
value, indicated by a period. For string variables, a blank is a valid string value, and
blank cells are treated as valid string values.
Variable names. If you do not read variable names from the spreadsheet, the column
letters (A, B, C, ...) are used for variable names for Excel and Lotus files. For SYLK
files and Excel files saved in R1C1 display format, the software uses the column
number preceded by the letter C for variable names (C1, C2, C3, ...).
Data Files
E Depending on the data source, you may need to select the database file and/or enter a
login name, password, and other information.
Chapter 3
E Depending on the database file, you may need to enter a login name and password.
E If the query has an embedded prompt, you may need to enter other information (for
example, the quarter for which you want to retrieve sales figures).
Data Files
Data sources. A data source consists of two essential pieces of information: the driver
that will be used to access the data and the location of the database that you want to
access. To specify data sources, you must have the appropriate drivers installed. For
local analysis mode, you can install drivers from the CD-ROM for this product:
SPSS Data Access Pack. Installs drivers for a variety of database formats.
Available on the AutoPlay menu.
Microsoft Data Access Pack. Installs drivers for Microsoft products, including
Microsoft Access. To install the Microsoft Data Access Pack, double-click
Microsoft Data Access Pack in the Microsoft Data Access Pack folder on the
CD-ROM.
Figure 3-1
Database Wizard dialog box
26
Chapter 3
Example. Let's say you have a Microsoft Access 7.0 database that contains data about
your employees and about the regions in which they work, and you want to import
that data. Select the MS Access 7.0 Database icon, and click Next to proceed. You will
see the Select Database dialog box. Specify the path to your database and click OK.
Database Login
If your database requires a password, the Database Wizard will prompt you for
one before it can open the data source.
Figure 3-2
Login dialog box
Data Files
Figure 3-3
Select Data dialog box
Displaying field names. To list the fields in a table, click the plus sign (+) to the left of
a table name. To hide the fields, click the minus sign (–) to the left of a table name.
To add a field. Double-click any field in the Available Tables list, or drag it to the
Retrieve Fields in This Order list. Fields can be reordered by dragging and dropping
them within the selected fields list.
To remove a field. Double-click any field in the Retrieve Fields in This Order list,
or drag it to the Available Tables list.
Sort field names. If selected, the Database Wizard will display your available fields
in alphabetical order.
Example. Assume that you want to import from a database with two tables, Employees
and Regions. The Employees table contains information about your company's
employees, including the region they work in, their job category, and their annual
28
Chapter 3
sales. Employees are each assigned a region code (REGION), while those who do
not have a home region get the special code of 0. The Regions table holds a large
amount of data about the areas in which your company operates and prospective
markets. It uses a region code (REGION) to identify the area and provides the average
per capita income for the area, among other things. To relate each employee's sales
to the average income in the region, you would select the following fields from the
Employees table: ID, REGION, and SALES. Then, select the following fields from
the Regions table: REGION and AVGINC. Click Next to proceed.
Data Files
Establishing relationships. To create a relationship, drag a field from any table onto the
field to which you want to join it. The Database Wizard will draw a join line between
the two fields, indicating their relationship. These fields must be of the same data type.
Auto Join Tables. Attempts to automatically join tables based on primary/foreign keys
or matching field names and data type.
Specifying join types. If outer joins are supported by your driver, you can specify
either inner joins, left outer joins, or right outer joins. To select the type of join,
click the join line between the fields, and the software will display the Relationship
Properties dialog box.
You can also use the icons in the upper right corner of the dialog box to choose
the type of join.
Relationship Properties
This dialog box allows you to specify which type of relationship joins your tables.
Figure 3-5
Relationship Properties dialog box
Inner joins. An inner join includes only rows where the related fields are equal.
Example. Continuing with our data, suppose that you want to import data only for
those employees who work in a fixed region and only for those regions in which your
company operates. In this case, you would use an inner join, which would exclude
traveling employees and would filter out information about prospective regions in
which you do not currently have a presence.
30
Chapter 3
Completing this would give you a data set that contains the variables ID, REGION,
SALES95, and AVGINC for each employee who worked in a fixed region.
Figure 3-6
Creating an inner join
Outer joins. A left outer join includes all records from the table on the left and only
those records from the table on the right in which the related fields are equal. In a
right outer join, this relationship is switched, so that the software imports all records
from the table on the right and only those records from the table on the left in which
the related fields are equal.
Example. If you wanted to import data only for those employees who worked in fixed
regions (a subset of the Employees table) but needed information about all of the
regions, a right outer join would be appropriate. This results in a data set that contains
the variables ID, REGION, SALES95, and AVGINC for each employee who worked
in a fixed region, plus data on the remaining regions in which your company does
not currently operate.
31
Data Files
Figure 3-7
Creating a right outer join
Chapter 3
Most criteria use one or more of the six relational operators (<, >, <=, >=,
=, and <>).
Expressions can include field names, constants, arithmetic operators, numeric
and other functions, and logical variables. You can use fields that you do not
plan to import as variables.
Figure 3-8
Limit Retrieved Cases dialog box
To build your criteria, you need at least two expressions and a relation to connect them.
E To build an expression, put your cursor in an Expression cell. You can type field
names, constants, arithmetic operators, numeric and other functions, and logical
variables. Other methods of putting a field into a criteria cell include double-clicking
the field in the Fields list, dragging the field from the Fields list, or selecting a field
from the drop-down menu that is available in any active Expression cell.
33
Data Files
E The two expressions are usually connected by a relational operator, such as = or >. To
choose the relation, put your cursor in the Relation cell and either type the operator
or select it from the drop-down menu.
To modify our earlier example to retrieve data only about employees who fit into
job categories 1 or 3, create two criteria in the criteria grid, and prefix the second
criteria with the connector OR.
Criteria 1: 'EmployeeSales'.'JOBCAT' = 1
Criteria 2: 'EmployeeSales'.'JOBCAT' = 3
Functions. A selection of built-in arithmetic, logical, string, date, and time SQL
functions are provided. You can select a function from the list and drag it into
the expression, or you can enter any valid SQL function. See your database
documentation for valid SQL functions.
Use Random Sampling. Selects a random sample of cases from the data source.
For large data sources, you may want to limit the number of cases to a small,
representative sample. This can significantly reduce the time that it takes to run
procedures. Native random sampling, if available for the data source, is faster than
SPSS random sampling, since SPSS random sampling must still read the entire
data source to extract a random sample.
Approximately. Generates a random sample of approximately the specified
percentage of cases. Since this routine makes an independent pseudo-random
decision for each case, the percentage of cases selected can only approximate
the specified percentage. The more cases there are in the data file, the closer the
percentage of cases selected is to the specified percentage.
Exactly. Selects a random sample of the specified number of cases from the
specified total number of cases. If the total number of cases specified exceeds
the total number of cases in the data file, the sample will contain proportionally
fewer cases than the requested number.
Prompt for Value. You can embed a prompt in your query to create a parameter query.
When users run the query, they will be asked to enter information specified here. You
might want to do this if you need to see different views of the same data. For example,
you may want to run the same query to see sales figures for different fiscal quarters.
Place your cursor in any Expression cell, and click Prompt for Value to create a prompt.
34
Chapter 3
To build a prompt, you need to enter a prompt string and a default value. The prompt
string is displayed each time a user runs your query. It should specify the kind of
information to enter, and, if the user is not selecting from a list, it should give hints
about how the input should be formatted. For example, “Enter a Quarter (Q1, Q2,
Q3, ...)”.
Allow user to select value from list. If this is selected, you can limit the user to the
values you place here, which are separated by carriage returns.
Data type. Specify the data type here, either number, string, or date.
35
Data Files
Chapter 3
Figure 3-11
Define Variables dialog box
Results
The Results dialog box displays the SQL Select statement for your query.
You can edit the SQL Select statement before you run the query, but if you
click the Back button to make changes in previous steps, the changes to the
Select statement will be lost.
You can save the query for future use with Save query to a file.
Select Paste it into the syntax editor for further modification to paste complete GET
DATA syntax into a syntax window. Copying and pasting the Select statement
from the Results window will not paste the necessary command syntax.
37
Data Files
Cache data locally. A data cache is complete copy of the data file, stored in temporary
disk space. Caching the data file can improve performance.
Figure 3-12
Results dialog box
Text Wizard
The Text Wizard can read text data files formatted in a variety of ways:
Tab-delimited files
Space-delimited files
Comma-delimited files
Fixed-field format files
For delimited files, you can also specify other characters as delimiters between
values, and you can specify multiple delimiters.
38
Chapter 3
E Follow the steps in the Text Wizard to define how to read the data file.
The text file is displayed in a preview window. You can apply a predefined format
(previously saved from the Text Wizard) or follow the steps in the Text Wizard
to specify how the data should be read.
39
Data Files
Chapter 3
values may appear to run together without even spaces separating them. The
column location determines which variable is being read.
Are variable names included at the top of your file? If the first row of the data file
contains descriptive labels for each variable, you can use these labels as variable
names. Values that don't conform to variable naming rules are converted to valid
variable names.
This step provides information about cases. A case is similar to a record in a database.
For example, each respondent to a questionnaire is a case.
41
Data Files
The first case of data begins on which line number? Indicates the first line of the data
file that contains data values. If the top line(s) of the data file contain descriptive
labels or other text that does not represent data values, this will not be line 1.
How are your cases represented? Controls how the Text Wizard determines where
each case ends and the next one begins.
Each line represents a case. Each line contains only one case. It is fairly common
for each case to be contained on a single line (row), even though this can be a
very long line for data files with a large number of variables. If not all lines
contain the same number of data values, the number of variables for each case is
determined by the line with the greatest number of data values. Cases with fewer
data values are assigned missing values for the additional variables.
A specific number of variables represents a case. The specified number of variables
for each case tells the Text Wizard where to stop reading one case and start
reading the next. Multiple cases can be contained on the same line, and cases can
start in the middle of one line and be continued on the next line. The Text Wizard
determines the end of each case based on the number of values read, regardless
of the number of lines. Each case must contain data values (or missing values
indicated by delimiters) for all variables, or the data file will be read incorrectly.
How many cases do you want to import? You can import all cases in the data file, the
first n cases (n is a number you specify), or a random sample of a specified percentage.
Since the random sampling routine makes an independent pseudo-random decision
for each case, the percentage of cases selected can only approximate the specified
percentage. The more cases there are in the data file, the closer the percentage of
cases selected is to the specified percentage.
42
Chapter 3
This step provides information about cases. A case is similar to a record in a database.
For example, each respondent to questionnaire is a case.
The first case of data begins on which line number? Indicates the first line of the data
file that contains data values. If the top line(s) of the data file contain descriptive
labels or other text that does not represent data values, this will not be line 1.
How many lines represent a case? Controls how the Text Wizard determines where
each case ends and the next one begins. Each variable is defined by its line number
within the case and its column location. You need to specify the number of lines
for each case to read the data correctly.
43
Data Files
How many cases do you want to import? You can import all cases in the data file, the
first n cases (n is a number you specify), or a random sample of a specified percentage.
Since the random sampling routine makes an independent pseudo-random decision
for each case, the percentage of cases selected can only approximate the specified
percentage. The more cases there are in the data file, the closer the percentage of
cases selected is to the specified percentage.
This step displays the Text Wizard's best guess on how to read the data file and allows
you to modify how the Text Wizard will read variables from the data file.
44
Chapter 3
Which delimiters appear between variables? Indicates the characters or symbols that
separate data values. You can select any combination of spaces, commas, semicolons,
tabs, or other characters. Multiple, consecutive delimiters without intervening data
values are treated as missing values.
What is the text qualifier? Characters used to enclose values that contain delimiter
characters. For example, if a comma is the delimiter, values that contain commas
will be read incorrectly unless there is a text qualifier enclosing the value, preventing
the commas in the value from being interpreted as delimiters between values.
CSV-format data files exported from Excel use a double quotation mark (“) as a text
qualifier. The text qualifier appears at both the beginning and the end of the value,
enclosing the entire value.
Data Files
This step displays the Text Wizard's best guess on how to read the data file and allows
you to modify how the Text Wizard will read variables from the data file. Vertical
lines in the preview window indicate where the Text Wizard currently thinks each
variable begins in the file.
Insert, move, and delete variable break lines as necessary to separate variables. If
multiple lines are used for each case, select each line from the drop-down list and
modify the variable break lines as necessary.
Note: For computer-generated data files that produce a continuous stream of data
values with no intervening spaces or other distinguishing characteristics, it may
be difficult to determine where each variable begins. Such data files usually rely
on a data definition file or some other written description that specifies the line
and column location for each variable.
Chapter 3
This steps controls the variable name and the data format that the Text Wizard will
use to read each variable and which variables will be included in the final data file.
Variable name. You can overwrite the default variable names with your own
variable names. If you read variable names from the data file, the Text Wizard will
automatically modify variable names that don't conform to variable naming rules.
Select a variable in the preview window and then enter a variable name.
Data format. Select a variable in the preview window and then select a format from the
drop-down list. Shift-click to select multiple contiguous variables or Ctrl-click to
select multiple noncontiguous variables.
Formatting options for reading variables with the Text Wizard include:
Do not import. Omit the selected variable(s) from the imported data file.
Numeric. Valid values include numbers, a leading plus or minus sign, and a decimal
indicator.
String. Valid values include virtually any keyboard characters and embedded blanks.
For delimited files, you can specify the number of characters in the value, up to a
maximum of 255. By default, the Text Wizard sets the number of characters to the
longest string value encountered for the selected variable(s). For fixed-width files,
the number of characters in string values is defined by the placement of variable
break lines in step 4.
Date/Time. Valid values include dates of the general format dd-mm-yyyy, mm/dd/yyyy,
dd.mm.yyyy, yyyy/mm/dd, hh:mm:ss, and a variety of other date and time formats.
Months can be represented in digits, Roman numerals, or three-letter abbreviations,
or they can be fully spelled out. Select a date format from the list.
Dollar. Valid values are numbers with an optional leading dollar sign and optional
commas as thousands separators.
Comma. Valid values include numbers that use a period as a decimal indicator and
commas as thousands separators.
Dot. Valid values include numbers that use a comma as a decimal indicator and
periods as thousands separators.
47
Data Files
Note: Values that contain invalid characters for the selected format will be treated
as missing. Values that contain any of the specified delimiters will be treated as
multiple values.
This is the final step of the Text Wizard. You can save your specifications in a file for
use when importing similar text data files. You can also paste the syntax generated
by the Text Wizard into a syntax window. You can then customize and/or save the
syntax for use in other sessions or in production jobs.
Cache data locally. A data cache is complete copy of the data file, stored in temporary
disk space. Caching the data file can improve performance.
48
Chapter 3
File Information
A data file contains much more than raw data. It also contains any variable definition
information, including:
Variable names
Variable formats
Descriptive variable and value labels
This information is stored in the dictionary portion of the data file. The Data Editor
provides one way to view the variable definition information. You can also display
complete dictionary information for the working data file or any other data file.
E For other data files, choose: External File, and then select the data file.
Data Files
The modified data file is saved, overwriting the previous version of the file.
Variable Types
The following table shows the variable type matching between the original data in
SPSS and the exported data in Excel.
SPSS Variable Type Excel Data Format
Numeric 0.00; #,##0.00;...
Comma 0.00; #,##0.00;...
Dollar $#,##0_);...
Date d-mmm-yyyy
Time hh:mm:ss
String General
50
Chapter 3
You have the option of saving the values and value labels associated with your data
file to a SAS syntax file. For example, when the value labels for the cars.sav data file
are exported, the generated syntax file contains:
1 = 'American'
2 = 'European'
3 = 'Japanese' ;
3 = '3 Cylinders'
4 = '4 Cylinders'
5 = '5 Cylinders'
6 = '6 Cylinders'
51
Data Files
8 = '8 Cylinders' ;
0 = 'Not Selected'
1 = 'Selected' ;
modify cars;
quit;
Variable Types
The following table shows the variable type matching between the original data
in SPSS and the exported data in SAS:
SPSS Variable Type SAS Variable Type SAS Data Format
Numeric Numeric 12
Comma Numeric 12
Dot Numeric 12
Scientific Notation Numeric 12
Date Numeric (Date) for example,
MMDDYY10,...
Date (Time) Numeric Time18
Dollar Numeric 12
Custom Currency Numeric 12
String Character $8
52
Chapter 3
To write variable names to the first row of a spreadsheet or tab-delimited data file:
E Click Write variable names to spreadsheet in the Save Data As dialog box.
E Click Save value labels where defined instead of data values in the Save Data As
dialog box.
To save value labels to a SAS syntax file (active only when a SAS file type is selected):
E Click Save value labels into a .sas file in the Save Data As dialog box.
Data Files
SPSS/PC+ (*.sys). SPSS/PC+ format. If the data file contains more than 500
variables, only the first 500 will be saved. For variables with more than one defined
user-missing value, additional user-missing values will be recoded into the first
defined user-missing value.
SPSS Portable (*.por). SPSS portable format that can be read by other versions of
SPSS and versions on other operating systems (for example, Macintosh or UNIX).
Variable names are limited to eight bytes and are automatically converted to unique
eight byte names if necessary.
Tab-delimited (*.dat). ASCII text files with values separated by tabs.
Fixed ASCII (*.dat). ASCII text file in fixed format, using the default write formats for
all variables. There are no tabs or spaces between variable fields.
Excel 2.1(*.xls). Microsoft Excel 2.1 spreadsheet file. The maximum number of
variables is 256, and the maximum number of rows is 16,384.
Excel 97 and later (*.xls). Microsoft Excel 97/2000/XP spreadsheet file. The maximum
number of variables is 256, and the maximum number of rows is 65,536.
1-2-3 Release 3.0 (*.wk3). Lotus 1-2-3 spreadsheet file, release 3.0. The maximum
number of variables that you can save is 256.
1-2-3 Release 2.0 (*.wk1). Lotus 1-2-3 spreadsheet file, release 2.0. The maximum
number of variables that you can save is 256.
1-2-3 Release 1.0 (*.wks). Lotus 1-2-3 spreadsheet file, release 1A. The maximum
number of variables that you can save is 256.
SYLK (*.slk). Symbolic link format for Microsoft Excel and Multiplan spreadsheet
files. The maximum number of variables that you can save is 256.
dBASE IV (*.dbf). dBASE IV format.
dBASE III (*.dbf). dBASE III format.
dBASE II (*.dbf). dBASE II format.
SAS v6 for Windows (*.sd2). SAS v6 file format for Windows/OS2.
SAS v6 for UNIX (*.ssd01). SAS v6 file format for UNIX (Sun, HP, IBM).
SAS v6 for Alpha/OSF (*.ssd04). SAS v6 file format for Alpha/OSF (DEC UNIX).
54
Chapter 3
SAS v7+ Windows short extension (*.sd7). SAS version 7-8 for Windows short
filename format.
SAS v7+ Windows long extension (*.sas7bdat). SAS version 7-8 for Windows long
filename format.
SAS v7+ for UNIX (*.ssd01). SAS v8 for UNIX.
SAS Transport (*.xpt). SAS transport file.
For data saved as an SPSS data file, the Save Data As Variables dialog box allows you
to select the variables that you want to be saved in the new data file. By default, all
variables will be saved. Deselect the variables that you don't want to save, or click
Drop All and then select the variables that you want to save.
Data Files
E Click Variables.
If you make subsequent modifications to the data and then try to save the data file, you
can save the data only with a different filename; so the original data are not affected.
You can change the file permissions back to read/write by selecting Mark File
Read Write from the File menu.
Chapter 3
Figure 3-22
Temporary disk space requirements
C O M P U T E v6 = …
R E C O D E v4… S O RT C A S E S B Y …
A ction G E T F ILE = 'v1-5 .sav'. R E G R E S S IO N … or
F R E Q U E N C IE S … /S AV E Z P R E D. C AC H E
v1 v2 v3 v4 v5 v1 v2 v3 v4 v5 v6 zpre v1 v2 v3 v4 v5 v6 zp re
11 12 13 14 15 11 12 13 14 15 16 1 11 12 13 14 15 16 1
Virtual 21 22 23 24 25 21 22 23 24 25 26 2 21 22 23 24 25 26 2
A ctive 31 32 33 34 35 31 32 33 34 35 36 3 31 32 33 34 35 36 3
File 41 42 43 44 45 41 42 43 44 45 46 4 41 42 43 44 45 46 4
51 52 53 54 55 51 52 53 54 55 56 5 51 52 53 54 55 56 5
61 62 63 64 65 61 62 63 64 65 66 6 61 62 63 64 65 66 6
D ata v4 v6 zpre v1 v2 v3 v4 v5 v6 zp re
Stored 14 16 1 11 12 13 14 15 16 1
in 24 26 2 21 22 23 24 25 26 2
Tem porary N one 34 36 3 31 32 33 34 35 36 3
D isk 44 46 4 41 42 43 44 45 46 4
Space 54 56 5 51 52 53 54 55 56 5
64 66 6 61 62 63 64 65 66 6
Actions that create one or more columns of data in temporary disk space include:
Computing new variables
Recoding existing variables
Running procedures that create or modify variables (for example, saving
predicted values in Linear Regression)
Actions that create an entire copy of the data file in temporary disk space include:
Reading Excel files
Running procedures that sort data (for example, Sort Cases, Split File)
Reading data with GET TRANSLATE or DATA LIST commands
57
Data Files
Note: The GET DATA command provides functionality comparable to DATA LIST,
without creating an entire copy of the data file in temporary disk space. The SPLIT
FILE command in command syntax does not sort the data file and therefore does not
create a copy of the data file. This command, however, requires sorted data for
proper operation, and the dialog box interface for this procedure will automatically
sort the data file, resulting in a complete copy of the data file. (Command syntax is
not available with the Student Version.)
The Database Wizard and the Text Wizard provide an optional setting to automatically
cache the data. By default, this option is selected. You can turn it off by deselecting
Cache data locally.
Chapter 3
Note: By default, the Database Wizard automatically creates a data cache, but if you
use the GET FILE command in command syntax to read a database, a data cache is not
automatically created. (Command syntax is not available with the Student Version.)
OK creates a data cache the next time the program reads the data (for example, the
next time you run a statistical procedure), which is usually what you want since it
doesn't require an extra data pass. Cache Now creates a data cache immediately, which
shouldn't be necessary under most circumstances. Cache Now is useful primarily
for two reasons:
A data source is “locked” and can't be updated by anyone until you end your
session, open a different data source, or cache the data.
For large data sources, scrolling through the contents of the Data view in the Data
Editor will be much faster if you cache the data.
You can use the SET command to automatically create a data cache after a specified
number of changes in the active data file. By default, the active data file is
automatically cached after 20 changes in the active data file.
E In the syntax window type SET CACHE n. (where n represents the number of changes
in the active data file before the data file is cached).
59
Data Files
Note: The cache setting is not persistent across sessions. Each time you start a new
session, the value is reset to the default of 20.
Chapter
4
Distributed Analysis Mode
Distributed analysis mode allows you to use a computer other than your local (or
desktop) computer for memory-intensive work. Since remote servers used for
distributed analysis are typically more powerful and faster than your local computer,
appropriate use of distributed analysis mode can significantly reduce computer
processing time. Distributed analysis with a remote server can be useful if your
work involves:
Large data files, particularly data read from database sources.
Memory-intensive tasks. Any task that takes a long time in local analysis mode
might be a good candidate for distributed analysis.
Distributed analysis affects only data-related tasks, such as reading data, transforming
data, computing new variables, and calculating statistics. It has no effect on tasks
related to editing output, such as manipulating pivot tables or modifying charts.
Note: Distributed analysis is available only if you have both a local version and access
to a licensed server version of the software installed on a remote server.
61
62
Chapter 4
Server Login
The Server Login dialog box allows you to select the computer that processes
commands and runs procedures. This can be either your local computer or a remote
server.
63
Figure 4-1
Server Login dialog box
You can add, modify, or delete remote servers in the list. Remote servers usually
require a user ID and a password, and a domain name may also be necessary. Contact
your system administrator for information about available servers, a user ID and
password, domain names, and other connection information.
You can select a default server and save the user ID, domain name, and password
associated with any server. You are automatically connected to the default server
when you start a new session.
Use the Server Login Settings dialog box to add or edit connection information for
remote servers for use in distributed analysis mode.
64
Chapter 4
Figure 4-2
Server Login Settings dialog box
Contact your system administrator for a list of available servers, port numbers for
the servers, and additional connection information. Do not use the Secure Sockets
Layer unless instructed to do so by your administrator.
Name. A server “name” can be an alphanumeric name assigned to a computer (for
example, hqdev001) or a unique IP address assigned to a computer (for example,
202.123.456.78).
Port Number. The port number is the port that the server software uses for
communications.
Description. Enter an optional description to display in the servers list.
Connect with Secure Sockets Layer. Secure Sockets Layer (SSL) encrypts requests
for distributed analysis when they are sent to the remote SPSS server. Before you
use SSL, check with your administrator. SSL must be configured on your desktop
computer and the server for this option to be enabled.
65
E In the server list, select the box next to the server that you want to use.
E Enter the user ID, domain name, and password provided by your administrator.
Note: You are automatically connected to the default server when you start a new
session.
E Enter your user ID, domain name, and password (if necessary).
Note: When you switch servers during a session, all open windows are closed. You
will be prompted to save changes before the windows are closed.
To add a server:
E Enter the connection information and optional settings and click OK.
To edit a server:
Chapter 4
In distributed analysis mode, the Open Remote File dialog box replaces the standard
Open File dialog box.
The list of available files, folders, and drives is dependent on what is available
on or from the remote server. The current server name is indicated at the top of
the dialog box.
You will not have access to files on your local computer in distributed analysis
mode unless you specify the drive as a shared device or the folders containing
your data files as shared folders.
If the server is running a different operating system (for example, you are running
Windows and the server is running UNIX), you probably won't have access to
local data files in distributed analysis mode even if they are in shared folders.
Only one data file can be open at a time. The current data file is automatically closed
when a new data file is opened. If you want to have multiple data files open at the
same time, you can start multiple sessions.
E If you aren't already connected to the remote server, log in to the remote server.
67
E Depending on the type of data file that you want to open, from the menus choose:
File
Open
Data...
or
File
Open Database
or
File
Read Text Data...
In distributed analysis mode, the Save Remote File dialog box replaces the standard
Save File dialog box.
The list of available folders and drives is dependent on what is available on or from
the remote server. The current server name is indicated at the top of the dialog box.
You will not have access to folders on your local computer unless you specify the
drive as a shared device and the folders as shared folders. If the server is running a
different operating system (for example, you are running Windows and the server is
running UNIX), you probably will not have access to local data files in distributed
68
Chapter 4
analysis mode even if they are in shared folders. Permissions for shared folders must
include the ability to write to the folder if you want to save data files in a local folder.
Figure 4-5
Local and remote views
Local View
Remote View
In distributed analysis mode, you will not have access to data files on your local
computer unless you specify the drive as a shared device or the folders containing
your data files as shared folders. If the server is running a different operating system
(for example, if you are running Windows and the server is running UNIX), you
probably won't have access to local data files in distributed analysis mode even
if they are in shared folders.
Distributed analysis mode is not the same as accessing data files that reside on
another computer on your network. You can access data files on other network
devices in local analysis mode or in distributed analysis mode. In local mode, you
access other devices from your local computer. In distributed mode, you access other
network devices from the remote server.
70
Chapter 4
If you're not sure if you're using local analysis mode or distributed analysis mode,
look at the title bar in the dialog box for accessing data files. If the title of the
dialog box contains the word Remote (as in Open Remote File), or if the text Remote
Server: [server name] appears at the top of the dialog box, you're using distributed
analysis mode.
Note: This affects only dialog boxes for accessing data files (for example, Open Data,
Save Data, Open Database, and Apply Data Dictionary). For all other file types (for
example, Viewer files, syntax files, and script files), the local view is always used.
E In My Computer, click the folder (directory) or drive that you want to share.
For more information about sharing drives and folders, see the Help for your
operating system.
If you are using the Windows NT server version of SPSS, you can use universal
naming convention (UNC) specifications when accessing data files with command
syntax. The general form of a UNC specification is:
\\servername\sharename\path\filename
Servername is the name of the computer that contains the data file.
Sharename is the folder (directory) on that computer that is designated as a
shared folder.
Path is any additional folder (subdirectory) path below the shared folder.
Filename is the name of the data file.
For example:
GET FILE='\\hqdev001\public\july\sales.sav'.
If the computer does not have a name assigned to it, you can use its IP address, as in:
GET FILE='\\204.125.125.53\public\july\sales.sav'.
Even with UNC path specifications, you can access data files only from devices and
folders designated as shared. When you use distributed analysis mode, this includes
data files on your local computer.
UNIX servers. On UNIX platforms, there is no equivalent of the UNC path, and all
directory paths must be absolute paths that start at the root of the server; relative paths
are not allowed. For example, if the data file is located in /bin/spss/data and the
current directory is also /bin/spss/data, GET FILE='sales.sav' is not valid; you must
specify the entire path, as in:
GET FILE='/bin/data/spss/sales.sav'.
Chapter
5
Data Editor
The Data Editor provides a convenient, spreadsheet-like method for creating and
editing data files. The Data Editor window opens automatically when you start a
session.
Data View
Figure 5-1
Data view
73
74
Chapter 5
Many of the features of the Data view are similar to those found in spreadsheet
applications. There are, however, several important distinctions:
Rows are cases. Each row represents a case or an observation. For example, each
individual respondent to a questionnaire is a case.
Columns are variables. Each column represents a variable or characteristic being
measured. For example, each item on a questionnaire is a variable.
Cells contain values. Each cell contains a single value of a variable for a case. The
cell is the intersection of the case and the variable. Cells contain only data values.
Unlike spreadsheet programs, cells in the Data Editor cannot contain formulas.
The data file is rectangular. The dimensions of the data file are determined by
the number of cases and variables. You can enter data in any cell. If you enter
data in a cell outside the boundaries of the defined data file, the data rectangle
is extended to include any rows and/or columns between that cell and the file
boundaries. There are no “empty” cells within the boundaries of the data file. For
numeric variables, blank cells are converted to the system-missing value. For
string variables, a blank is considered a valid value.
Variable View
Figure 5-2
Variable view
75
Data Editor
The Variable view contains descriptions of the attributes of each variable in the
data file. In the Variable view:
Rows are variables.
Columns are variable attributes.
You can add or delete variables and modify attributes of variables, including:
Variable name
Data type
Number of digits or characters
Number of decimal places
Descriptive variable and value labels
User-defined missing values
Column width
Measurement level
All of these attributes are saved when you save the data file.
In addition to defining variable properties in the Variable view, there are two other
methods for defining variable properties:
The Copy Data Properties wizard provides the ability to use an external SPSS
data file as a template for defining file and variable properties in the working data
file. You can also use variables in the working data file as templates for other
variables in the working data file. Copy Data Properties is available on the
Data menu in the Data Editor window.
Define Variable Properties (also available on the Data menu in the Data Editor
window) scans your data and lists all unique data values for any selected
variables, identifies unlabeled values, and provides an auto-label feature. This is
particularly useful for categorical variables that use numeric codes to represent
categories—for example, 0 = Male, 1 = Female.
Chapter 5
E Double-click a variable name at the top of the column in the Data view, or click the
Variable View tab.
Variable Names
The following rules apply to variable names:
The name must begin with a letter. The remaining characters can be any letter,
any digit, a period, or the symbols @, #, _, or $.
Variable names cannot end with a period.
Variable names that end with an underscore should be avoided (to avoid conflict
with variables automatically created by some procedures).
The length of the name cannot exceed 64 bytes. Sixty-four bytes typically means
64 characters in single-byte languages (for example, English, French, German,
Spanish, Italian, Hebrew, Russian, Greek, Arabic, Thai) and 32 characters in
double-byte languages (for example, Japanese, Chinese, Korean).
Blanks and special characters (for example, !, ?, ', and *) cannot be used.
Each variable name must be unique; duplication is not allowed.
Reserved keywords cannot be used as variable names. Reserved keywords are:
ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, WITH.
Variable names can be defined with any mixture of upper and lower case
characters, and case is preserved for display purposes.
When long variable names need to wrap on to multiple lines in output, SPSS
attempts to break lines at underscores, periods, and a change from lower to
upper case.
77
Data Editor
Chapter 5
Figure 5-3
Scale and categorical variables in a chart procedure
For SPSS-format data files created in earlier versions of SPSS products, the following
rules apply:
String (alphanumeric) variables are set to nominal.
String and numeric variables with defined value labels are set to ordinal.
Numeric variables without defined value labels but less than a specified number
of unique values are set to ordinal.
Numeric variables without defined value labels and more than a specified number
of unique values are set to scale.
The default number of unique values is 24. To change the specified value, change
the interactive chart options (from the Edit menu, choose Options and click the
Interactive tab).
Variable Type
Variable Type specifies the data type for each variable. By default, all new variables
are assumed to be numeric. You can use Variable Type to change the data type. The
contents of the Variable Type dialog box depend on the data type selected. For some
79
Data Editor
data types, there are text boxes for width and number of decimals; for others, you can
simply select a format from a scrollable list of examples.
Figure 5-4
Variable Type dialog box
Chapter 5
Custom currency. A numeric variable whose values are displayed in one of the
custom currency formats that you have defined in the Currency tab of the Options
dialog box. Defined custom currency characters cannot be used in data entry but are
displayed in the Data Editor.
String. Values of a string variable are not numeric, and hence not used in calculations.
They can contain any characters up to the defined length. Uppercase and lowercase
letters are considered distinct. Also known as an alphanumeric variable.
E Click the button in the Type cell for the variable that you want to define.
Depending on the format, the display of values in the Data view may differ from the
actual value as entered and stored internally. Following are some general guidelines:
For numeric, comma, and dot formats, you can enter values with any number of
decimal positions (up to 16), and the entire value is stored internally. The Data
view displays only the defined number of decimal places, and it rounds values
with more decimals. However, the complete value is used in all computations.
For string variables, all values are right-padded to the maximum width. For a
string variable with a width of 4, a value of 'No' is stored internally as 'No '
and is not equivalent to ' No '.
For date formats, you can use slashes, dashes, spaces, commas, or periods as
delimiters between day, month, and year values, and you can enter numbers,
three-letter abbreviations, or complete names for month values. Dates of
the general format dd-mmm-yy are displayed with dashes as delimiters and
three-letter abbreviations for the month. Dates of the general format dd/mm/yy
and mm/dd/yy are displayed with slashes for delimiters and numbers for the
month. Internally, dates are stored as the number of seconds from October 14,
81
Data Editor
1582. The century range for dates with two-digit years is determined by your
Options settings (from the Edit menu, choose Options and click the Data tab).
For time formats, you can use colons, periods, or spaces as delimiters between
hours, minutes, and seconds. Times are displayed with colons as delimiters.
Internally, times are stored as the number of seconds from October 14, 1582.
Variable Labels
You can assign descriptive variable labels up to 256 characters long (128 characters
in double-byte languages), and variable labels can contain spaces and reserved
characters not allowed in variable names.
E Double-click a variable name at the top of the column in the Data view or click the
Variable View tab.
E Enter the descriptive variable label in the Label cell for the variable.
Value Labels
You can assign descriptive value labels for each value of a variable. This is
particularly useful if your data file uses numeric codes to represent non-numeric
categories (for example, codes of 1 and 2 for male and female).
Value labels can be up to 60 characters long.
Value labels are not available for long string variables (string variables longer
than 8 characters).
82
Chapter 5
Figure 5-5
Value Labels dialog box
E Click the button in the Values cell for the variable that you want to define.
E For variable labels, select the Label cell for the variable in the Variable view in the
Data Editor.
E For value labels, select the Values cell for the variable in the Variable view in the Data
Editor, click the button that appears in the cell, and then select the label you want to
modify in the Value Labels dialog box.
E At the place in the label where you want the label to wrap, type \n.
83
Data Editor
The “\n” does is not displayed in pivot tables or charts; it is intrepreted as a line
break character.
Missing Values
Missing Values defines specified data values as user-missing. It is often useful
to know why information is missing. For example, you might want to distinguish
between data missing because a respondent refused to answer and data missing
because the question didn't apply to that respondent. Data values specified as
user-missing are flagged for special treatment and are excluded from most
calculations.
Figure 5-6
Missing Values dialog box
You can enter up to three discrete (individual) missing values, a range of missing
values, or a range plus one discrete value.
Ranges can be specified only for numeric variables.
You cannot define missing values for long string variables (string variables longer
than eight characters).
Missing values for string variables. All string values, including null or blank values,
are considered valid values unless you explicitly define them as missing. To define
null or blank values as missing for a string variable, enter a single space in one
of the fields for Discrete missing values.
84
Chapter 5
E Click the button in the Missing cell for the variable that you want to define.
All string values, including null or blank values, are considered valid values unless
you explicitly define them as missing. To define null or blank values as missing for a
string variable, enter a single space in one of the fields for Discrete missing values.
Column Width
You can specify a number of characters for the column width. Column widths can
also be changed in the Data view by clicking and dragging the column borders.
Column formats affect only the display of values in the Data Editor. Changing
the column width does not change the defined width of a variable. If the defined
and actual width of a value are wider than the column, asterisks (*) are displayed
in the Data view.
Variable Alignment
Alignment controls the display of data values and/or value labels in the Data view.
The default alignment is right for numeric variables and left for string variables. This
setting affects only the display in the Data view.
Basic copy and paste operations are used to apply variable definition attributes.
You can:
Copy a single attribute (for example, value labels) and paste it to the same
attribute cell(s) for one or more variables.
85
Data Editor
Copy all the attributes from one variable and paste them to one or more other
variables.
Create multiple new variables with all the attributes of a copied variable.
E In the Variable view, select the attribute cell that you want to apply to other variables.
E Select the attribute cell(s) to which you want to apply the attribute. You can select
multiple target variables.
If you paste the attribute to blank rows, new variables are created with default
attributes for all but the selected attribute.
E In the Variable view, select the row number for the variable with the attributes that
you want to use. The entire row is highlighted.
E Select the row number(s) for the variable(s) to which you want to apply the attributes.
You can select multiple target variables.
Chapter 5
E In the Variable view, click the row number for the variable with the attributes that you
want to use for the new variable. The entire row is highlighted.
E Click the empty row number beneath the last defined variable in the data file.
The new variable names will consist of the specified prefix plus a sequential number
starting with the specified number.
Entering Data
You can enter data directly in the Data Editor in the Data view. You can enter data
in any order. You can enter data by case or by variable, for selected areas or for
individual cells.
The active cell is highlighted.
The variable name and row number of the active cell are displayed in the top
left corner of the Data Editor.
When you select a cell and enter a data value, the value is displayed in the cell
editor at the top of the Data Editor.
Data values are not recorded until you press Enter or select another cell.
To enter anything other than simple numeric data, you must define the variable
type first.
If you enter a value in an empty column, the Data Editor automatically creates a new
variable and assigns a variable name.
87
Data Editor
Figure 5-7
Working data file in the Data view
E Enter the data value. The value is displayed in the cell editor at the top of the Data
Editor.
E Click OK.
88
Chapter 5
E Enter the data in the column for the newly defined variable.
The value is entered and the value label is displayed in the cell.
Note: This works only if you have defined value labels for the variable.
Editing Data
With the Data Editor, you can modify data values in the Data view in many ways.
You can:
Change data values.
89
Data Editor
E In the Data view, double-click the cell. The cell value is displayed in the cell editor.
E Press Enter (or move to another cell) to record the new value.
If the defined variable types of the source and target cells are not the same, the Data
Editor attempts to convert the value. If no conversion is possible, the system-missing
value is inserted in the target cell.
Numeric or Date into String. Numeric (for example, numeric, dollar, dot, or comma)
and date formats are converted to strings if they are pasted into a string variable cell.
The string value is the numeric value as displayed in the cell. For example, for
90
Chapter 5
a dollar format variable, the displayed dollar sign becomes part of the string value.
Values that exceed the defined string variable width are truncated.
String into Numeric or Date. String values that contain acceptable characters for the
numeric or date format of the target cell are converted to the equivalent numeric
or date value. For example, a string value of 25/12/91 is converted to a valid date
if the format type of the target cell is one of the day-month-year formats, but it
is converted to system-missing if the format type of the target cell is one of the
month-day-year formats.
Date into Numeric. Date and time values are converted to a number of seconds if
the target cell is one of the numeric formats (for example, numeric, dollar, dot, or
comma). Since dates are stored internally as the number of seconds since October 14,
1582, converting dates to numeric values can yield some extremely large numbers.
For example, the date 10/29/91 is converted to a numeric value of 12,908,073,600.
Numeric into Date or Time. Numeric values are converted to dates or times if the value
represents a number of seconds that can produce a valid date or time. For dates,
numeric values less than 86,400 are converted to the system-missing value.
E In the Data view, select any cell in the case (row) below the position where you want
to insert the new case.
A new row is inserted for the case and all variables receive the system-missing value.
91
Data Editor
E Select any cell in the variable to the right of (Data view) or below (Variable view)
the position where you want to insert the new variable.
A new variable is inserted with the system-missing value for all cases.
To Move Variables
E Click the variable name in the Data view or the row number for the variable in the
Variable view to select the variable.
E If you want to place the variable between two existing variables, in the Data view
drop the variable on the variable column to the right of where you want to place the
variable. In the Variable view, drop it on the variable row below where you want to
place the variable.
92
Chapter 5
Go to Case
Go to Case goes to the specified case (row) number in the Data Editor.
Figure 5-8
Go to Case dialog box
Data Editor
Filtered
(excluded)
cases
Chapter 5
Grid lines are printed if they are currently displayed in the selected view.
Value labels are printed in the Data view if they are currently displayed.
Otherwise, the actual data values are printed.
Use the View menu in the Data Editor window to display or hide grid lines and toggle
between the display of data values and value labels.
E Select the tab for the view that you want to print.
6
Data Preparation
Once you've opened a data file or entered data in the Data Editor, you can start creating
reports, charts, and analyses without any additional preliminary work. However, there
are some additional data preparation features that you may find useful, including:
Assign variable properties that describe the data and determine how certain
values should be treated.
Identify cases that may contain duplicate information and exclude those cases
from analyses or delete them from the data file.
Create new variables with a few distinct categories that represent ranges of values
from variables with a large number of possible values.
Variable Properties
Data simply entered in the Data Editor in the Data view or read into SPSS from an
external file format (for example, an Excel spreadsheet or a text data file) lack certain
variable properties that you may find very useful, such as:
Definition of descriptive value labels for numeric codes (for example, 0 = Male
and 1 = Female).
Identification of missing values codes (for example, 99 = Not applicable).
Assignment of measurement level (nominal, ordinal, or scale).
95
96
Chapter 6
All of these variable properties (and others) can be assigned in the Variable view of
the Data Editor. There are also several utilities that can assist you in this process:
Define Variable Properties can help you define descriptive value labels and
missing values. This is particularly useful for categorical data with numeric
codes used for category values.
Copy Data Properties provides the ability to use an existing SPSS-format data file
as a template for file and variable properties in the current data file. This is
particularly useful if you frequently use external-format data files that contain
similar content (such as monthly reports in Excel format).
Data Preparation
Figure 6-1
Initial dialog box for selecting variables to define
E Select the numeric or short string variables for which you want to create value labels
or define or change other variable properties, such as missing values or descriptive
variable labels.
Note: Long string variables (string variables with a defined width of more than eight
characters) are not displayed in the variable list. Long string variables cannot have
defined value labels or missing values categories.
E Specify the number of cases to scan to generate the list of unique values. This is
particularly useful for data files with a large number of cases for which a scan of the
complete data file might take a significant amount of time.
E Specify an upper limit for the number of unique values to display. This is primarily
useful to prevent listing hundreds, thousands, or even millions of values for scale
(continuous interval, ratio) variables.
E Click Continue to open the main Define Variable Properties dialog box.
98
Chapter 6
E Select a variable for which you want to create value labels or define or change other
variable properties.
E Enter the label text for any unlabeled values that are displayed in the Value Label grid.
E If there are values for which you want to create value labels but those values are not
displayed, you can enter values in the Value column below the last scanned value.
E Repeat this process for each listed variable for which you want to create value labels.
The Define Variable Properties main dialog box provides the following information
for the scanned variables:
Scanned Variable List. For each scanned variable, a check mark in the Unlabeled
column indicates that the variable contains values without assigned value labels.
99
Data Preparation
To sort the variable list to display all variables with unlabeled values at the top of
the list:
You can also sort by variable name or measurement level by clicking the
corresponding column heading under Scanned Variable List.
Chapter 6
level. So, many variables that are in fact categorical may initially be displayed as
scale.
If you are unsure of what measurement level to assign to a variable, click Suggest.
Copy Properties. You can copy value labels and other variable properties from another
variable to the currently selected variable or from the currently selected variable to
one or more other variables.
Unlabeled Values. To create labels for unlabeled values automatically, click Automatic
Labels.
You can change the descriptive variable label and the display format.
You cannot change the variable's fundamental type (string or numeric).
For string variables, you can change only the variable label, not the display format.
For numeric variables, you can change the numeric type (such as numeric, date,
dollar, or custom currency), width (maximum number of digits, including any
decimal and/or grouping indicators), and number of decimal positions.
For numeric date format, you can select a specific date format (such as
dd-mm-yyyy, mm/dd/yy, yyyyddd, etc.)
For numeric custom format, you can select one of five custom currency formats
(CCA through CCE). For more information, see “Currency Options” in Chapter
43 on page 583.
An asterisk is displayed in the Value column if the specified width is less than the
width of the scanned values or the displayed values for preexisting defined value
labels or missing values categories.
A period (.) is displayed if the scanned values or the displayed values for
preexisting defined value labels or missing values categories are invalid for the
selected display format type. For example, an internal numeric value of less than
86,400 is invalid for a date format variable.
101
Data Preparation
Note: Values defined as representing missing values are not included in the evaluation
for measurement level. For example, the explanation for the suggested measurement
level may indicate that the suggestion is in part based on the fact that the variable
contains no negative values, whereas it may in fact contain negative values—but those
values are already defined as missing values.
E Click Continue to accept the suggested level of measurement or Cancel to leave the
measurement level unchanged.
102
Chapter 6
E Select a single variable from which to copy value labels and other variable properties
(except variable label).
or
E Select one or more variables to which to copy value labels and other variable
properties.
E Click Copy to copy the value labels and the measurement level.
Existing value labels and missing value categories for target variable(s) are not
replaced.
103
Data Preparation
Value labels and missing value categories for values not already defined for the
target variable(s) are added to the set of value labels and missing value categories
for the target variable(s).
The measurement level for the target variable(s) is always replaced.
If either the source or target variable has a defined range of missing values,
missing values definitions are not copied.
Chapter 6
Undefined (empty) properties in the source data file do not overwrite defined
properties in the working data file.
Variable properties are copied from the source variable only to target variables
of a matching type—string (alphanumeric) or numeric (including numeric,
date, and currency).
Note: Copy Data Properties replaces Apply Data Dictionary, formerly available
on the File menu.
Data Preparation
Figure 6-5
Copy Data Properties Wizard: Step 1
E Select the data file with the file and/or variable properties that you want to copy. This
can be an external SPSS-format data file or the working data file.
Chapter 6
Figure 6-6
Copy Data Properties Wizard: Step 2
Apply properties from selected source file variables to matching working file variables.
Variable properties are copied from one or more selected source variables to matching
variables in the working data file. Variables “match” if both the variable name
and type (string or numeric) are the same. For string variables, the defined length
must also be the same. By default, only matching variables are displayed in the
two variable lists.
Create matching variables in the working data file if they do not already exist. This
updates the source list to display all variables in the source data file. If you select
source variables that do not exist in the working data file (based on variable
107
Data Preparation
name), new variables will be created in the working data file with the variable
names and properties from the source data file.
If the working data file contains no variables (a blank, new data file), all variables
in the source data file are displayed and new variables based on the selected source
variables are automatically created in the working data file.
Apply properties from a single source variable to selected working file variables of the
same type. Variable properties from a single selected variable in the source list can be
applied to one or more selected variables in the working file list. Only variables of the
same type (numeric or string) as the selected variable in the source list are displayed
in the working file list. For string variables, only strings of the same defined length
as the source variable are displayed. This option is not available if the working
data file contains no variables.
Note: You cannot create new variables in the working data file with this option.
Apply dataset properties only—no variable selection. Only file properties (for example,
documents, file label, weight) will be applied to the working data file. No variable
properties will be applied. This option is not available if the working data file is
also the source data file.
Chapter 6
Figure 6-7
Copy Data Properties Wizard: Step 3
Value Labels. Value labels are descriptive labels associated with data values. Value
labels are often used when numeric data values are used to represent non-numeric
categories (for example, codes of 1 and 2 for Male and Female). You can replace or
merge value labels in the target variables.
109
Data Preparation
Replace deletes any defined value labels for the target variable and replaces them
with the defined value labels from the source variable.
Merge merges the defined value labels from the source variable with any existing
defined value label for the target variable. If the same value has a defined
value label in both the source and target variables, the value label in the target
variable is unchanged.
Missing Values. Missing values are values identified as representing missing data (for
example, 98 for Do not know and 99 for Not applicable). Typically, these values also
have defined value labels that describe what the missing value codes stand for. Any
existing defined missing values for the target variable are deleted and replaced with
the defined missing values from the source variable.
Variable Label. Descriptive variable labels can contain spaces and reserved characters
not allowed in variable names. If you're copying variable properties from a single
source variable to multiple target variables, you might want to think twice before
selecting this option.
Measurement Level. The measurement level can be nominal, ordinal, or scale. For
those procedures that distinguish between different measurement levels, nominal and
ordinal are both considered categorical.
Formats. For numeric variables, this controls numeric type (such as numeric, date, or
currency), width (total number of displayed characters, including leading and trailing
characters and decimal indicator), and number of decimal places displayed. This
option is ignored for string variables.
Alignment. This affects only alignment (left, right, center) in the Data view in the
Data Editor.
Data Editor Column Width. This affects only column width in the Data view in the
Data Editor.
Chapter 6
Figure 6-8
Copy Data Properties Wizard: Step 4
Multiple Response Sets. Applies multiple response set definitions from the source
data file to the working data file. (Note: Multiple response sets are currently used
only by the Tables add-on component.)
Multiple response sets in the source data file that contain variables that do not
exist in the working data file are ignored unless those variables will be created
based on specifications in step 2 (Selecting Source and Target Variables) in the
Copy Data Properties Wizard.
111
Data Preparation
Replace deletes all multiple response sets in the working data file and replaces
them with the multiple response sets from the source data file.
Merge adds multiple response sets from the source data file to the collection of
multiple response sets in the working data file. If a set with the same name exists
in both files, the existing set in the working data file is unchanged.
Variable Sets. Variable sets are used to control the list of variables that are displayed
in dialog boxes. Variable sets are defined by selecting Define Sets from the Utilities
menu.
Sets in the source data file that contain variables that do not exist in the working
data file are ignored unless those variables will be created based on specifications
in step 2 (Selecting Source and Target Variables) in the Copy Data Properties
Wizard.
Replace deletes any existing variable sets in the working data file, replacing them
with variable sets from the source data file.
Merge adds variable sets from the source data file to the collection of variable
sets in the working data file. If a set with the same name exists in both files, the
existing set in the working data file is unchanged.
Documents. Notes appended to the data file via the DOCUMENT command.
Replace deletes any existing documents in the working data file, replacing them
with the documents from the source data file.
Merge combines documents from the source and working data file. Unique
documents in the source file that do not exist in the working data file are added to
the working data file. All documents are then sorted by date.
Weight Specification. Weights cases by the current weight variable in the source
data file if there is a matching variable in the working data file. This overrides any
weighting currently in effect in the working data file.
File Label. Descriptive label applied to a data file with the FILE LABEL command.
112
Chapter 6
Results
Figure 6-9
Copy Data Properties Wizard: Step 5
The last step in the Copy Data Properties Wizard provides information on the number
of variables for which variable properties will be copied from the source data file,
the number of new variables that will be created, and the number of dataset (file)
properties that will be copied.
You can also choose to paste the generated command syntax into a syntax window
and save the syntax for later use.
113
Data Preparation
Identify Duplicate Cases allows you to define duplicate almost any way that you
want and provides some control over the automatic determination of primary versus
duplicate cases.
E Select one or more variables to sort cases within groups defined by the selected
matching cases variables. The sort order defined by these variables determines the
“first” and “last” case in each group. Otherwise, the original file order is used.
E Automatically filter duplicate cases so that they won't be included in reports, charts,
or calculation of statistics.
114
Chapter 6
Figure 6-10
Identify Duplicate Cases dialog box
Define matching cases by. Cases are considered duplicates if their values match for
all selected variables. If you want to identify only cases that are a 100% match in
all respects, select all of the variables.
Sort within matching groups by. Cases are automatically sorted by the variables that
define matching cases. You can select additional sorting variables that will determine
the sequential order of cases in each matching group.
For each sort variable, you can sort in ascending or descending order.
If you select multiple sort variables, cases are sorted by each variable within
categories of the preceding variable in the list. For example, if you select date as
the first sorting variable and amount as the second sorting variable, cases will be
sorted by amount within each date.
115
Data Preparation
Use the up and down arrow buttons to the right of the list to change the sort
order of the variables.
The sort order determines the “first” and “last” case within each matching group,
which determines the value of the optional primary indicator variable. For
example, if you want to filter out all but the most recent case in each matching
group, you could sort cases within the group in ascending order of a date variable,
which would make the most recent date the last date in the group.
Indicator of primary cases. Creates a variable with a value of 1 for all unique cases
and the case identified as the primary case in each group of matching cases and a
value of 0 for the nonprimary duplicates in each group.
The primary case can be either the last or first case in each matching group, as
determined by the sort order within the matching group. If you don't specify
any sort variables, the original file order determines the order of cases within
each group.
You can use the indicator variable as a filter variable to exclude nonprimary
duplicates from reports and analyses without deleting those cases from the data
file.
Sequential count of matching cases in each group. Creates a variable with a sequential
value from 1 to n for cases in each matching group. The sequence is based on the
current order of cases in each group, which is either the original file order or the order
determined by any specified sort variables.
Move matching cases to the top. Sorts the data file so that all groups of matching
cases are at the top of the data file, making it easy to visually inspect the matching
cases in the Data Editor.
Display frequencies for created variables. Frequency tables containing counts for each
value of the created variables. For example, for the primary indicator variable, the
table would show the number of cases with a value 0 for that variable, which indicates
the number of duplicates, and the number of cases with a value of 1 for that variable,
which indicates the number of unique and primary cases.
116
Chapter 6
Missing Values. For numeric variables, the system-missing value is treated like any
other value—cases with the system-missing value for an identifier variable are treated
as having matching values for that variable. For string variables, cases with no value
for an identifier variable are treated as having matching values for that variable.
Visual Bander
The Visual Bander is designed to assist you in the process of creating new variables
based on grouping contiguous values of existing variables into a limited number of
distinct categories. You can use the Visual Bander to:
Create categorical variables from continuous scale variables. For example, you
could use a scale income variable to create a new categorical variable that
contains income ranges.
Collapse a large number of ordinal categories into a smaller set of categories.
For example, you could collapse a rating scale of nine down to three categories
representing low, medium, and high.
E Select the numeric scale and/or ordinal variables for which you want to create new
categorical (banded) variables.
117
Data Preparation
Figure 6-11
Initial dialog box for selecting variables to band
Optionally, you can limit the number of cases to scan. For data files with a large
number of cases, limiting the number of cases scanned can save time, but you
should avoid this if possible because it will affect the distribution of values used in
subsequent calculations in the Visual Bander.
Note: String variables and nominal numeric variables are not displayed in the source
variable list. The Visual Bander requires numeric variables, measured on either a
scale or ordinal level, since it assumes that the data values represent some logical
order that can be used to group values in a meaningful fashion. You can change the
defined measurement level of a variable in the Variable view of the Data Editor. For
more information, see “Variable Measurement Level” in Chapter 5 on page 77.
To Band Variables
E From the menus in the Data Editor window choose:
Transform
Visual Bander...
118
Chapter 6
E Select the numeric scale and/or ordinal variables for which you want to create new
categorical (banded) variables.
E Enter a name for the new banded variable. Variable names must be unique and must
follow SPSS variable naming rules. For more information, see “Variable Names” in
Chapter 5 on page 76.
E Define the banding criteria for the new variable. For more information, see “Banding
Variables” on page 118.
E Click OK.
Banding Variables
Figure 6-12
Visual Bander, main dialog box
119
Data Preparation
The Visual Bander main dialog box provides the following information for the
scanned variables:
Scanned Variable List. Displays the variables you selected in the initial dialog box.
You can sort the list by measurement level (scale or ordinal) or by variable label or
name by clicking on the column headings.
Cases Scanned. Indicates the number of cases scanned. All scanned cases without
user-missing or system-missing values for the selected variable are used to generate
the distribution of values used in calculations in the Visual Bander, including the
histogram displayed in the main dialog box and cutpoints based on percentiles or
standard deviation units.
Current Variable. The name and variable label (if any) for the currently selected
variable that will be used as the basis for the new, banded variable.
Banded Variable. Name and optional variable label for the new, banded variable.
Name. You must enter a name for the new variable. Variable names must be
unique and must follow SPSS variable naming rules. For more information, see
“Variable Names” in Chapter 5 on page 76.
Label. You can enter a descriptive variable label up to 255 characters long. The
default variable label is the variable label (if any) or variable name of the source
variable with (Banded) appended to the end of the label.
Minimum and Maximum. Minimum and maximum values for the currently selected
variable, based on the scanned cases and not including values defined as user-missing.
Nonmissing Values. The histogram displays the distribution of nonmissing values for
the currently selected variable, based on the scanned cases.
After you define bands for the new variable, vertical lines on the histogram are
displayed to indicate the cutpoints that define bands.
120
Chapter 6
You can click and drag the cutpoint lines to different locations on the histogram,
changing the band ranges.
You can remove bands by dragging cutpoint lines off the histogram.
Note: The histogram (displaying nonmissing values), the minimum, and the
maximum are based on the scanned values. If you do not include all cases in the scan,
the true distribution may not be accurately reflected, particularly if the data file has
been sorted by the selected variable. If you scan zero cases, no information about
the distribution of values is available.
Grid. Displays the values that define the upper endpoints of each band and optional
value labels for each band.
Value. The values that define the upper endpoints of each band. You can enter
values or use Make Cutpoints to automatically create bands based on selected
criteria. By default, a cutpoint with a value of HIGH is automatically included.
This band will contain any nonmissing values above the other cutpoints. The
band defined by the lowest cutpoint will include all nonmissing values lower
than or equal to that value (or simply lower than that value, depending on how
you define upper endpoints).
Labels. Optional, descriptive labels for the values of the new, banded variable.
Since the values of the new variable will simply be sequential integers from 1 to
n, labels that describe what the values represent can be very useful. You can enter
labels or use Make Labels to automatically create value labels.
E Right-click on the either the Value or Label cell for the band.
Note: If you delete the HIGH band, any cases with values higher than the last specified
cutpoint value will be assigned the system-missing value for the new variable.
E From the pop-up context menu select either Delete All Labels or Delete All Cutpoints.
121
Data Preparation
Upper Endpoints. Controls treatment of upper endpoint values entered in the Value
column of the grid.
Included (<=). Cases with the value specified in the Value cell are included in the
banded category. For example, if you specify values of 25, 50, and 75, cases with
a value of exactly 25 will go in the first band, since this will include all cases
with values less than or equal to 25.
Excluded (<). Cases with the value specified in the Value cell are not included in
the banded category. Instead, they are included in the next band. For example, if
you specify values of 25, 50, and 75, cases with a value of exactly 25 will go
in the second band rather than the first, since the first band will contain only
cases with values less than 25.
Make Labels. Generates descriptive labels for the sequential integer values of the
new, banded variable, based on the values in the grid and the specified treatment of
upper endpoints (included or excluded).
Reverse scale. By default, values of the new, banded variable are ascending sequential
integers from 1 to n. Reversing the scale makes the values descending sequential
integers from n to 1.
Copy Bands. You can copy the banding specifications from another variable to the
currently selected variable or from the selected variable to multiple other variables.
For more information, see “Copying Banded Categories” on page 124.
Chapter 6
E Select the criteria for generating cutpoints that will define the banded categories.
E Click Apply.
Figure 6-13
Make Cutpoints dialog box
Note: The Make Cutpoints dialog box is not available if you scanned zero cases.
Equal Width Intervals. Generates banded categories of equal width (for example, 1–10,
11–20, 21–30, etc.), based on any two of the following three criteria:
First Cutpoint Location. The value that defines the upper end of the lowest banded
category (for example, a value of 10 indicates a range that includes all values up
to 10).
Number of Cutpoints. The number of banded categories is the number of cutpoints
plus one. For example, 9 cutpoints generate 10 banded categories.
Width. The width of each interval. For example, a value of 10 would band age in
years into 10-year intervals.
123
Data Preparation
If the source variable contains a relatively small number of distinct values or a large
number of cases with the same value, you may get fewer bands than requested.
In a normal distribution, 68% of the cases fall within one standard deviation of
the mean, 95%, within two standard deviations, and 99%, within three standard
deviations. Creating banded categories based on standard deviations may result in
some defined bands outside the actual data range and even outside the range of
possible data values (for example, a negative salary range).
Note: Calculations of percentiles and standard deviations are based on the scanned
cases. If you limit the number of cases scanned, the resulting bands may not contain
the proportion of cases that you wanted in those bands, particularly if the data file is
sorted by the source variable. For example, if you limit the scan to the first 100 cases
of a data file with 1000 cases and the data file is sorted in ascending order of age of
respondent, instead of four percentile age bands each containing 25% of the cases,
you may find that the first three bands each contain only about 3.3% of the cases, and
the last band contains 90% of the cases.
124
Chapter 6
E Define banded categories for at least one variable—but do not click OK or Paste.
E Select (click) a variable in the Scanned Variable List for which you have defined
banded categories.
E Select the variables for which you want to create new variables with the same banded
categories.
125
Data Preparation
E Click Copy.
or
E Select (click) a variable in the Scanned Variable List to which you want to copy
defined banded categories.
E Select the variable with the defined banded categories that you want to copy.
E Click Copy.
If you have specified value labels for the variable from which you are copying the
banding specifications, those are also copied.
Note: Once you click OK in the Visual Bander main dialog box to create new banded
variables (or close the dialog box in any other way), you cannot use the Visual Bander
to copy those banded categories to other variables.
7
Data Transformations
In an ideal situation, your raw data are perfectly suitable for the type of analysis you
want to perform, and any relationships between variables are either conveniently
linear or neatly orthogonal. Unfortunately, this is rarely the case. Preliminary analysis
may reveal inconvenient coding schemes or coding errors, or data transformations
may be required in order to expose the true relationship between variables.
You can perform data transformations ranging from simple tasks, such as
collapsing categories for analysis, to more advanced tasks, such as creating new
variables based on complex equations and conditional statements.
Computing Variables
Compute Variable computes values for a variable based on numeric transformations
of other variables.
You can compute values for numeric or string (alphanumeric) variables.
You can create new variables or replace the values of existing variables. For new
variables, you can also specify the variable type and label.
You can compute values selectively for subsets of data based on logical conditions.
You can use more than 70 built-in functions, including arithmetic functions,
statistical functions, distribution functions, and string functions.
127
128
Chapter 7
Figure 7-1
Compute Variable dialog box
To Compute Variables
E From the menus choose:
Transform
Compute...
E Type the name of a single target variable. It can be an existing variable or a new
variable to be added to the working data file.
E To build an expression, either paste components into the Expression field or type
directly in the Expression field.
Paste functions from the function list and fill in the parameters indicated by
question marks.
String constants must be enclosed in quotation marks or apostrophes.
Numeric constants must be typed in American format, with the period (.) as
the decimal indicator.
For new string variables, you must also select Type & Label to specify the data type.
129
Data Transformations
Conditional Transformations
The If Cases dialog box allows you to apply data transformations to selected subsets
of cases, using conditional expressions. A conditional expression returns a value
of true, false, or missing for each case.
If the result of a conditional expression is true, the transformation is applied
to the case.
If the result of a conditional expression is false or missing, the transformation is
not applied to the case.
Most conditional expressions use one or more of the six relational operators (<, >,
<=, >=, =, and ~=) on the calculator pad.
Conditional expressions can include variable names, constants, arithmetic
operators, numeric and other functions, logical variables, and relational operators.
Figure 7-2
If Cases dialog box
Chapter 7
Label. Optional, descriptive variable label up to 120 characters long. You can enter a
label or use the first 110 characters of the Compute expression as the label.
Type. Computed variables can be numeric or string (alphanumeric). String variables
cannot be used in calculations.
Figure 7-3
Type and Label dialog box
Functions
Many types of functions are supported, including:
Arithmetic functions
Statistical functions
String functions
Date and time functions
Distribution functions
Random variable functions
Missing value functions
Search for functions in the online Help system index for a complete list of functions.
Right-click on a selected function in the list for a description of that function.
131
Data Transformations
the result is missing if a case has a missing value for any of the three variables.
In the expression:
MEAN(var1, var2, var3)
the result is missing only if the case has missing values for all three variables.
For statistical functions, you can specify the minimum number of arguments that
must have nonmissing values. To do so, type a period and the minimum number
after the function name, as in:
MEAN.2(var1, var2, var3)
Chapter 7
The random number seed is automatically reset to 2,000,000 every time you start a
new session.
Data Transformations
E Click Define Values and specify which value or values should be counted.
Optionally, you can define a subset of cases for which to count occurrences of values.
The If Cases dialog box for defining subsets of cases is the same as the one described
for Compute Variable.
Chapter 7
Figure 7-6
Values to Count dialog box
Recoding Values
You can modify data values by recoding them. This is particularly useful for
collapsing or combining categories. You can recode the values within existing
variables, or you can create new variables based on the recoded values of existing
variables.
Data Transformations
Figure 7-7
Recode into Same Variables dialog box
E Select the variables you want to recode. If you select multiple variables, they must
be the same type (numeric or string).
E Click Old and New Values and specify how to recode values.
The If Cases dialog box for defining subsets of cases is the same as the one described
for Compute Variable.
Chapter 7
Old Value. The value(s) to be recoded. You can recode single values, ranges of values,
and missing values. System-missing values and ranges cannot be selected for string
variables because neither concept applies to string variables. Ranges include their
endpoints and any user-missing values that fall within the range.
Value. Individual old value to be recoded into a new value. The value must be the
same data type (numeric or string) as the variable(s) being recoded.
System-missing. Values assigned by the program when values in your data are
undefined according to the format type you have specified, when a numeric field
is blank, or when a value resulting from a transformation command is undefined.
Numeric system-missing values are displayed as periods. String variables cannot
have system-missing values, since any character is legal in a string variable.
System- or user-missing. Observations with values that either have been defined as
user-missing values, or are unknown and have been assigned the system-missing
value, which is indicated with a period (.).
Range. Inclusive range of values. Not available for string variables. Any
user-missing values within the range are included.
All other values. Any remaining values not included in one of the specifications on
the Old-New list. This appears as ELSE on the Old-New list.
New Value. The single value into which each old value or range of values is recoded.
You can enter a value or assign the system-missing value.
Value. Value into which one or more old values will be recoded. The value must
be the same data type (numeric or string) as the old value.
System-missing. Recodes specified old values into the system-missing value.
The system-missing value is not used in calculations, and cases with the
system-missing value are excluded from many procedures. Not available for
string variables.
Old->New. The list of specifications that will be used to recode the variable(s). You can
add, change, and remove specifications from the list. The list is automatically sorted,
based on the old value specification, using the following order: single values, missing
values, ranges, and all other values. If you change a recode specification on the list,
the procedure automatically re-sorts the list, if necessary, to maintain this order.
137
Data Transformations
Figure 7-8
Old and New Values dialog box
Chapter 7
Figure 7-9
Recode into Different Variables dialog box
E Select the variables you want to recode. If you select multiple variables, they must
be the same type (numeric or string).
E Enter an output (new) variable name for each new variable and click Change.
E Click Old and New Values and specify how to recode values.
Data Transformations
Old Value. The value(s) to be recoded. You can recode single values, ranges of values,
and missing values. System-missing values and ranges cannot be selected for string
variables because neither concept applies to string variables. Old values must be the
same data type (numeric or string) as the original variable. Ranges include their
endpoints and any user-missing values that fall within the range.
Value. Individual old value to be recoded into a new value. The value must be the
same data type (numeric or string) as the variable(s) being recoded.
System-missing. Values assigned by the program when values in your data are
undefined according to the format type you have specified, when a numeric field
is blank, or when a value resulting from a transformation command is undefined.
Numeric system-missing values are displayed as periods. String variables cannot
have system-missing values, since any character is legal in a string variable.
System- or user-missing. Observations with values that either have been defined as
user-missing values, or are unknown and have been assigned the system-missing
value, which is indicated with a period (.).
Range. Inclusive range of values. Not available for string variables. Any
user-missing values within the range are included.
All other values. Any remaining values not included in one of the specifications on
the Old-New list. This appears as ELSE on the Old-New list.
New Value. The single value into which each old value or range of values is recoded.
New values can be numeric or string.
Value. Value into which one or more old values will be recoded. The value must
be the same data type (numeric or string) as the old value.
System-missing. Recodes specified old values into the system-missing value.
The system-missing value is not used in calculations, and cases with the
system-missing value are excluded from many procedures. Not available for
string variables.
Copy old values. Retains the old value. If some values don't require recoding,
use this to include the old values. Any old values that are not specified are not
included in the new variable, and cases with those values will be assigned the
system-missing value for the new variable.
Output variables are strings. Defines the new, recoded variable as a string
(alphanumeric) variable. The old variable can be numeric or string.
140
Chapter 7
Rank Cases
Rank Cases creates new variables containing ranks, normal and Savage scores, and
percentile values for numeric variables.
New variable names and descriptive variable labels are automatically generated,
based on the original variable name and the selected measure(s). A summary table
lists the original variables, the new variables, and the variable labels.
141
Data Transformations
To Rank Cases
E From the menus choose:
Transform
Rank Cases...
E Select one or more variables to rank. You can rank only numeric variables.
Optionally, you can rank cases in ascending or descending order and organize
ranks into subgroups.
142
Chapter 7
Proportion Estimation Formula. For proportion estimates and normal scores, you can
select the proportion estimation formula: Blom, Tukey, Rankit, or Van der Waerden.
Blom. Creates new ranking variable based on proportion estimates that uses the
formula (r-3/8) / (w+1/4), where w is the sum of the case weights and r is the rank.
Tukey. Uses the formula (r-1/3) / (w+1/3), where r is the rank and w is the sum
of the case weights.
143
Data Transformations
Chapter 7
The following table shows how the different methods assign ranks to tied values:
Automatic Recode
Automatic Recode converts string and numeric values into consecutive integers.
When category codes are not sequential, the resulting empty cells reduce performance
and increase memory requirements for many procedures. Additionally, some
procedures cannot use string variables, and some require consecutive integer values
for factor levels.
Figure 7-14
Automatic Recode dialog box
The new variable(s) created by Automatic Recode retain any defined variable and
value labels from the old variable. For any values without a defined value label, the
original value is used as the label for the recoded value. A table displays the old and
new values and value labels.
145
Data Transformations
String values are recoded in alphabetical order, with uppercase letters preceding
their lowercase counterparts. Missing values are recoded into missing values higher
than any nonmissing values, with their order preserved. For example, if the original
variable has 10 nonmissing values, the lowest missing value would be recoded to 11,
and the value 11 would be a missing value for the new variable.
E For each selected variable, enter a name for the new variable and click New Name.
Define Dates
Define Dates generates date variables that can be used to establish the periodicity of a
time series and to label output from time series analysis.
146
Chapter 7
Figure 7-15
Define Dates dialog box
A new numeric variable is created for each component that is used to define the date.
The new variable names end with an underscore. A descriptive string variable, date_,
is also created from the components. For example, if you selected Weeks, days, hours,
four new variables are created: week_, day_, hour_, and date_.
147
Data Transformations
If date variables have already been defined, they are replaced when you define new
date variables that will have the same names as the existing date variables.
E Enter the value(s) that define the starting date for First Case Is, which determines the
date assigned to the first case.
Date variables created with Define Dates should not be confused with date format
variables, defined in the Variable view of the Data Editor. Date variables are used
to establish periodicity for time series data. Date format variables represent dates
and/or times displayed in various date/time formats. Date variables are simple
integers representing the number of days, weeks, hours, etc., from a user-specified
starting point. Internally, most date format variables are stored as the number of
seconds from October 14, 1582.
Chapter 7
Figure 7-16
Create Time Series dialog box
E Select the time series function you want to use to transform the original variable(s).
E Select the variable(s) from which you want to create new time series variables. Only
numeric variables can be used.
Optionally, you can:
Enter variable names to override the default new variable names.
Change the function for a selected variable.
149
Data Transformations
Chapter 7
Lag. Value of a previous case, based on the specified lag order. The order is the
number of cases prior to the current case from which the value is obtained. The
number of cases with the system-missing value at the beginning of the series is
equal to the order value.
Lead. Value of a subsequent case, based on the specified lead order. The order is
the number of cases after the current case from which the value is obtained. The
number of cases with the system-missing value at the end of the series is equal to the
order value.
Smoothing. New series values based on a compound data smoother. The smoother
starts with a running median of 4, which is centered by a running median of 2. It then
resmoothes these values by applying a running median of 5, a running median of 3,
and hanning (running weighted averages). Residuals are computed by subtracting the
smoothed series from the original series. This whole process is then repeated on the
computed residuals. Finally, the smoothed residuals are computed by subtracting
the smoothed values obtained the first time through the process. This is sometimes
referred to as T4253H smoothing.
Data Transformations
Figure 7-17
Replace Missing Values dialog box
E Select the estimation method you want to use to replace missing values.
E Select the variable(s) for which you want to replace missing values.
Series mean. Replaces missing values with the mean for the entire series.
152
Chapter 7
Mean of nearby points. Replaces missing values with the mean of valid surrounding
values. The span of nearby points is the number of valid values above and below the
missing value used to compute the mean.
Median of nearby points. Replaces missing values with the median of valid surrounding
values. The span of nearby points is the number of valid values above and below the
missing value used to compute the median.
Linear interpolation. Replaces missing values using a linear interpolation. The last
valid value before the missing value and the first valid value after the missing value
are used for the interpolation. If the first or last case in the series has a missing
value, the missing value is not replaced.
Linear trend at point. Replaces missing values with the linear trend for that point.
The existing series is regressed on an index variable scaled 1 to n. Missing values
are replaced with their predicted values.
Chapter
8
File Handling and File
Transformations
Data files are not always organized in the ideal form for your specific needs. You
may want to combine data files, sort the data in a different order, select a subset of
cases, or change the unit of analysis by grouping cases together. A wide range of file
transformation capabilities is available, including the ability to:
Sort data. You can sort cases based on the value of one or more variables.
Transpose cases and variables. The SPSS data file format reads rows as cases and
columns as variables. For data files in which this order is reversed, you can switch the
rows and columns and read the data in the correct format.
Merge files. You can merge two or more data files. You can combine files with the
same variables but different cases or the same cases but different variables.
Select subsets of cases. You can restrict your analysis to a subset of cases or perform
simultaneous analyses on different subsets.
Aggregate data. You can change the unit of analysis by aggregating cases based on the
value of one or more grouping variables.
Weight data. Weight cases for analysis based on the value of a weight variable.
Restructure data. You can restructure data to create a single case (record) from
multiple cases or create multiple cases from a single case.
Sort Cases
This dialog box sorts cases (rows) of the data file based on the values of one or more
sorting variables. You can sort cases in ascending or descending order.
153
154
Chapter 8
If you select multiple sort variables, cases are sorted by each variable within
categories of the preceding variable on the Sort list. For example, if you select
gender as the first sorting variable and minority as the second sorting variable,
cases will be sorted by minority classification within each gender category.
For string variables, uppercase letters precede their lowercase counterparts in sort
order. For example, the string value “Yes” comes before “yes” in sort order.
Figure 8-1
Sort Cases dialog box
To Sort Cases
E From the menus choose:
Data
Sort Cases...
Transpose
Transpose creates a new data file in which the rows and columns in the original data
file are transposed so that cases (rows) become variables and variables (columns)
become cases. Transpose automatically creates new variable names and displays a
list of the new variable names.
A new string variable that contains the original variable name, case_lbl, is
automatically created.
155
If the working data file contains an ID or name variable with unique values, you
can use it as the name variable, and its values will be used as variable names in
the transposed data file. If it is a numeric variable, the variable names start with
the letter V, followed by the numeric value.
User-missing values are converted to the system-missing value in the transposed
data file. To retain any of these values, change the definition of missing values in
the Variable view in the Data Editor.
Add Cases
Add Cases merges the working data file with a second data file that contains the same
variables but different cases. For example, you might record the same information
for customers in two different sales regions and maintain the data for each region
in separate files.
156
Chapter 8
Figure 8-2
Add Cases dialog box
Unpaired Variables. Variables to be excluded from the new, merged data file. Variables
from the working data file are identified with an asterisk (*). Variables from the
external data file are identified with a plus sign (+). By default, this list contains:
Variables from either data file that do not match a variable name in the other
file. You can create pairs from unpaired variables and include them in the new,
merged file.
Variables defined as numeric data in one file and string data in the other file.
Numeric variables cannot be merged with string variables.
String variables of unequal width. The defined width of a string variable must be
the same in both data files.
Variables in New Working Data File. Variables to be included in the new, merged data
file. By default, all of the variables that match both the name and the data type
(numeric or string) are included on the list.
You can remove variables from the list if you do not want them to be included in
the merged file.
Any unpaired variables included in the merged file will contain missing data for
cases from the file that does not contain that variable.
157
Indicate case source as variable. Indicates the source data file for each case. This
variable has a value of 0 for cases from the working data file and a value of 1 for
cases from the external data file.
To Merge Data Files with the Same Variables and Different Cases
E Open one of the data files. The cases from this file will appear first in the new,
merged data file.
E Select the data file to merge with the open data file.
E Remove any variables you do not want from the Variables in New Working Data
File list.
E Add any variable pairs from the Unpaired Variables list that represent the same
information recorded under different variable names in the two files. For example,
date of birth might have the variable name brthdate in one file and datebrth in the
other file.
E Ctrl-click the other variable on the list. (Press the Ctrl key and click the left mouse
button at the same time.)
E Click Pair to move the variable pair to the Variables in New Working Data File list.
(The variable name from the working data file is used as the variable name in the
merged file.)
158
Chapter 8
Figure 8-3
Selecting pairs of variables with Ctrl-click
Add Variables
Add Variables merges the working data file with an external data file that contains the
same cases but different variables. For example, you might want to merge a data file
that contains pre-test results with one that contains post-test results.
Cases must be sorted in the same order in both data files.
If one or more key variables are used to match cases, the two data files must be
sorted by ascending order of the key variable(s).
Variable names in the second data file that duplicate variable names in the
working data file are excluded by default because Add Variables assumes that
these variables contain duplicate information.
Indicate case source as variable. Indicates the source data file for each case. This
variable has a value of 0 for cases from the working data file and a value of 1 for
cases from the external data file.
160
Chapter 8
Figure 8-4
Add Variables dialog box
Excluded Variables. Variables to be excluded from the new, merged data file. By
default, this list contains any variable names from the external data file that duplicate
variable names in the working data file. Variables from the working data file are
identified with an asterisk (*). Variables from the external data file are identified with
a plus sign (+). If you want to include an excluded variable with a duplicate name in
the merged file, you can rename it and add it to the list of variables to be included.
New Working Data File. Variables to be included in the new, merged data file. By
default, all unique variable names in both data files are included on the list.
Key Variables. If some cases in one file do not have matching cases in the other file
(that is, some cases are missing in one file), use key variables to identify and correctly
match cases from the two files. You can also use key variables with table lookup files.
The key variables must have the same names in both data files.
161
Both data files must be sorted by ascending order of the key variables, and
the order of variables on the Key Variables list must be the same as their sort
sequence.
Cases that do not match on the key variables are included in the merged file but
are not merged with cases from the other file. Unmatched cases contain values
for only the variables in the file from which they are taken; variables from the
other file contain the system-missing value.
External file or Working data file is keyed table. A keyed table, or table lookup file,
is a file in which data for each “case” can be applied to multiple cases in the other
data file. For example, if one file contains information on individual family members
(such as sex, age, education) and the other file contains overall family information
(such as total income, family size, location), you can use the file of family data as
a table lookup file and apply the common family data to each individual family
member in the merged data file.
E Select the data file to merge with the open data file.
E Select the variables from the external file variables (+) on the Excluded Variables list.
The key variables must exist in both the working data file and the external data file.
Both data files must be sorted by ascending order of the key variables, and the order
of variables on the Key Variables list must be the same as their sort sequence.
162
Chapter 8
Aggregate Data
Aggregate Data combines groups of cases into single summary cases and creates a
new aggregated data file. Cases are aggregated based on the value of one or more
grouping variables. The new data file contains one case for each group. For example,
you could aggregate county data by state and create a new data file in which state
is the unit of analysis.
Figure 8-5
Aggregate Data dialog box
Break Variable(s). Cases are grouped together based on the values of the break
variables. Each unique combination of break variable values defines a group and
generates one case in the new aggregated file. All break variables are saved in the
163
new file with their existing names and dictionary information. The break variable
can be either numeric or string format.
Aggregate Variable(s). Variables are used with aggregate functions to create the new
variables for the aggregated file. By default, Aggregate Data creates new aggregate
variable names using the first several characters of the source variable name followed
by an underscore and a sequential two-digit number. The aggregate variable name is
followed by an optional variable label in quotes, the name of the aggregate function,
and the source variable name in parentheses. Source variables for aggregate functions
must be numeric.
You can override the default aggregate variable names with new variable names,
provide descriptive variable labels, and change the functions used to compute the
aggregated data values. You can also create a variable that contains the number
of cases in each break group.
E Select one or more break variables that define how cases are grouped to create
aggregated data.
E Select one or more aggregate variables to include in the new data file.
Chapter 8
Split File
Split File splits the data file into separate groups for analysis based on the values of
one or more grouping variables. If you select multiple grouping variables, cases
are grouped by each variable within categories of the preceding variable on the
Groups Based On list. For example, if you select gender as the first grouping variable
and minority as the second grouping variable, cases will be grouped by minority
classification within each gender category.
You can specify up to eight grouping variables.
Each eight characters of a long string variable (string variables longer than eight
characters) counts as a variable toward the limit of eight grouping variables.
Cases should be sorted by values of the grouping variables and in the same order
that variables are listed in the Groups Based On list. If the data file isn't already
sorted, select Sort the file by grouping variables.
Figure 8-8
Split File dialog box
Compare groups. Split-file groups are presented together for comparison purposes. For
pivot tables, a single pivot table is created and each split-file variable can be moved
between table dimensions. For charts, a separate chart is created for each split-file
group and the charts are displayed together in the Viewer.
166
Chapter 8
Organize output by groups. All results from each procedure are displayed separately
for each split-file group.
Select Cases
Select Cases provides several methods for selecting a subgroup of cases based on
criteria that include variables and complex expressions. You can also select a random
sample of cases. The criteria used to define a subgroup can include:
Variable values and ranges
Date and time ranges
Case (row) numbers
Arithmetic expressions
Logical expressions
Functions
167
Figure 8-9
Select Cases dialog box
All cases. Turns case filtering off and uses all cases.
If condition is satisfied. Use a conditional expression to select cases. If the result of
the conditional expression is true, the case is selected. If the result is false or missing,
the case is not selected.
Random sample of cases. Selects a random sample based on an approximate
percentage or an exact number of cases.
Based on time or case range. Selects cases based on a range of case numbers or
a range of dates/times.
Use filter variable. Use the selected numeric variable from the data file as the filter
variable. Cases with any value other than 0 or missing for the filter variable are
selected.
168
Chapter 8
Unselected Cases. You can filter or delete cases that do not meet the selection criteria.
Filtered cases remain in the data file but are excluded from analysis. Select Cases
creates a filter variable, filter_$, to indicate filter status. Selected cases have a value
of 1; filtered cases have a value of 0. Filtered cases are also indicated with a slash
through the row number in the Data Editor. To turn filtering off and include all
cases in your analysis, select All cases.
Deleted cases are removed from the data file and cannot be recovered if you save the
data file after deleting the cases.
Select Cases: If
This dialog box allows you to select subsets of cases using conditional expressions. A
conditional expression returns a value of true, false, or missing for each case.
169
Figure 8-10
Select Cases If dialog box
Chapter 8
Figure 8-11
Select Cases Random Sample dialog box
Figure 8-12
Select Cases Range dialog box for range of cases (no defined date variables)
Figure 8-13
Select Cases Range dialog box for time series data with defined date variables
Weight Cases
Weight Cases gives cases different weights (by simulated replication) for statistical
analysis.
The values of the weighting variable should indicate the number of observations
represented by single cases in your data file.
172
Chapter 8
Cases with zero, negative, or missing values for the weighting variable are
excluded from analysis.
Fractional values are valid; they are used exactly where this is meaningful and
most likely where cases are tabulated.
Figure 8-14
Weight Cases dialog box
Once you apply a weight variable, it remains in effect until you select another weight
variable or turn off weighting. If you save a weighted data file, weighting information
is saved with the data file. You can turn off weighting at any time, even after the
file has been saved in weighted form.
Weights in Crosstabs. The Crosstabs procedure has several options for handling
case weights. For more information, see “Crosstabs Cell Display” in Chapter 16
on page 313.
Weights in scatterplots and histograms. Scatterplots and histograms have an option for
turning case weights on and off, but this does not affect cases with a zero, negative, or
missing value for the weight variable. These cases remain excluded from the chart
even if you turn weighting off from within the chart.
To Weight Cases
E From the menus choose:
Data
Weight Cases...
The values of the frequency variable are used as case weights. For example, a case
with a value of 3 for the frequency variable will represent three cases in the weighted
data file.
Restructuring Data
Use the Restructure Data Wizard to restructure your data for the SPSS procedure
that you want to use. The wizard replaces the current file with a new, restructured
file. The wizard can:
Restructure selected variables into cases.
Restructure selected cases into variables.
Transpose all data.
To Restructure Data
E From the menus choose:
Data
Restructure...
Chapter 8
Restructure selected variables into cases. Choose this when you have groups of
related columns in your data and you want them to appear in groups of rows
in the new data file.
If you choose this, the wizard will display the steps for Variables to Cases.
Restructure selected cases into variables. Choose this when you have groups of
related rows in your data and you want them to appear in groups of columns
in the new data file.
175
If you choose this, the wizard will display the steps for Cases to Variables.
Transpose all data. Choose this when you want to transpose your data. All
rows will become columns and all columns will become rows in the new data.
This choice closes the Restructure Data Wizard and opens the Transpose Data
dialog box.
How are the data arranged in the current file? The current data may be arranged so that
factors are recorded in a separate variable (in groups of cases) or with the variable
(in groups of variables).
Groups of cases. Does the current file have variables and conditions recorded
in separate columns? For example:
var factor
8 1
9 1
176
Chapter 8
3 2
1 2
In this example, the first two rows are a case group because they are related. They
contain data for the same factor level. In SPSS data analysis, the factor is often
referred to as a grouping variable when the data are structured this way.
Groups of columns. Does the current file have variables and conditions recorded
in the same column? For example:
var_1 var_2
8 3
9 1
In this example, the two columns are a variable group because they are related. They
contain data for the same variable—var_1 for factor level 1 and var_2 for factor
level 2. In SPSS data analysis, the factor is often referred to as a repeated measure
when the data are structured this way.
How should the data be arranged in the new file? This is usually determined by the
procedure that you want to use to analyze your data.
Procedures that require groups of cases. Your data must be structured in case
groups to do analyses that require a grouping variable. Examples are univariate,
multivariate, and variance components with General Linear Model; Mixed
Models; OLAP Cubes; and independent samples with T Test or Nonparametric
Tests. If your current data structure is variable groups and you want to do these
analyses, select Restructure selected variables into cases.
Procedures that require groups of variables. Your data must be structured in
variable groups to analyze repeated measures. Examples are repeated measures
with General Linear Model, time-dependent covariate analysis with Cox
Regression Analysis, paired samples with T Test, or related samples with
Nonparametric Tests. If your current data structure is case groups and you want
to do these analyses, select Restructure selected cases into variables.
In this example, test scores are recorded in separate columns for each factor, A and B.
177
Figure 8-16
Current data for variables to cases
You want to do an independent samples t test. You have a column group consisting of
score_a and score_b, but you don't have the grouping variable that the procedure
requires. Select Restructure selected variables into cases in the Restructure Data
Wizard, restructure one variable group into a new variable named score, and create an
index named group. The new data file is shown in the following figure.
Figure 8-17
New, restructured data for variables to cases
When you run the independent samples t test, you can now use group as the grouping
variable.
In this example, test scores are recorded twice for each subject, before and after
a treatment.
Figure 8-18
Current data for cases to variables
178
Chapter 8
You want to do a paired samples t test. Your data structure is case groups, but you
don't have the repeated measures for the paired variables that the procedure requires.
Select Restructure selected cases into variables in the Restructure Data Wizard, use
id to identify the row groups in the current data, and use time to create the variable
group in the new file.
Figure 8-19
New, restructured data for cases to variables
When you run the paired samples t test, you can now use bef and aft as the variable
pair.
In this step, decide how many variable groups in the current file that you want
to restructure in the new file.
How many variable groups are in the current file? Think about how many variable
groups exist in the current data. A group of related columns, called a variable group,
records repeated measures of the same variable in separate columns. For example, if
you have three columns in the current data—w1, w2, and w3—that record width,
you have one variable group. If you have an additional three columns—h1, h2, and
h3—that record height, you have two variable groups.
How many variable groups should be in the new file? Consider how many variable
groups you want to have represented in the new data file. You do not have to
restructure all variable groups into the new file.
179
Figure 8-20
Restructure Data Wizard: Number of Variable Groups
One. The wizard will create a single restructured variable in the new file from
one variable group in the current file.
More than one. The wizard will create multiple restructured variables in the new
file. The number that you specify affects the next step, in which the wizard
automatically creates the specified number of new variables.
Chapter 8
In this step, provide information about how the variables in the current file should
be used in the new file. You can also create a variable that identifies the rows in
the new file.
Figure 8-21
Restructure Data Wizard: Select Variables
How should the new rows be identified? You can create a variable in the new data file
that identifies the row in the current data file that was used to create a group of new
rows. The identifier can be a sequential case number or it can be the values of the
variable. Use the controls in Case Group Identification to define the identification
variable in the new file. Click a cell to change the default variable name and provide a
descriptive variable label for the identification variable.
What should be restructured in the new file? In the previous step, you told the
wizard how many variable groups you want to restructure. The wizard created one
new variable for each group. The values for the variable group will appear in that
181
variable in the new file. Use the controls in Variables to be Transposed to define
the restructured variable in the new file.
E Put the variables that make up the variable group that you want to transform into the
Variables to be Transposed list. All of the variables in the group must be of the
same type (numeric or string).
You can include the same variable more than once in the variable group (variables are
copied rather than moved from the source variable list); its values are repeated in
the new file.
E Select the first target variable that you want to define from the Target Variable
drop-down list.
E Put the variables that make up the variable group that you want to transform into the
Variables to be Transposed list. All of the variables in the group must be of the same
type (numeric or string). You can include the same variable more than once in the
variable group. (A variable is copied rather than moved from the source variable list,
and its values are repeated in the new file.)
E Select the next target variable that you want to define, and repeat the variable selection
process for all available target variables.
Although you can include the same variable more than once in the same target
variable group, you cannot include the same variable in more than one target
variable group.
Each target variable group list must contain the same number of variables.
(Variables that are listed more than once are included in the count.)
The number of target variable groups is determined by the number of variable
groups that you specified in the previous step. You can change the default
variable names here, but you must return to the previous step to change the
number of variable groups to restructure.
You must define variable groups (by selecting variables in the source list) for all
available target variables before you can proceed to the next step.
182
Chapter 8
What should be copied into the new file? Variables that aren't restructured can be
copied into the new file. Their values will be propagated in the new rows. Move
variables that you want to copy into the new file into the Fixed Variable(s) list.
In this step, decide whether to create index variables. An index is a new variable that
sequentially identifies a row group based on the original variable from which the
new row was created.
Figure 8-22
Restructure Data Wizard: Create Index Variables
183
How many index variables should be in the new file? Index variables can be used as
grouping variables in SPSS procedures. In most cases, a single index variable is
sufficient; however, if the variable groups in your current file reflect multiple factor
levels, multiple indices may be appropriate.
One. The wizard will create a single index variable.
More than one. The wizard will create multiple indices and enter the number of
indices that you want to create. The number that you specify affects the next step,
in which the wizard automatically creates the specified number of indices.
None. Select this if you do not want to create index variables in the new file.
In the current data, there is one variable group, width, and one factor, time. Width was
measured three times and recorded in w1, w2, and w3.
Figure 8-23
Current data for one index
We'll restructure the variable group into a single variable, width, and create a single
numeric index. The new data are shown in the following table.
Figure 8-24
New, restructured data with one index
Index starts with 1 and increments for each variable in the group. It restarts each
time a new row is encountered in the original file. We can now use index in SPSS
procedures that require a grouping variable.
184
Chapter 8
When a variable group records more than one factor, you can create more than one
index; however, the current data must be arranged so that the levels of the first factor
are a primary index within which the levels of subsequent factors cycle. In the current
data, there is one variable group, width, and two factors, A and B. The data are
arranged so that levels of factor B cycle within levels of factor A.
Figure 8-25
Current data for two indices
We'll restructure the variable group into a single variable, width, and create two
indices. The new data are shown in the following table.
Figure 8-26
New, restructured data with two indices
In this step, decide what values you want for the index variable. The values can be
sequential numbers or the names of the variables in an original variable group. You
can also specify a name and a label for the new index variable.
185
Figure 8-27
Restructure Data Wizard: Create One Index Variable
For more information, see “Example of One Index for Variables to Cases” on page
183.
Sequential numbers. The wizard will automatically assign sequential numbers
as index values.
Variable names. The wizard will use the names of the selected variable group as
index values. Choose a variable group from the list.
Names and labels. Click a cell to change the default variable name and provide
a descriptive variable label for the index variable.
Chapter 8
In this step, specify the number of levels for each index variable. You can also specify
a name and a label for the new index variable.
Figure 8-28
Restructure Data Wizard: Create Multiple Index Variables
For more information, see “Example of Two Indices for Variables to Cases” on
page 184.
How many levels are recorded in the current file? Consider how many factor levels
are recorded in the current data. A level defines a group of cases that experienced
identical conditions. If there are multiple factors, the current data must be arranged
so that the levels of the first factor are a primary index within which the levels of
subsequent factors cycle.
How many levels should be in the new file? Enter the number of levels for each index.
The values for multiple index variables are always sequential numbers. The values
start at 1 and increment for each level. The first index increments the slowest, and the
last index increments the fastest.
187
Total combined levels. You cannot create more levels than exist in the current
data. Because the restructured data will contain one row for each combination of
treatments, the wizard checks the number of levels that you create. It will compare
the product of the levels that you create to the number of variables in your variable
groups. They must match.
Names and labels. Click a cell to change the default variable name and provide a
descriptive variable label for the index variables.
Chapter 8
Figure 8-29
Restructure Data Wizard: Options
Drop unselected variables? In the select variables step (step 3), you selected variable
groups to be restructured, variables to be copied, and an identification variable from
the current data. The data from the selected variables will appear in the new file. If
there are other variables in the current data, you can choose to discard or keep them.
Keep missing data? The wizard checks each potential new row for null values. A null
value is a system-missing or blank value. You can choose to keep or discard rows
that contain only null values.
Create a count variable? The wizard can create a count variable in the new file. It
contains the number of new rows generated by a row in the current data. A count
variable may be useful if you choose to discard null values from the new file because
that makes it possible to generate a different number of new rows for a given row
189
in the current data. Click a cell to change the default variable name and provide a
descriptive variable label for the count variable.
In this step, provide information about how the variables in the current file should
be used in the new file.
Figure 8-30
Restructure Data Wizard: Select Variables
What identifies case groups in the current data? A case group is a group of rows
that are related because they measure the same observational unit—for example,
an individual or an institution. The wizard needs to know which variables in the
190
Chapter 8
current file identify the case groups so that it can consolidate each group into a
single row in the new file. Move variables that identify case groups in the current
file into the Identifier Variable(s) list. Variables that are used to split the current data
file are automatically used to identify case groups. Each time a new combination
of identification values is encountered, the wizard will create a new row, so cases
in the current file should be sorted by values of the identification variables, in the
same order that variables are listed in the Identifier Variable(s) list. If the current data
file isn't already sorted, you can sort it in the next step.
How should the new variable groups be created in the new file? In the original data, a
variable appears in a single column. In the new data file, that variable will appear
in multiple new columns. Index variables are variables in the current data that the
wizard should use to create the new columns. The restructured data will contain one
new variable for each unique value in these columns. Move the variables that should
be used to form the new variable groups to the Index Variable(s) list. When the wizard
presents options, you can also choose to order the new columns by index.
What happens to the other columns? The wizard automatically decides what to do
with the variables that remain in the Current File list. It checks each variable to see
if the data values vary within a case group. If they do, the wizard restructures the
values into a variable group in the new file. If they don't, the wizard copies the
values into the new file.
In this step, decide whether to sort the current file before restructuring it. Each
time the wizard encounters a new combination of identification values, a new row
is created, so it is important that the data are sorted by the variables that identify
case groups.
191
Figure 8-31
Restructure Data Wizard: Sort Data
How are the rows ordered in the current file? Consider how the current data are sorted
and which variables you are using to identify case groups (specified in the previous
step).
Yes. The wizard will automatically sort the current data by the identification
variables, in the same order that variables are listed in the Identifier Variable(s) list
in the previous step. Choose this when the data aren't sorted by the identification
variables or when you aren't sure. This choice requires a separate pass of the
data, but it guarantees that the rows are correctly ordered for restructuring.
No. The wizard will not sort the current data. Choose this when you are sure that
the current data are sorted by the variables that identify case groups.
192
Chapter 8
How should the new variable groups be ordered in the new file?
By variable. The wizard groups the new variables created from an original
variable together.
By index. The wizard groups the variables according to the values of the index
variables.
193
Example. The variables to be restructured are w and h, and the index is month:
w h month
Create a count variable? The wizard can create a count variable in the new file. It
contains the number of rows in the current data that were used to create a row in
the new data file.
Create indicator variables? The wizard can use the index variables to create indicator
variables in the new data file. It creates one new variable for each unique value of the
index variable. The indicator variables signal the presence or absence of a value for a
case. An indicator variable has the value of 1 if the case has a value; otherwise, it is 0.
Example. The index variable is product. It records the products that a customer
purchased. The original data are:
customer product
1 chick
1 eggs
2 eggs
3 chick
Creating an indicator variable results in one new variable for each unique value
of product. The restructured data are:
customer indchick indeggs
1 1 1
2 0 1
3 1 0
194
Chapter 8
In this example, the restructured data could be used to get frequency counts of the
products that customers buy.
Restructure now. The wizard will create the new, restructured file. Choose this
if you want to replace the current file immediately. Note: If original data are
weighted, the new data will be weighted unless the variable that is used as the
weight is restructured or dropped from the new file.
Paste syntax. The wizard will paste the syntax it generates into a syntax window.
Choose this when you are not ready to replace the current file, when you want to
modify the syntax, or when you want to save it for future use.
Chapter
9
Working with Output
When you run a procedure, the results are displayed in a window called the Viewer. In
this window, you can easily navigate to whichever part of the output that you want to
see. You can also manipulate the output and create a document that contains precisely
the output that you want, arranged and formatted appropriately.
Viewer
Results are displayed in the Viewer. You can use the Viewer to:
Browse results.
Show or hide selected tables and charts.
Change the display order of results by moving selected items.
Move items between the Viewer and other applications.
197
198
Chapter 9
Figure 9-1
Viewer
Double-click
a book icon
to show or
hide an item
Click to
expand or
collapse the
outlIne view
E On the General tab, click Draft Viewer for the output type.
E To change the format options for Draft Viewer output, click the Draft Viewer tab.
or
or
Chapter 9
The open book (Show) icon becomes the active icon, indicating that the item is
now hidden.
E Click the box to the left of the procedure name in the outline pane.
This hides all of the results from the procedure and collapses the outline view.
E Click an item in the outline or contents pane to select it. (Shift-click to select multiple
items, or Ctrl-click to select noncontiguous items.)
E Use the mouse to click and drag selected items (hold down the mouse button while
dragging).
E Release the mouse button on the item just above the location where you want to
drop the moved items.
You can also move items by using Cut and Paste After on the Edit menu.
E Click an item in the outline or contents pane to select it. (Shift-click to select multiple
items, or Ctrl-click to select noncontiguous items.)
201
E Press Delete.
or
E Click items in the outline or contents pane to select them. (Shift-click to select
multiple items, or Ctrl-click to select noncontiguous items.)
E Hold down the Ctrl key while you use the mouse to click and drag selected items
(hold down the mouse button while dragging).
E Release the mouse button to drop the items where you want them.
You can also copy items by using Copy and Paste After on the Edit menu or the
context menu.
Changing Alignment
By default, all results are initially left-aligned. You can change the initial alignment
(choose Options on the Edit menu, then click the Viewer tab) or the alignment of
selected items at any time.
Chapter 9
Note: All results are displayed left-aligned in the Viewer. Only the alignment of
printed results is affected by the alignment settings. Centered and right-aligned items
are identified by a small symbol above and to the left of the item.
Viewer Outline
The outline pane provides a table of contents of the Viewer document. You can use
the outline pane to navigate through your results and control the display. Most actions
in the outline pane have a corresponding effect on the contents pane.
Selecting an item in the outline pane selects and displays the corresponding item
in the contents pane.
Moving an item in the outline pane moves the corresponding item in the contents
pane.
Collapsing the outline view hides the results from all items in the collapsed levels.
Figure 9-2
Collapsed outline view and hidden results
Controlling the outline display. To control the outline display, you can:
Expand and collapse the outline view.
Change the outline level for selected items.
Change the size of items in the outline display.
Change the font used in the outline display.
E Click the box to the left of the outline item that you want to collapse or expand.
or
or
View
Expand
E Click the left arrow on the Outlining toolbar to promote the item (move the item
to the left).
E Click the right arrow on the Outlining toolbar to demote the item (move the item
to the right).
or
From the menus choose:
Edit
Outline
Promote
204
Chapter 9
or
Edit
Outline
Demote
Changing the outline level is particularly useful after you move items in the outline
level. Moving items can change the outline level of the selected items, and you can
use the left and right arrow buttons on the Outlining toolbar to restore the original
outline level.
E Select a font.
In the Viewer, you can add items such as titles, new text, charts, or material from
other applications.
Text items that are not connected to a table or chart can be added to the Viewer.
205
E Click the table, chart, or other object that will precede the title or text.
or
Insert
New Text
Inserting a Chart
Charts from older versions of SPSS can be inserted into the Viewer. To insert a chart:
E Click the table, chart, or other object that will precede the chart.
E In either the outline or the contents pane of the Viewer, click the table, chart, or
other object that will precede the text.
Chapter 9
or
Edit
Paste Special...
E Run the file objs-on.bat, located in the directory in which the program is installed.
(Double-click the file to run it.)
This turns on ActiveX embedding for pivot tables. The file objs-off.bat turns ActiveX
embedding off.
Chapter 9
E From the list select SPSS Pivot Table ObjectorSPSS Graphics Control Object.
The target application must support ActiveX objects. See the application's
documentation for information on ActiveX support. Some applications that do not
support ActiveX may initially accept ActiveX pivot tables but may then exhibit
unstable behavior. Do not rely on embedded objects until you have tested the
application's stability with embedded ActiveX objects.
The item is pasted as a metafile. Only the layer and columns that were visible when
the item was copied are available in the metafile. Other layers or hidden columns
are not available.
E From the list select Formatted Text (RTF) or Rich Text Format.
The pivot table is pasted as a table. Only the layer and columns that were visible
when the item was copied are pasted into the table. Other layers or hidden columns
are not available. You can copy and paste only one pivot table at a time in this format.
209
Unformatted pivot table text contains tabs between columns. You can align columns
by adjusting the tab stops in the other application.
Note: Use Copy Objects only to copy multiple items from the Viewer to another
application. For copying and pasting within Viewer documents (for example, between
two Viewer windows), use Copy on the Edit menu.
Chapter 9
Paste Special
Paste Special allows you to select the format of a copied object that is pasted into the
Viewer. The possible file types for the object on the clipboard are listed. The object
will be inserted in the Viewer following the currently selected object.
Figure 9-3
Paste Special dialog box
E In either the outline or the contents pane of the Viewer, click the table, chart, or
other object that will precede the object.
Export Output
Export Output saves pivot tables and text output in HTML, text, Word/RTF, and Excel
format, and it saves charts in a variety of common formats used by other applications.
211
Output Document. Exports any combination of pivot tables, text output, and charts.
For HTML and text formats, charts are exported in the currently selected chart
export format. For HTML document format, charts are embedded by reference,
and you should export charts in a suitable format for inclusion in HTML
documents. For text document format, a line is inserted in the text file for each
chart, indicating the filename of the exported chart.
For Word/RTF format, charts are exported in Windows metafile format and
embedded in the Word document.
Charts are not included in Excel documents.
Output Document (No Charts). Exports pivot tables and text output. Any charts in
the Viewer are ignored.
Charts Only. Available export formats include: Windows metafile (WMF), Windows
bitmap (BMP), encapsulated PostScript (EPS), JPEG, TIFF, PNG, and Macintosh
PICT.
Export What. You can export all objects in the Viewer, all visible objects, or only
selected objects.
Export Format. For output documents, the available options are HTML, text,
Word/RTF, and Excel; for HTML and text format, charts are exported in the currently
selected chart format in the Options dialog box for the selected format. For Charts
Only, select a chart export format from the drop-down list. For output documents,
pivot tables and text are exported in the following manner:
HTML file (*.htm). Pivot tables are exported as HTML tables. Text output is
exported as preformatted HTML.
Text file (*.txt). Pivot tables can be exported in tab-separated or space-separated
format. All text output is exported in space-separated format.
Excel file (*.xls). Pivot table rows, columns, and cells are exported as Excel rows,
columns, and cells, with all formatting attributes—for example, cell borders, font
styles, background colors, etc. Text output is exported with all font attributes.
Each line in the text output is a row in the Excel file, with the entire contents
of the line contained in a single cell.
Word/RTF file (*.doc). Pivot tables are exported as Word tables with all formatting
attributes—for example, cell borders, font styles, background colors, etc. Text
output is exported as formatted RTF. Text output in SPSS is always displayed in
212
Chapter 9
a fixed-pitch font and is exported with the same font attributes. A fixed-pitch
(monospaced) font is required for proper alignment of space-separated text
output.
Exporting Output
E Make the Viewer the active window (click anywhere in the window).
E Enter a filename (or prefix for charts) and select an export format.
Figure 9-4
Export Output dialog box
213
Figure 9-5
Output exported in HTML format
Chapter 9
Image Format. Controls the chart export format and optional settings, including chart
size for HTML documents. For Word/RTF, all charts are exported in Windows
metafile (WMF) format. For Excel, charts are not included.
E Select HTML file or Word/RTF file or Excel file as the export format.
E Click Options.
Text Options
Text Options controls pivot table, text output, and chart format options and the
inclusion of footnotes and captions for documents exported in text format.
Figure 9-6
Text Options dialog box
215
E Click Options.
Chart Size
Chart Size controls the size of exported charts. The custom percentage specification
allows you to decrease or increase the size of the exported chart up to 200%.
216
Chapter 9
Figure 9-7
Export Chart Size dialog box
E For output documents, click Options, select the export format, and click Chart Size.
E For Charts Only, select the export format, and click Chart Size.
Progressive encoding. Enables the image to load in stages, initially displaying at low
resolution and then increasing in quality as the image continues to load.
Compression Quality Setting. Controls the ratio of compression to image quality. The
higher the image quality, the larger the exported file size.
Color Operations.The following operations are available:
Invert. Each pixel is saved as the inverse of the original color.
Gamma correction. Adjusts the intensity of colors in the exported chart by
changing the gamma constant that is used to map the intensity values. Basically,
it can be used to lighten and darken the bitmapped image. The value can range
from 0.10 (darkest) to 6.5 (lightest).
Chapter 9
Transparency. Allows you to select a color that will appear transparent in the exported
chart. Available only with 32-bit true color export. Enter integer values between 0
and 255 for each color. The default value for each color is 255, creating a default
transparent color of white.
Format. (TIFF only) allows you to set the color space and compress the exported
chart. All color depths are available with RGB color. Only 24- and 32-bit true color is
available with CMYK. With the YCbCr option, only 24-bit true color is available.
TrueType Fonts. Allows the user to select how TrueType fonts are saved in the EPS
image.
Embed as native TrueType (Level 3). Embeds most of the font data into the EPS,
including font hints (for example, good for scaling at small sizes). The resulting
PostScript font is called a Type 42 font. Note: Not all PostScript printers have
Level 3 drivers that can read Type 42 fonts.
Convert to PostScript fonts. Converts TrueType fonts to PostScript (Type 1) fonts
based on font family. For example, Times New Roman is converted to Times,
and Arial is converted to Helvetica. Note: This format is not recommended for
interactive graphics that use the SPSS marker font (for example, scatterplots),
because there are no meaningful PostScript equivalents for the SPSS TrueType
marker symbols.
Replace TrueType fonts with curves. Turns TrueType fonts into PostScript curve
data. The text itself is no longer editable as text in applications that can edit EPS
graphics. There is also a loss of quality, but this option is useful if you have a
PostScript printer that doesn't support Type 42 fonts and you need to preserve
special TrueType symbols, such as the markers used in interactive scatterplots.
E For output documents, click Options, select the export format, and click Chart Options.
E For Charts Only, select the export format, and click Options.
220
Chapter 9
Viewer Printing
You can control the Viewer items that print in several ways:
All visible output. Prints only items currently displayed in the contents pane. Hidden
items (items with a closed book icon in the outline pane or hidden in collapsed
outline layers) are not printed.
All output. Prints all output, including hidden items.
Selection. Prints only items currently selected in the outline and/or contents panes.
Figure 9-8
Viewer Print dialog box
E Click OK to print.
Print Preview
Print Preview shows you what will print on each page for Viewer documents. It
is usually a good idea to check Print Preview before actually printing a Viewer
document because Print Preview shows you items that may not be visible simply by
looking at the contents pane of the Viewer, including:
Page breaks
Hidden layers of pivot tables
Breaks in wide tables
Complete output from large tables
Headers and footers printed on each page
222
Chapter 9
Figure 9-9
Print Preview
If any output is currently selected in the Viewer, the preview displays only the selected
output. To view a preview for all output, make sure nothing is selected in the Viewer.
E Make the Viewer the active window (click anywhere in the window).
Page Setup
With Page Setup, you can control:
Paper size and orientation
Page margins
Page headers and footers
Page numbering
Printed size for charts
Figure 9-10
Page Setup dialog box
Page Setup settings are saved with the Viewer document. Page Setup affects settings
for printing Viewer documents only. These settings have no effect on printing data
from the Data Editor or syntax from a syntax window.
224
Chapter 9
E Make the Viewer the active window (click anywhere in the window).
Headers and footers are the information that prints at the top and bottom of each page.
You can enter any text that you want to use as headers and footers. You can also use
the toolbar in the middle of the dialog box to insert:
Date and time
Page numbers
Viewer filename
Outline heading labels
Page titles and subtitles
225
Figure 9-11
Page Setup Options Header/Footer tab
Outline heading labels indicate the first-, second-, third-, and/or fourth-level outline
heading for the first item on each page.
Page titles and subtitles print the current page titles and subtitles. Page titles and
subtitles are created with Insert New Page Title on the Viewer Insert menu or the
TITLE and SUBTITLE commands in command syntax. If you have not specified any
page titles or subtitles, this setting is ignored.
Note: Font characteristics for new page titles and subtitles are controlled on the
Viewer tab of the Options dialog box (Edit menu). Font characteristics for existing
page titles and subtitles can be changed by editing the titles in the Viewer.
Use Print Preview on the File menu to see how your headers and footers will look on
the printed page.
226
Chapter 9
This dialog box controls printed chart size, space between printed output items,
and page numbering.
Printed Chart Size. Controls the size of the printed chart relative to the defined page
size. The chart's aspect ratio (width-to-height ratio) is not affected by the printed chart
size. The overall printed size of a chart is limited by both its height and width. Once
the outer borders of a chart reach the left and right borders of the page, the chart size
cannot increase further to fill additional page height.
Space between items. Controls the space between printed items. Each pivot table,
chart, and text object is a separate item. This setting does not affect the display
of items in the Viewer.
Number pages starting with. Numbers pages sequentially starting with the specified
number.
Figure 9-12
Page Setup Options tab
227
Saving Output
The contents of the Viewer can be saved to a Viewer document. The saved document
includes both panes of the Viewer window (the outline and the contents).
To save results in external formats (for example, HTML or text), use Export on the
File menu. (This is not available in the standalone SmartViewer.)
Chapter 9
E Click Save.
Note: Leave the OEM Code blank unless you have a contractual agreement with
SPSS Inc. to redistribute the Smart Viewer.
Chapter
10
Draft Viewer
Text output in the Draft Viewer can be edited, charts can be resized, and both text
output and charts can be pasted into other applications. However, charts cannot be
edited, and the interactive features of pivot tables and charts are not available.
229
230
Chapter 10
Figure 10-1
Draft Viewer window
E To make draft output the default output type, from the menus choose:
Edit
Options...
Draft Viewer
Note: New output is always displayed in the designated Viewer window. If you have
both a Viewer and a Draft Viewer window open, the designated window is the
one opened most recently or the one designated with the Designate Window tool
(the exclamation point) on the toolbar.
Chapter 10
Figure 10-2
Draft Viewer Options
Column width. To reduce the width of tables that contain long labels, select Maximum
characters under Column width. Labels longer than the specified width are wrapped
to fit the maximum width.
233
Draft Viewer
Figure 10-3
Draft output before and after setting maximum column width
Row and column separators. As an alternative to box characters for row and column
borders, you can use the Cell Separators settings to control the row and column
separators displayed in new draft output. You can specify different cell separators or
enter blank spaces if you don't want any characters used to mark rows and columns.
You must deselect Display Box Character to specify cell separators.
234
Chapter 10
Figure 10-4
Draft output before and after setting cell separators
Draft Viewer
Figure 10-5
Tab-separated output in the Draft Viewer and formatted in a word processor
E Click OK or Apply.
236
Chapter 10
Draft Viewer output display options affect only new output produced after you
change the settings. Output already displayed in the Draft Viewer is not affected
by changes in these settings.
E Select the font attributes that you want to apply to the selected text.
E To print only a selected portion of the draft output, select the output that you want
to print.
Draft Viewer
E Select Selection.
Output that is too wide for the page is truncated, not printed on another page. There
are several things that you can do to prevent wide output from being truncated:
Use a smaller font size (Format menu, Fonts).
Select Landscape for the page orientation (File menu, Page Setup).
For new output, specify a narrow maximum column width (Edit menu, Options,
Draft Viewer tab).
For long tables, use page breaks (Insert menu, Page Break) to control where the table
breaks between pages.
Chapter 10
You can export all text or just the selected text. Only text output (converted pivot
table output and text output) is saved in the exported files; charts are not included.
Chapter
11
Pivot Tables
Many of the results in the Viewer are presented in tables that can be pivoted
interactively. That is, you can rearrange the rows, columns, and layers.
239
240
Chapter 11
E Hover over each icon with the mouse pointer for a ToolTip pop-up that tells you
which table dimension the icon represents.
Figure 11-1
Pivoting trays
This changes the arrangement of the table. For example, suppose that the icon
represents a variable with categories Yes and No and you drag the icon from the Row
tray to the Column tray. Before the move, Yes and No were row labels; after the
move, they are column labels.
241
Pivot Tables
E If pivoting trays are not on, from the Pivot Table menus choose:
Pivot
Pivoting Trays
This has the same effect as dragging all of the row icons into the Column tray and all
of the column icons into the Row tray.
E If pivoting trays are not already on, from the Pivot Table menus choose:
Pivot
Pivoting Trays
E Drag the icons in each tray to the order you want (left to right or top to bottom).
E Click the label for the row or column you want to move.
242
Chapter 11
Note: Make sure that Drag to Copy on the Edit menu is not enabled (checked).
If Drag to Copy is enabled, deselect it.
E Select the labels for the rows or columns you want to group together (click and drag
or Shift-click to select multiple labels).
A group label is automatically inserted. Double-click the group label to edit the
label text.
Figure 11-2
Row and column groups and labels
Column Group Label
Female Male Total
Row Clerical 206 157 363
Group Custodial 27 27
Label Manager 10 74 84
Note: To add rows or columns to an existing group, you must first ungroup the items
currently in the group; then create a new group that includes the additional items.
E Select the group label (click anywhere in the group label) for the rows or columns
you want to ungroup.
243
Pivot Tables
or
Rotate OuterRow Labels
Figure 11-3
Rotated column labels
Valid Cumulative
Frequency Percent Percent Percent
Clerical 363 76.6 76.6 76.6
Custodial 27 5.7 5.7 82.3
Manager 84 17.7 17.7 100.0
Valid Percent
Cumulative
Frequency
Only the innermost column labels and the outermost row labels can be rotated.
Chapter 11
This resets only changes that are the result of pivoting row, column, and layer
elements between dimensions. It does not affect changes such as grouping or
ungrouping or moving rows and columns.
You must click your right mouse button on the label cell itself, rather than on the
data cells in the row or column.
Context-sensitive Help is not available for user-defined labels, such as variable
names or value labels.
E Drag an icon from the Row tray or the Column tray into the Layer tray.
245
Pivot Tables
Figure 11-4
Moving categories into layers
Minority pivoted from row
to layer dimension
Each layer icon has left and right arrows. The visible table is the table for the top layer.
Figure 11-5
Categories in separate layers
Minority classification: Yes
Minority classification: No
To Change Layers
E Click one of the layer icon arrows.
or
Chapter 11
Figure 11-6
Selecting layers from drop-down lists
Go to Layer Category
Go to Layer Category allows you to change layers in a pivot table. This dialog
box is particularly useful when there are a large number of layers or one layer has
many categories.
To Go to a Table Layer
E From the Pivot Table menus choose:
Pivot
Go to Layer...
247
Pivot Tables
Figure 11-7
Go to Layer Category dialog box
E Select a layer dimension in the Visible Category list. The Categories list will display
all categories for the selected dimension.
E Select the category you want in the Categories list and click OK. This changes the
layer and closes the dialog box.
To view another layer without closing the dialog box:
or
Chapter 11
You can also move layers to rows or columns by dragging their icons between the
Layer, Row, and Column pivoting trays.
Bookmarks
Bookmarks allow you to save different views of a pivot table. Bookmarks save:
Placement of elements in row, column, and layer dimensions
Display order of elements in each dimension
Currently displayed layer for each layer element
E Enter a name for the bookmark. Bookmark names are not case sensitive.
E Click Add.
Each pivot table has its own set of bookmarks. Within a pivot table, each bookmark
name must be unique, but you can use duplicate bookmark names in different pivot
tables.
Pivot Tables
E Click Go To.
E Click Rename.
E Click OK.
or
Chapter 11
For example, if the Female category of the Gender dimension is hidden, click the
Male category.
This displays all hidden cells in the table. (If Hide empty rows and columns is selected
in Table Properties for this table, a completely empty row or column remains hidden.)
E Select the dimension label or any category label within the dimension.
Pivot Tables
Editing Results
The appearance and contents of each table or text output item can be edited. You can:
Apply a TableLook.
Change the properties of the current table.
Change the properties of cells in the table.
Modify text.
Add footnotes and captions to tables.
Add items to the Viewer.
Copy and paste results into other applications.
Chapter 11
TableLooks
A TableLook is a set of properties that define the appearance of a table. You can
select a previously defined TableLook or create your own.
Before or after a TableLook is applied, you can change cell formats for individual
cells or groups of cells, using cell properties. The edited cell formats will remain,
even when you apply a new TableLook.
For example, you might start by applying TableLook 9POINT, then select a data
column, and from the Cell Formats dialog box, change to a bold font for that column.
Later, you change the TableLook to BOXED. The previously selected column retains
the bold font while the rest of the characteristics are applied from the BOXED
TableLook.
Optionally, you can reset all cells to the cell formats defined by the current
TableLook. This resets any cells that have been edited. If As Displayed is selected in
the TableLook files list, any edited cells are reset to the current table properties.
Pivot Tables
Figure 11-8
TableLooks dialog box
E Select a TableLook from the list of files. To select a file from another directory,
click Browse.
E Adjust the table properties for the attributes you want and click OK.
E Click Save Look to save the edited TableLook or Save As to save it as a new TableLook.
Editing a TableLook affects only the selected pivot table. An edited TableLook is not
applied to any other tables that use that TableLook unless you select those tables and
reapply the TableLook.
254
Chapter 11
Table Properties
The Table Properties dialog box allows you to set general properties of a table, set cell
styles for various parts of a table, and save a set of those properties as a TableLook.
Using the tabs on this dialog box, you can:
Control general properties, such as hiding empty rows or columns and adjusting
printing properties.
Control the format and position of footnote markers.
Determine specific formats for cells in the data area, for row and column labels,
and for other areas of the table.
Control the width and color of the lines forming the borders of each area of
the table.
Control printing properties.
E Click OK or Apply.
The new properties are applied to the selected pivot table. To apply new table
properties to a TableLook instead of just the selected table, edit the TableLook
(Format menu, TableLooks).
255
Pivot Tables
E Click OK or Apply.
256
Chapter 11
E Click OK or Apply.
257
Pivot Tables
Cell formats are applied to areas (categories of information). They are not
characteristics of individual cells. This distinction is an important consideration
when pivoting a table.
For example:
If you specify a bold font as a cell format of column labels, the column labels
will appear bold no matter what information is currently displayed in the column
dimension—and if you move an item from the column dimension to another
dimension, it does not retain the bold characteristic of the column labels.
If you make column labels bold simply by highlighting the cells in an activated
pivot table and clicking the Bold button on the toolbar, the contents of those
cells will remain bold no matter what dimension you move them to, and the
column labels will not retain the bold characteristic for other items moved into
the column dimension.
258
Chapter 11
Figure 11-12
Table Properties Cell Formats tab
E Select an area from the drop-down list or click an area of the sample.
E Select characteristics for the area. Your selections are reflected in the sample.
E Click OK or Apply.
Pivot Tables
Figure 11-13
Table Properties Borders tab
E Select a border location, either by clicking its name in the list or by clicking a line
in the Sample area. (Shift-click to select multiple names, or Ctrl-click to select
noncontiguous names.)
E Select a color.
E Click OK or Apply.
260
Chapter 11
E Click OK or Apply.
261
Pivot Tables
Font
A TableLook allows you to specify font characteristics for different areas of the table.
You can also change the font for any individual cell. Options for the font in a cell
include the font type, style, and size. You can also hide the text or underline it.
If you specify font properties in a cell, they apply in all of the table layers that
have the same cell.
Figure 11-14
Font dialog box
Optionally, you can select a font, font style, and point size; whether you want the
text hidden or underlined; a color; and a script style.
262
Chapter 11
E Move the mouse pointer through the category labels until it is on the right border
of the column you want to change. The pointer changes to an arrow with points
on both ends.
E Hold down the mouse button while you drag the border to its new position.
263
Pivot Tables
Figure 11-16
Changing the width of a column
You can change vertical category and dimension borders in the row labels area,
whether or not they are showing.
E Move the mouse pointer through the row labels until you see the double-pointed arrow.
Cell Properties
Cell Properties are applied to a selected cell. You can change the value format,
alignment, margins, and shading. Cell properties override table properties; therefore,
if you change table properties, you do not change any individually applied cell
properties.
Chapter 11
Pivot Tables
You can use this method to suppress or add percent signs and dollar signs, change the
number of decimals displayed, and switch between scientific notation and regular
numeric display.
Chapter 11
As you select the alignment properties for the cell, they are illustrated in the Sample
area.
Pivot Tables
Footnote Marker
Footnote Marker changes the character(s) used to mark a footnote.
268
Chapter 11
Figure 11-21
Footnote Marker dialog box
To Renumber Footnotes
When you have pivoted a table by switching rows, columns, and layers, the footnotes
may be out of order. To renumber the footnotes:
Pivot Tables
or
If the table contains more than one dimension in the row or column area, the
highlighted selection may span multiple noncontiguous cells.
E Press Enter to record your changes, or press Esc to revert to the previous contents of
the cell.
270
Chapter 11
The words Table Caption are displayed at the bottom of the table.
E Select the words Table Caption and enter your caption text over it.
E Select the word Footnote and enter the footnote text over it.
Use Print Preview on the File menu to see how printed pivot tables will look.
Pivot Tables
You can also print each layer of a pivot table on a separate page.
E Click the column label to the left of where you want to insert the break or click the
row label above where you want to insert the break.
E Select the labels of the rows or columns you want to keep together. (Click and drag
or Shift-click to select multiple row or column labels.)
272
Chapter 11
and/or
12
Working with Command Syntax
SPSS provides a powerful command language that allows you to save and automate
many common tasks. It also provides some functionality not found in the menus
and dialog boxes.
Most commands are accessible from the menus and dialog boxes. However, some
commands and options are available only by using the command language. The
command language also allows you to save your jobs in a syntax file so that you can
repeat your analysis at a later date or run it in an automated job with the Production
Facility.
A syntax file is simply a text file that contains commands. While it is possible to
open a syntax window and type in commands, it is often easier if you let the software
help you build your syntax file using one of the following methods:
Pasting command syntax from dialog boxes
Copying syntax from the output log
Copying syntax from the journal file
In the online Help for a given procedure, click the command syntax link in the
Related Topics list to access the syntax diagram for the relevant command. For
complete documentation of the command language, refer to the SPSS Command
Syntax Reference.
Complete command syntax documentation is automatically installed when you
install SPSS. To access the syntax documentation:
273
274
Chapter 12
Syntax Rules
Keep in mind the following simple rules when editing and writing command syntax:
Each command must begin on a new line and end with a period (.).
Most subcommands are separated by slashes (/). The slash before the first
subcommand on a command is usually optional.
Variable names must be spelled out fully.
Text included within apostrophes or quotation marks must be contained on a
single line.
Each line of command syntax cannot exceed 80 characters.
A period (.) must be used to indicate decimals, regardless of your Windows
regional settings.
Variable names ending in a period can cause errors in commands created by
the dialog boxes. You cannot create such variable names in the dialog boxes,
and you should generally avoid them.
Command syntax is case insensitive, and three-letter abbreviations can be used for
many command specifications. You can use as many lines as you want to specify a
single command. You can add space or break lines at almost any point where a
single blank is allowed, such as around slashes, parentheses, arithmetic operators, or
between variable names. For example,
FREQUENCIES
VARIABLES=JOBCAT GENDER
/PERCENTILES=25 50 75
/BARCHART.
and
Production Facility syntax files and INCLUDE files. For command files run via the
Production Facility or the INCLUDE command, the syntax rules are slightly different:
Each command must begin in the first column of a new line.
275
If you generate command syntax by pasting dialog box choices into a syntax window,
the format of the commands is suitable for any mode of operation.
E Click Paste.
The command syntax is pasted to the designated syntax window. If you do not have
an open syntax window, a new syntax window opens automatically, and the syntax is
pasted there.
276
Chapter 12
Figure 12-1
Command syntax pasted from a dialog box
Note: If you open a dialog box from the menus in a script window, code for running
syntax from a script is pasted into the script window.
Figure 12-2
Command syntax in the log
Chapter 12
As you run analyses, the commands for your dialog box selections are recorded in
the log.
E Open a previously saved syntax file or create a new one. To create a new syntax
file, from the menus choose:
File
New
Syntax
E Click and drag the mouse to highlight the syntax that you want to copy.
Figure 12-3
Editing the journal file
E Locate and open the journal file (by default, spss.jnl is located in the temp directory).
Select All files (*.*) for Files of Type or enter *.jnl in the File Name text box to display
journal files in the file list. If you have difficulty locating the file, use Options on the
Edit menu to see where the journal is saved in your system.
E Edit the file to remove any error messages or warnings, indicated by the > sign.
E Save the edited journal file using a different filename. (We recommend that you use a
filename with the extension .sps, the default extension for syntax files.)
Chapter 12
E Click the Run button (the right-pointing triangle) on the Syntax Editor toolbar.
or
The Run button on the Syntax Editor toolbar runs the selected commands or the
command where the cursor is located if there is no selection.
Figure 12-4
Syntax Editor toolbar
Lag Functions
COMPUTE lagvar=LAG(var1)
COMPUTE var1=var1*2
and
COMPUTE lagvar=LAG(var1)
EXECUTE
COMPUTE var1=var1*2
yield very different results for the value of lagvar, since the former uses the
transformed value of var1 while the latter uses the original value.
Chapter
13
Frequencies
The Frequencies procedure provides statistics and graphical displays that are useful
for describing many types of variables. For a first look at your data, the Frequencies
procedure is a good place to start.
For a frequency report and bar chart, you can arrange the distinct values in
ascending or descending order or order the categories by their frequencies. The
frequencies report can be suppressed when a variable has many distinct values. You
can label charts with frequencies (the default) or percentages.
Example. What is the distribution of a company's customers by industry type? From
the output, you might learn that 37.5% of your customers are in government agencies,
24.9%, in corporations, 28.1%, in academic institutions, and 9.4%, in the healthcare
industry. For continuous, quantitative data, such as sales revenue, you might learn
that the average product sale is $3,576 with a standard deviation of $1,078.
Statistics and plots. Frequency counts, percentages, cumulative percentages, mean,
median, mode, sum, standard deviation, variance, range, minimum and maximum
values, standard error of the mean, skewness and kurtosis (both with standard errors),
quartiles, user-specified percentiles, bar charts, pie charts, and histograms.
283
284
Chapter 13
appropriate for quantitative variables that may or may not meet the assumption of
normality.
Sample Output
Figure 13-1
Frequencies output
300
400
300
200
200
100
100
0 0
1,000 3,000 5,000
Government Academic
2,000 4,000
Corporate Healthcare
Amount of Product Sale
Industry
285
Frequencies
Figure 13-2
Frequencies dialog box
Chapter 13
Frequencies Statistics
Figure 13-3
Frequencies Statistics dialog box
Percentile Values. Values of a quantitative variable that divide the ordered data
into groups so that a certain percentage is above and another percentage is below.
Quartiles (the 25th, 50th, and 75th percentiles) divide the observations into four
groups of equal size. If you want an equal number of groups other than four, select
Cut points for n equal groups. You can also specify individual percentiles (for example,
the 95th percentile, the value below which 95% of the observations fall).
Central Tendency. Statistics that describe the location of the distribution include the
mean, median, mode, and sum of all the values.
Mean. A measure of central tendency. The arithmetic average; the sum divided by
the number of cases.
Median. The value above and below which half the cases fall, the 50th percentile.
If there is an even number of cases, the median is the average of the two middle
cases when they are sorted in ascending or descending order. The median is a
measure of central tendency not sensitive to outlying values -- unlike the mean,
which can be affected by a few extremely high or low values.
Mode. The most frequently occurring value. If several values share the greatest
frequency of occurrence, each of them is a mode. The Frequencies procedure
reports only the smallest of such multiple modes.
Sum. The sum or total of the values, across all cases with nonmissing values.
287
Frequencies
Dispersion. Statistics that measure the amount of variation or spread in the data
include the standard deviation, variance, range, minimum, maximum, and standard
error of the mean.
Std. deviation. A measure of dispersion around the mean. In a normal distribution,
68% of cases fall within one SD of the mean and 95% of cases fall within 2 SD.
For example, if the mean age is 45, with a standard deviation of 10, 95% of the
cases would be between 25 and 65 in a normal distribution.
Variance. A measure of dispersion around the mean, equal to the sum of squared
deviations from the mean divided by one less than the number of cases. The
variance is measured in units that are the square of those of the variable itself.
Range. The difference between the largest and smallest values of a numeric
variable; the maximum minus the minimum.
Minimum. The smallest value of a numeric variable.
Maximum. The largest value of a numeric variable.
S. E. mean. A measure of how much the value of the mean may vary from sample
to sample taken from the same distribution. It can be used to roughly compare
the observed mean to a hypothesized value (that is, you can conclude the two
values are different if the ratio of the difference to the standard error is less
than -2 or greater than +2).
Distribution. Skewness and kurtosis are statistics that describe the shape and symmetry
of the distribution. These statistics are displayed with their standard errors.
Skewness. A measure of the asymmetry of a distribution. The normal distribution
is symmetric, and has a skewness value of zero. A distribution with a significant
positive skewness has a long right tail. A distribution with a significant negative
skewness has a long left tail. As a rough guide, a skewness value more than twice
it's standard error is taken to indicate a departure from symmetry.
Kurtosis. A measure of the extent to which observations cluster around a central
point. For a normal distribution, the value of the kurtosis statistic is 0. Positive
kurtosis indicates that the observations cluster more and have longer tails than
those in the normal distribution and negative kurtosis indicates the observations
cluster less and have shorter tails.
Values are group midpoints. If the values in your data are midpoints of groups (for
example, ages of all people in their thirties are coded as 35), select this option to
estimate the median and percentiles for the original, ungrouped data.
288
Chapter 13
Frequencies Charts
Figure 13-4
Frequencies Charts dialog box
Chart Type. A pie chart displays the contribution of parts to a whole. Each slice of a
pie chart corresponds to a group defined by a single grouping variable. A bar chart
displays the count for each distinct value or category as a separate bar, allowing you
to compare categories visually. A histogram also has bars, but they are plotted along
an equal interval scale. The height of each bar is the count of values of a quantitative
variable falling within the interval. A histogram shows the shape, center, and spread
of the distribution. A normal curve superimposed on a histogram helps you judge
whether the data are normally distributed.
Chart Values. For bar charts, the scale axis can be labeled by frequency counts or
percentages.
Frequencies Format
Figure 13-5
Frequencies Format dialog box
289
Frequencies
Order by. The frequency table can be arranged according to the actual values in the
data or according to the count (frequency of occurrence) of those values, and in either
ascending or descending order. However, if you request a histogram or percentiles,
Frequencies assumes that the variable is quantitative and displays its values in
ascending order.
Multiple Variables. If you produce statistics tables for multiple variables, you can
either display all variables in a single table (Compare variables) or display a separate
statistics table for each variable (Organize output by variables).
Suppress tables with more than n categories. This option prevents the display of tables
with more than the specified number of values.
Chapter
14
Descriptives
291
292
Chapter 14
categories or skewed distributions). The distribution of z scores has the same shape as
that of the original data; therefore, calculating z scores is not a remedy for problem
data.
Sample Output
Figure 14-1
Descriptives output
Descriptive Statistics
Std.
N Minimum Maximum Mean Deviation
Dave's Sales 10 42.00 86.00 59.2000 14.2657
Sharon's Sales 10 23.00 85.00 56.2000 17.6623
Brian's Sales 10 45.00 71.00 56.0000 8.8819
Mary's Sales 10 34.00 83.00 52.9000 16.6029
Bob's Sales 10 28.00 89.00 52.9000 21.8858
Kim's Sales 10 23.00 73.00 52.1000 16.4617
Juan's Sales 10 25.00 85.00 50.5000 21.1305
Valid N (listwise) 10
Descriptives
Figure 14-2
Descriptives dialog box
Chapter 14
Descriptives Options
Figure 14-3
Descriptives Options dialog box
Dispersion. Statistics that measure the spread or variation in the data include the
standard deviation, variance, range, minimum, maximum, and standard error of
the mean.
Standard deviation. A measure of dispersion around the mean. In a normal
distribution, 68% of cases fall within one SD of the mean and 95% of cases fall
within 2 SD. For example, if the mean age is 45, with a standard deviation of 10,
95% of the cases would be between 25 and 65 in a normal distribution.
Variance. A measure of dispersion around the mean, equal to the sum of squared
deviations from the mean divided by one less than the number of cases. The
variance is measured in units that are the square of those of the variable itself.
Range. The difference between the largest and smallest values of a numeric
variable; the maximum minus the minimum.
Minimum. The smallest value of a numeric variable.
295
Descriptives
Distribution. Kurtosis and skewness are statistics that characterize the shape and
symmetry of the distribution. These are displayed with their standard errors.
Kurtosis. A measure of the extent to which observations cluster around a central
point. For a normal distribution, the value of the kurtosis statistic is 0. Positive
kurtosis indicates that the observations cluster more and have longer tails than
those in the normal distribution and negative kurtosis indicates the observations
cluster less and have shorter tails.
Skewness. A measure of the asymmetry of a distribution. The normal distribution
is symmetric, and has a skewness value of zero. A distribution with a significant
positive skewness has a long right tail. A distribution with a significant negative
skewness has a long left tail. As a rough guide, a skewness value more than twice
it's standard error is taken to indicate a departure from symmetry.
Display Order. By default, the variables are displayed in the order in which you
selected them. Optionally, you can display variables alphabetically, by ascending
means, or by descending means.
Chapter
15
Explore
The Explore procedure produces summary statistics and graphical displays, either for
all of your cases or separately for groups of cases. There are many reasons for using
the Explore procedure—data screening, outlier identification, description, assumption
checking, and characterizing differences among subpopulations (groups of cases).
Data screening may show that you have unusual values, extreme values, gaps in the
data, or other peculiarities. Exploring the data can help to determine whether the
statistical techniques that you are considering for data analysis are appropriate. The
exploration may indicate that you need to transform the data if the technique requires
a normal distribution. Or, you may decide that you need nonparametric tests.
Example. Look at the distribution of maze-learning times for rats under four different
reinforcement schedules. For each of the four groups, you can see if the distribution
of times is approximately normal and whether the four variances are equal. You can
also identify the cases with the five largest and five smallest times. The boxplots
and stem-and-leaf plots graphically summarize the distribution of learning times
for each of the groups.
Statistics and plots. Mean, median, 5% trimmed mean, standard error, variance,
standard deviation, minimum, maximum, range, interquartile range, skewness and
kurtosis and their standard errors, confidence interval for the mean (and specified
confidence level), percentiles, Huber's M-estimator, Andrews' wave estimator,
Hampel's redescending M-estimator, Tukey's biweight estimator, the five largest and
five smallest values, the Kolmogorov-Smirnov statistic with a Lilliefors significance
level for testing normality, and the Shapiro-Wilk statistic. Boxplots, stem-and-leaf
plots, histograms, normality plots, and spread-versus-level plots with Levene tests
and transformations.
297
298
Chapter 15
Sample Output
Figure 15-1
Explore output
299
Explore
Extreme Values
Case
Number Schedule Value
Time Highest 1 31 4 10.5
2 33 4 9.9
3 39 4 9.8
4 32 4 9.5
5 36 4 9.3
Lowest 1 2 1 2.0
2 7 1 2.1
3 1 1 2.3
4 11 2 2.3
5 3 1 2.5
7.00 2 . 0133589
6.00 3 . 014577
3.00 4 . 568
5.00 5 . 05779
4.00 6 . 1379
3.00 7 . 268
6.00 8 . 012237
5.00 9 . 13589
1.00 10 . 5
Chapter 15
Figure 15-2
Explore dialog box
Explore
Explore Statistics
Figure 15-3
Explore Statistics dialog box
Chapter 15
Explore Plots
Figure 15-4
Explore Plots dialog box
Boxplots. These alternatives control the display of boxplots when you have more than
one dependent variable. Factor levels together generates a separate display for each
dependent variable. Within a display, boxplots are shown for each of the groups
defined by a factor variable. Dependents together generates a separate display for each
group defined by a factor variable. Within a display, boxplots are shown side by side
for each dependent variable. This display is particularly useful when the different
variables represent a single characteristic measured at different times.
Descriptive. The Descriptive group allows you to choose stem-and-leaf plots and
histograms.
Normality plots with tests. Displays normal probability and detrended normal
probability plots. The Kolmogorov-Smirnov statistic, with a Lilliefors significance
level for testing normality, is displayed. If non-integer weights are specified, the
Shapiro-Wilk statistic is calculated when the weighted sample size lies between 3 and
50. For no weights or integer weights, the statistic is calculated when the weighted
sample size lies between 3 and 5000.
Spread vs. Level with Levene Test. Controls data transformation for spread-versus-level
plots. For all spread-versus-level plots, the slope of the regression line and Levene's
robust tests for homogeneity of variance are displayed. If you select a transformation,
303
Explore
Levene's tests are based on the transformed data. If no factor variable is selected,
spread-versus-level plots are not produced. Power estimation produces a plot of the
natural logs of the interquartile ranges against the natural logs of the medians for all
cells, as well as an estimate of the power transformation for achieving equal variances
in the cells. A spread-versus-level plot helps determine the power for a transformation
to stabilize (make more equal) variances across groups. Transformed allows you to
select one of the power alternatives, perhaps following the recommendation from
power estimation, and produces plots of transformed data. The interquartile range and
median of the transformed data are plotted. Untransformed produces plots of the raw
data. This is equivalent to a transformation with a power of 1.
Explore Options
Figure 15-5
Explore Options dialog box
Chapter 15
Exclude cases listwise. Cases with missing values for any dependent or factor
variable are excluded from all analyses. This is the default.
Exclude cases pairwise. Cases with no missing values for variables in a group
(cell) are included in the analysis of that group. The case may have missing
values for variables used in other groups.
Report values. Missing values for factor variables are treated as a separate
category. All output is produced for this additional category. Frequency tables
include categories for missing values. Missing values for a factor variable are
included but labeled as missing.
Chapter
16
Crosstabs
The Crosstabs procedure forms two-way and multiway tables and provides a variety
of tests and measures of association for two-way tables. The structure of the table and
whether categories are ordered determine what test or measure to use.
Crosstabs' statistics and measures of association are computed for two-way
tables only. If you specify a row, a column, and a layer factor (control variable),
the Crosstabs procedure forms one panel of associated statistics and measures for
each value of the layer factor (or a combination of values for two or more control
variables). For example, if gender is a layer factor for a table of married (yes, no)
against life (is life exciting, routine, or dull), the results for a two-way table for the
females are computed separately from those for the males and printed as panels
following one another.
Example. Are customers from small companies more likely to be profitable in sales of
services (for example, training and consulting) than those from larger companies?
From a crosstabulation, you might learn that the majority of small companies (fewer
than 500 employees) yield high service profits, while the majority of large companies
(more than 2500 employees) yield low service profits.
Statistics and measures of association. Pearson chi-square, likelihood-ratio chi-square,
linear-by-linear association test, Fisher's exact test, Yates' corrected chi-square,
Pearson's r, Spearman's rho, contingency coefficient, phi, Cramér's V, symmetric and
asymmetric lambdas, Goodman and Kruskal's tau, uncertainty coefficient, gamma,
Somers' d, Kendall's tau-b, Kendall's tau-c, eta coefficient, Cohen's kappa, relative risk
estimate, odds ratio, McNemar test, and Cochran's and Mantel-Haenszel statistics.
305
306
Chapter 16
Crosstabs
Sample Output
Figure 16-1
Crosstabs output
To Obtain Crosstabulations
E From the menus choose:
Analyze
Descriptive Statistics
Crosstabs...
308
Chapter 16
Figure 16-2
Crosstabs dialog box
E Select one or more row variables and one or more column variables.
Crosstabs Layers
If you select one or more layer variables, a separate crosstabulation is produced for
each category of each layer variable (control variable). For example, if you have
one row variable, one column variable, and one layer variable with two categories,
you get a two-way table for each category of the layer variable. To make another
layer of control variables, click Next. Subtables are produced for each combination
of categories for each 1st-layer variable with each 2nd-layer variable and so on. If
309
Crosstabs
statistics and measures of association are requested, they apply to two-way subtables
only.
Crosstabs Statistics
Figure 16-3
Crosstabs Statistics dialog box
Chi-square. For tables with two rows and two columns, select Chi-square to calculate
the Pearson chi-square, the likelihood-ratio chi-square, Fisher's exact test, and Yates'
corrected chi-square (continuity correction). For 2 × 2 tables, Fisher's exact test
is computed when a table that does not result from missing rows or columns in
a larger table has a cell with an expected frequency of less than 5. Yates' corrected
310
Chapter 16
chi-square is computed for all other 2 × 2 tables. For tables with any number of
rows and columns, select Chi-square to calculate the Pearson chi-square and the
likelihood-ratio chi-square. When both table variables are quantitative, Chi-square
yields the linear-by-linear association test.
Correlations. For tables in which both rows and columns contain ordered values,
Correlations yields Spearman's correlation coefficient, rho (numeric data only).
Spearman's rho is a measure of association between rank orders. When both table
variables (factors) are quantitative, Correlations yields the Pearson correlation
coefficient, r, a measure of linear association between the variables.
Nominal. For nominal data (no intrinsic order, such as Catholic, Protestant, and
Jewish), you can select Phi (coefficient) and Cramér's V, Contingency coefficient,
Lambda (symmetric and asymmetric lambdas and Goodman and Kruskal's tau), and
Uncertainty coefficient.
Contingency coefficient. A measure of association based on chi-square. The
value ranges between zero and 1, with zero indicating no association between
the row and column variables and values close to 1 indicating a high degree of
association between the variables. The maximum value possible depends on the
number of rows and columns in a table.
Phi and Cramer's V. Phi is a chi-square based measure of association that involves
dividing the chi-square statistic by the sample size and taking the square root of
the result. Cramer's V is a measure of association based on chi-square.
Lambda. A measure of association which reflects the proportional reduction in
error when values of the independent variable are used to predict values of the
dependent variable. A value of 1 means that the independent variable perfectly
predicts the dependent variable. A value of 0 means that the independent variable
is no help in predicting the dependent variable.
Uncertainty coefficient. A measure of association that indicates the proportional
reduction in errror when values of one variable are used to predict values of the
other variable. For example, a value of 0.83 indicates that knowledge of one
variable reduces error in predicting values of the other variable by 83%. The
program calculates both symmetric and asymmetric versions of the uncertainty
coefficient.
311
Crosstabs
Ordinal. For tables in which both rows and columns contain ordered values, select
Gamma (zero-order for 2-way tables and conditional for 3-way to 10-way tables),
Kendall's tau-b, and Kendall's tau-c. For predicting column categories from row
categories, select Somers' d.
Gamma. A symmetric measure of association between two ordinal variables that
ranges between negative 1 and 1. Values close to an absolute value of 1 indicate
a strong relationship between the two variables. Values close to zero indicate
little or no relationship. For 2-way tables, zero-order gammas are displayed. For
3-way to n-way tables, conditional gammas are displayed.
Somers' d. A measure of association between two ordinal variables that ranges
from -1 to 1. Values close to an absolute value of 1 indicate a strong relationship
between the two variables, and values close to 0 indicate little or no relationship
between the variables. Somers' d is an asymmetric extension of gamma that
differs only in the inclusion of the number of pairs not tied on the independent
variable. A symmetric version of this statistic is also calculated.
Kendall's tau-b. A nonparametric measure of correlation for ordinal or ranked
variables that take ties into account. The sign of the coefficient indicates the
direction of the relationship, and its absolute value indicates the strength, with
larger absolute values indicating stronger relationships. Possible values range
from -1 to 1, but a value of -1 or +1 can only be obtained from square tables.
Kendall's tau-c. A nonparametric measure of association for ordinal variables that
ignores ties. The sign of the coefficient indicates the direction of the relationship,
and its absolute value indicates the strength, with larger absolute values indicating
stronger relationships. Possible values range from -1 to 1, but a value of -1 or +1
can only be obtained from square tables.
Nominal by Interval. When one variable is categorical and the other is quantitative,
select Eta. The categorical variable must be coded numerically.
Eta. A measure of association that ranges from 0 to 1, with 0 indicating no
assoication between the row and column variables and values close to 1 indicating
a high degree of association. Eta is appropriate for a dependent variable measured
on an interval scale (e.g., income) and an independent variable with a limited
number of categories (e.g., gender). Two eta values are computed: one treats
the row variable as the interval variable; the other treats the column variable as
the interval variable.
312
Chapter 16
Kappa. Cohen's kappa measures the agreement between the evaluations of two raters
when both are rating the same object. A value of 1 indicates perfect agreement. A
value of 0 indicates that agreement is no better than chance. Kappa is only available
for tables in which both variables use the same category values and both variables
have the same number of categories.
Risk. For 2 x 2 tables, a measure of the strength of the association between the
presence of a factor and the occurrence of an event. If the confidence interval for
the statistic includes a value of 1, you cannot assume that the factor is associated
with the event. The odds ratio can be used as an estimate or relative risk when the
occurence of the factor is rare.
McNemar. A nonparametric test for two related dichotomous variables. Tests for
changes in responses using the chi-square distribution. Useful for detecting changes
in responses due to experimental intervention in "before-and-after" designs. For
larger square tables, the McNemar-Bowker test of symmetry is reported.
Cochran's and Mantel-Haenszel statistics. Cochran's and Mantel-Haenszel statistics
can be used to test for independence between a dichotomous factor variable and a
dichotomous response variable, conditional upon covariate patterns defined by one or
more layer (control) variables. Note that while other statistics are computed layer by
layer, the Cochran's and Mantel-Haenszel statistics are computed once for all layers.
313
Crosstabs
To help you uncover patterns in the data that contribute to a significant chi-square test,
the Crosstabs procedure displays expected frequencies and three types of residuals
(deviates) that measure the difference between observed and expected frequencies.
Each cell of the table can contain any combination of counts, percentages, and
residuals selected.
Counts. The number of cases actually observed and the number of cases expected if
the row and column variables are independent of each other.
Percentages. The percentages can add up across the rows or down the columns.
The percentages of the total number of cases represented in the table (one layer)
are also available.
Residuals. Raw unstandardized residuals give the difference between the observed and
expected values. Standardized and adjusted standardized residuals are also available.
Unstandardized. The difference between an observed value and the expected
value. The expected value is the number of cases you would expect in the cell
if there were no relationship between the two variables. A positive residual
indicates that there are more cases in the cell than there would be if the row and
column variables were independent.
314
Chapter 16
Noninteger Weights. Cell counts are normally integer values, since they represent the
number of cases in each cell. But if the data file is currently weighted by a weight
variable with fractional values (for example, 1.25), cell counts can also be fractional
values. You can truncate or round either before or after calculating the cell counts or
use fractional cell counts for both table display and statistical calculations.
Round cell counts. Case weights are used as is but the accumulated weights in the
cells are rounded before computing any statistics.
Truncate cell counts. Case weights are used as is but the accumulated weights in
the cells are truncated before computing any statistics.
Round case weights. Case weights are rounded before use.
Truncate case weights. Case weights are truncated before use.
No adjustments. Case weights are used as is and fractional cell counts are used.
However, when Exact Statistics (available only with the Exact Tests option) are
requested, the accumulated weights in the cells are either truncated or rounded
before computing the Exact test statistics.
You can arrange rows in ascending or descending order of the values of the row
variable.
Chapter
17
Summarize
315
316
Chapter 17
are appropriate for quantitative variables that may or may not meet the assumption
of normality.
Sample Output
Figure 17-1
Summarize output
Summarize
Figure 17-2
Summarize Cases dialog box
Chapter 17
Summarize Options
Figure 17-3
Summarize Cases Options dialog box
Summarize allows you to change the title of your output or add a caption that will
appear below the output table. You can control line wrapping in titles and captions by
typing \n wherever you want to insert a line break in the text.
You can also choose to display or suppress subheadings for totals and to include or
exclude cases with missing values for any of the variables used in any of the analyses.
Often it is desirable to denote missing cases in output with a period or an asterisk.
Enter a character, phrase, or code that you would like to have appear when a value is
missing; otherwise, no special treatment is applied to missing cases in the output.
319
Summarize
Summarize Statistics
Figure 17-4
Summarize Cases Statistics dialog box
You can choose one or more of the following subgroup statistics for the variables
within each category of each grouping variable: sum, number of cases, mean, median,
grouped median, standard error of the mean, minimum, maximum, range, variable
value of the first category of the grouping variable, variable value of the last category
of the grouping variable, standard deviation, variance, kurtosis, standard error of
kurtosis, skewness, standard error of skewness, percentage of total sum, percentage
of total N, percentage of sum in, percentage of N in, geometric mean, harmonic
mean. The order in which the statistics appear in the Cell Statistics list is the order in
which they will be displayed in the output. Summary statistics are also displayed
for each variable across all categories.
First. Displays the first data value encountered in the data file.
Geometric Mean. The nth root of the product of the data values, where n represents the
number of cases.
Grouped Median. Median calculated for data that is coded into groups. For example,
with age data if each value in the 30's is coded 35, each value in the 40's coded 45,
etc. the grouped median is the median calculated from the coded data.
320
Chapter 17
Harmonic Mean. Used to estimate an average group size when the sample sizes in the
groups are not equal. The harmonic mean is the total number of samples divided by
the sum of the reciprocals of the sample sizes.
Kurtosis. A measure of the extent to which observations cluster around a central point.
For a normal distribution, the value of the kurtosis statistic is 0. Positive kurtosis
indicates that the observations cluster more and have longer tails than those in the
normal distribution and negative kurtosis indicates the observations cluster less
and have shorter tails.
Last. Displays the last data value encountered in the data file.
Maximum. The largest value of a numeric variable.
Mean. A measure of central tendency. The arithmetic average; the sum divided
by the number of cases.
Median. The value above and below which half the cases fall, the 50th percentile. If
there is an even number of cases, the median is the average of the two middle cases
when they are sorted in ascending or descending order. The median is a measure of
central tendency not sensitive to outlying values -- unlike the mean, which can be
affected by a few extremely high or low values.
Minimum. The smallest value of a numeric variable.
N. The number of cases (observations or records).
Percent of Total N. Percent of the total number of cases in each category.
Percent of Total Sum. Percent of the total sum in each category.
Range. The difference between the largest and smallest values of a numeric variable;
the maximum minus the minimum.
Skewness. A measure of the asymmetry of a distribution. The normal distribution
is symmetric, and has a skewness value of zero. A distribution with a significant
positive skewness has a long right tail. A distribution with a significant negative
skewness has a long left tail. As a rough guide, a skewness value more than twice it's
standard error is taken to indicate a departure from symmetry.
Standard Error of Kurtosis. The ratio of kurtosis to its standard error can be used as a
test of normality (that is, you can reject normality if the ratio is less than -2 or greater
than +2). A large positive value for kurtosis indicates that the tails of the distribution
321
Summarize
are longer than those of a normal distribution; a negative value for kurtosis indicates
shorter tails (becoming like those of a box-shaped uniform distribution).
Standard Error of Skewness. The ratio of skewness to its standard error can be used
as a test of normality (that is, you can reject normality if the ratio is less than -2 or
greater than +2). A large positive value for skewness indicates a long right tail; an
extreme negative value, a long left tail.
Sum. The sum or total of the values, across all cases with nonmissing values.
Variance. A measure of dispersion around the mean, equal to the sum of squared
deviations from the mean divided by one less than the number of cases. The variance
is measured in units that are the square of those of the variable itself.
Chapter
18
Means
The Means procedure calculates subgroup means and related univariate statistics
for dependent variables within categories of one or more independent variables.
Optionally, you can obtain a one-way analysis of variance, eta, and tests for linearity.
Example. Measure the average amount of fat absorbed by three different types of
cooking oil and perform a one-way analysis of variance to see if the means differ.
Statistics. Sum, number of cases, mean, median, grouped median, standard error
of the mean, minimum, maximum, range, variable value of the first category of
the grouping variable, variable value of the last category of the grouping variable,
standard deviation, variance, kurtosis, standard error of kurtosis, skewness, standard
error of skewness, percentage of total sum, percentage of total N, percentage of sum
in, percentage of N in, geometric mean, and harmonic mean. Options include analysis
of variance, eta, eta squared, and tests for linearity R and R2.
323
324
Chapter 18
Sample Output
Figure 18-1
Means output
Report
Means
Figure 18-2
Means dialog box
Chapter 18
Means Options
Figure 18-3
Means Options dialog box
You can choose one or more of the following subgroup statistics for the variables
within each category of each grouping variable: sum, number of cases, mean, median,
grouped median, standard error of the mean, minimum, maximum, range, variable
value of the first category of the grouping variable, variable value of the last category
of the grouping variable, standard deviation, variance, kurtosis, standard error of
kurtosis, skewness, standard error of skewness, percentage of total sum, percentage
of total N, percentage of sum in, percentage of N in, geometric mean, and harmonic
mean. You can change the order in which the subgroup statistics appear. The order
in which the statistics appear in the Cell Statistics list is the order in which they are
displayed in the output. Summary statistics are also displayed for each variable
across all categories.
First. Displays the first data value encountered in the data file.
327
Means
Geometric Mean. The nth root of the product of the data values, where n represents the
number of cases.
Grouped Median. Median calculated for data that is coded into groups. For example,
with age data if each value in the 30's is coded 35, each value in the 40's coded 45,
etc. the grouped median is the median calculated from the coded data.
Harmonic Mean. Used to estimate an average group size when the sample sizes in the
groups are not equal. The harmonic mean is the total number of samples divided by
the sum of the reciprocals of the sample sizes.
Kurtosis. A measure of the extent to which observations cluster around a central point.
For a normal distribution, the value of the kurtosis statistic is 0. Positive kurtosis
indicates that the observations cluster more and have longer tails than those in the
normal distribution and negative kurtosis indicates the observations cluster less
and have shorter tails.
Last. Displays the last data value encountered in the data file.
Maximum. The largest value of a numeric variable.
Mean. A measure of central tendency. The arithmetic average; the sum divided
by the number of cases.
Median. The value above and below which half the cases fall, the 50th percentile. If
there is an even number of cases, the median is the average of the two middle cases
when they are sorted in ascending or descending order. The median is a measure of
central tendency not sensitive to outlying values -- unlike the mean, which can be
affected by a few extremely high or low values.
Minimum. The smallest value of a numeric variable.
N. The number of cases (observations or records).
Percent of total N. Percent of the total number of cases in each category.
Percent of total sum. Percent of the total sum in each category.
Range. The difference between the largest and smallest values of a numeric variable;
the maximum minus the minimum.
Skewness. A measure of the asymmetry of a distribution. The normal distribution
is symmetric, and has a skewness value of zero. A distribution with a significant
positive skewness has a long right tail. A distribution with a significant negative
328
Chapter 18
skewness has a long left tail. As a rough guide, a skewness value more than twice it's
standard error is taken to indicate a departure from symmetry.
Standard Error of Kurtosis. The ratio of kurtosis to its standard error can be used as a
test of normality (that is, you can reject normality if the ratio is less than -2 or greater
than +2). A large positive value for kurtosis indicates that the tails of the distribution
are longer than those of a normal distribution; a negative value for kurtosis indicates
shorter tails (becoming like those of a box-shaped uniform distribution).
Standard Error of Skewness. The ratio of skewness to its standard error can be used
as a test of normality (that is, you can reject normality if the ratio is less than -2 or
greater than +2). A large positive value for skewness indicates a long right tail; an
extreme negative value, a long left tail.
Sum. The sum or total of the values, across all cases with nonmissing values.
Variance. A measure of dispersion around the mean, equal to the sum of squared
deviations from the mean divided by one less than the number of cases. The variance
is measured in units that are the square of those of the variable itself.
ANOVA table and eta. Displays a one-way analysis-of-variance table and calculates
eta and eta squared (measures of association) for each independent variable in the
first layer.
Test for linearity. Calculates the sum of squares, degrees of freedom, and mean square
associated with linear and nonlinear components, as well as the F ratio, R and R
squared. Linearity is not calculated if the independent variable is a short string.
Chapter
19
OLAP Cubes
The OLAP (Online Analytical Processing) Cubes procedure calculates totals, means,
and other univariate statistics for continuous summary variables within categories of
one or more categorical grouping variables. A separate layer in the table is created for
each category of each grouping variable.
Example. Total and average sales for different regions and product lines within regions.
Statistics. Sum, number of cases, mean, median, grouped median, standard error
of the mean, minimum, maximum, range, variable value of the first category of
the grouping variable, variable value of the last category of the grouping variable,
standard deviation, variance, kurtosis, standard error of kurtosis, skewness, standard
error of skewness, percentage of total cases, percentage of total sum, percentage
of total cases within grouping variables, percentage of total sum within grouping
variables, geometric mean, and harmonic mean.
329
330
Chapter 19
Sample Output
Figure 19-1
OLAP Cubes output
1996 Sales
by Division and Region
Division: Total
Region: Total
Sum $145,038,250
Mean $371,893
Median $307,500
Std. Deviation $171,311
1996 Sales
by Division and Region
OLAP Cubes
Figure 19-2
OLAP Cubes dialog box
Chapter 19
You can choose one or more of the following subgroup statistics for the summary
variables within each category of each grouping variable: sum, number of cases,
mean, median, grouped median, standard error of the mean, minimum, maximum,
range, variable value of the first category of the grouping variable, variable value of
the last category of the grouping variable, standard deviation, variance, kurtosis,
standard error of kurtosis, skewness, standard error of skewness, percentage of total
cases, percentage of total sum, percentage of total cases within grouping variables,
percentage of total sum within grouping variables, geometric mean, and harmonic
mean.
You can change the order in which the subgroup statistics appear. The order in
which the statistics appear in the Cell Statistics list is the order in which they are
displayed in the output. Summary statistics are also displayed for each variable
across all categories.
First. Displays the first data value encountered in the data file.
Geometric Mean. The nth root of the product of the data values, where n represents the
number of cases.
333
OLAP Cubes
Grouped Median. Median calculated for data that is coded into groups. For example,
with age data if each value in the 30's is coded 35, each value in the 40's coded 45,
etc. the grouped median is the median calculated from the coded data.
Harmonic Mean. Used to estimate an average group size when the sample sizes in the
groups are not equal. The harmonic mean is the total number of samples divided by
the sum of the reciprocals of the sample sizes.
Kurtosis. A measure of the extent to which observations cluster around a central point.
For a normal distribution, the value of the kurtosis statistic is 0. Positive kurtosis
indicates that the observations cluster more and have longer tails than those in the
normal distribution and negative kurtosis indicates the observations cluster less
and have shorter tails.
Last. Displays the last data value encountered in the data file.
Maximum. The largest value of a numeric variable.
Mean. A measure of central tendency. The arithmetic average; the sum divided
by the number of cases.
Median. The value above and below which half the cases fall, the 50th percentile. If
there is an even number of cases, the median is the average of the two middle cases
when they are sorted in ascending or descending order. The median is a measure of
central tendency not sensitive to outlying values -- unlike the mean, which can be
affected by a few extremely high or low values.
Minimum. The smallest value of a numeric variable.
N. The number of cases (observations or records).
Percent of N in. Percent of the number of cases for the specified grouping variable
within categories of other grouping variables. If you only have one grouping variable,
this value is identical to percent of total number of cases.
Percent of Sum in. Percent of the sum for the specified grouping variable within
categories of other grouping variables. If you only have one grouping variable, this
value is identical to percent of total sum.
Percent of Total N. Percent of the total number of cases in each category.
Percent of Total Sum. Percent of the total sum in each category.
334
Chapter 19
Range. The difference between the largest and smallest values of a numeric variable;
the maximum minus the minimum.
Skewness. A measure of the asymmetry of a distribution. The normal distribution
is symmetric, and has a skewness value of zero. A distribution with a significant
positive skewness has a long right tail. A distribution with a significant negative
skewness has a long left tail. As a rough guide, a skewness value more than twice it's
standard error is taken to indicate a departure from symmetry.
Standard Error of Kurtosis. The ratio of kurtosis to its standard error can be used as a
test of normality (that is, you can reject normality if the ratio is less than -2 or greater
than +2). A large positive value for kurtosis indicates that the tails of the distribution
are longer than those of a normal distribution; a negative value for kurtosis indicates
shorter tails (becoming like those of a box-shaped uniform distribution).
Standard Error of Skewness. The ratio of skewness to its standard error can be used
as a test of normality (that is, you can reject normality if the ratio is less than -2 or
greater than +2). A large positive value for skewness indicates a long right tail; an
extreme negative value, a long left tail.
Sum. The sum or total of the values, across all cases with nonmissing values.
Variance. A measure of dispersion around the mean, equal to the sum of squared
deviations from the mean divided by one less than the number of cases. The variance
is measured in units that are the square of those of the variable itself.
335
OLAP Cubes
This dialog box allows you to calculate percentage and arithmetic differences between
summary variables or between groups defined by a grouping variable. Differences are
calculated for all measures selected in the OLAP Cubes Statistics dialog box.
Differences between Variables. Calculates differences between pairs of variables.
Summary statistics values for the second variable (the Minus variable) in each pair
are subtracted from summary statistic values for the first variable in the pair. For
percentage differences, the value of the summary variable for the Minus variable is
used as the denominator. You must select at least two summary variables in the main
dialog box before you can specify differences between variables.
Differences between Groups of Cases. Calculates differences between pairs of groups
defined by a grouping variable. Summary statistics values for the second category in
each pair (the Minus category) are subtracted from summary statistic values for the
first category in the pair. Percentage differences use the value of the summary statistic
336
Chapter 19
for the Minus category as the denominator. You must select one or more grouping
variables in the main dialog box before you can specify differences between groups.
You can change the title of your output or add a caption that will appear below the
output table. You can also control line wrapping of titles and captions by typing \n
wherever you want to insert a line break in the text.
Chapter
20
T Tests
Independent-Samples T Test
The Independent-Samples T Test procedure compares means for two groups of cases.
Ideally, for this test, the subjects should be randomly assigned to two groups, so that
any difference in response is due to the treatment (or lack of treatment) and not to
other factors. This is not the case if you compare average income for males and
females. A person is not randomly assigned to be a male or female. In such situations,
you should ensure that differences in other factors are not masking or enhancing a
significant difference in means. Differences in average income may be influenced by
factors such as education and not by sex alone.
337
338
Chapter 20
Example. Patients with high blood pressure are randomly assigned to a placebo group
and a treatment group. The placebo subjects receive an inactive pill and the treatment
subjects receive a new drug that is expected to lower blood pressure. After treating the
subjects for two months, the two-sample t test is used to compare the average blood
pressures for the placebo group and the treatment group. Each patient is measured
once and belongs to one group.
Statistics. For each variable: sample size, mean, standard deviation, and standard
error of the mean. For the difference in means: mean, standard error, and confidence
interval (you can specify the confidence level). Tests: Levene's test for equality of
variances, and both pooled- and separate-variances t tests for equality of means.
Sample Output
Figure 20-1
Independent-Samples T Test output
Group Statistics
T Tests
Equal
variances
3.783 17.163 .001 26.10 6.90 11.56 40.64
not
assumed
E Select one or more quantitative test variables. A separate t test is computed for
each variable.
E Select a single grouping variable, and click Define Groups to specify two codes for
the groups that you want to compare.
340
Chapter 20
Optionally, you can click Options to control the treatment of missing data and the
level of the confidence interval.
For numeric grouping variables, define the two groups for the t test by specifying two
values or a cut point:
Use specified values. Enter a value for Group 1 and another for Group 2. Cases
with any other values are excluded from the analysis. Numbers need not be
integers (for example, 6.25 and 12.5 are valid).
Cut point. Alternatively, enter a number that splits the values of the grouping
variable into two sets. All cases with values less than the cut point form one
group, and cases with values greater than or equal to the cut point form the
other group.
Figure 20-4
Define Groups dialog box for string variables
For short string grouping variables, enter a string for Group 1 and another for Group
2, such as yes and no. Cases with other strings are excluded from the analysis.
341
T Tests
Confidence Interval. By default, a 95% confidence interval for the difference in means
is displayed. Enter a value between 1 and 99 to request a different confidence level.
Missing Values. When you test several variables and data are missing for one or more
variables, you can tell the procedure which cases to include (or exclude):
Exclude missing data analysis by analysis. Each t test uses all cases that have valid
data for the variables tested. Sample sizes may vary from test to test.
Exclude cases listwise. Each t test uses only cases that have valid data for all
variables used in the requested t tests. The sample size is constant across tests.
Paired-Samples T Test
The Paired-Samples T Test procedure compares the means of two variables for a
single group. It computes the differences between values of the two variables for each
case and tests whether the average differs from 0.
Example. In a study on high blood pressure, all patients are measured at the beginning
of the study, given a treatment, and measured again. Thus, each subject has two
measures, often called before and after measures. An alternative design for which
this test is used is a matched-pairs or case-control study. Here, each record in the
data file contains the response for the patient and also for his or her matched control
subject. In a blood pressure study, patients and controls might be matched by age (a
75-year-old patient with a 75-year-old control group member).
342
Chapter 20
Statistics. For each variable: mean, sample size, standard deviation, and standard
error of the mean. For each pair of variables: correlation, average difference in means,
t test, and confidence interval for mean difference (you can specify the confidence
level). Standard deviation and standard error of the mean difference.
Sample Output
Figure 20-6
Paired-Samples T Test output
Paired Samples Statistics
Paired Differences
95% Confidence Interval
of the Difference
Std. Std. Error Significance
Mean Deviation Mean Lower Upper t df (2-tailed)
Pair 1 After
treatment -
-26.10 19.59 6.19 -40.11 -12.09 -4.214 9 .002
Before
treatment
343
T Tests
Figure 20-7
Paired-Samples T Test dialog box
Chapter 20
Confidence Interval. By default, a 95% confidence interval for the difference in means
is displayed. Enter a value between 1 and 99 to request a different confidence level.
Missing Values. When you test several variables and data are missing for one or more
variables, you can tell the procedure which cases to include (or exclude):
Exclude cases analysis by analysis. Each t test uses all cases that have valid data
for the pair of variables tested. Sample sizes may vary from test to test.
Exclude cases listwise. Each t test uses only cases that have valid data for all pairs
of variables tested. The sample size is constant across tests.
One-Sample T Test
The One-Sample T Test procedure tests whether the mean of a single variable differs
from a specified constant.
Examples. A researcher might want to test whether the average IQ score for a group of
students differs from 100. Or, a cereal manufacturer can take a sample of boxes from
the production line and check whether the mean weight of the samples differs from
1.3 pounds at the 95% confidence level.
Statistics. For each test variable: mean, standard deviation, and standard error of the
mean. The average difference between each data value and the hypothesized test
value, a t test that tests that this difference is 0, and a confidence interval for this
difference (you can specify the confidence level).
345
T Tests
Sample Output
Figure 20-9
One-Sample T Test output
One-Sample Statistics
IQ
N 15
Mean 109.33
Std. Deviation 12.03
Std. Error Mean 3.11
One-Sample Test
Chapter 20
Figure 20-10
One-Sample T Test dialog box
E Select one or more variables to be tested against the same hypothesized value.
E Enter a numeric test value against which each sample mean is compared.
Optionally, you can click Options to control the treatment of missing data and the
level of the confidence interval.
T Tests
Confidence Interval. By default, a 95% confidence interval for the difference between
the mean and the hypothesized test value is displayed. Enter a value between 1 and 99
to request a different confidence level.
Missing Values. When you test several variables and data are missing for one or more
of these variables, you can tell the procedure which cases to include (or exclude).
Exclude cases analysis by analysis. Each t test uses all cases that have valid data
for the variable tested. Sample sizes may vary from test to test.
Exclude cases listwise. Each t test uses only cases that have valid data for all
variables used in any of the t tests requested. The sample size is constant across
tests.
Chapter
21
One-Way ANOVA
349
350
Chapter 21
Sample Output
Figure 21-1
One-Way ANOVA output
ANOVA
Sum of Mean
Squares df Square F Significance
Absorbed Between
1596.00 2 798.00 7.824 .005
Grams of Groups
Fat
Within
1530.00 15 102.00
Groups
Total 3126.00 17
Descriptives
Contrast Coefficients
Type of Oil
Peanut Oil Lard Corn Oil
Contrast 1 -.5 1 -.5
351
One-Way ANOVA
Contrast Tests
Value of Significance
Contrast Std. Error t df (2-tailed)
Absorbed Assume equal variances Contrast 1 18.00 5.05 3.565 15 .003
Grams of Fat
Does not assume equal variances Contrast 1 18.00 4.51 3.995 12.542 .002
Levene
Statistic df1 df2 Significance
Absorbed
Grams of .534 2 15 .597
Fat
Chapter 21
You can partition the between-groups sums of squares into trend components or
specify a priori contrasts.
Polynomial. Partitions the between-groups sums of squares into trend components.
You can test for a trend of the dependent variable across the ordered levels of
the factor variable. For example, you could test for a linear trend (increasing or
decreasing) in salary across the ordered levels of highest degree earned.
Degree. You can choose a 1st, 2nd, 3rd, 4th, or 5th degree polynomial.
Coefficients. User-specified a priori contrasts to be tested by the t statistic. Enter
a coefficient for each group (category) of the factor variable and click Add after
each entry. Each new value is added to the bottom of the coefficient list. To specify
additional sets of contrasts, click Next. Use Next and Previous to move between
sets of contrasts.
The order of the coefficients is important because it corresponds to the ascending
order of the category values of the factor variable. The first coefficient on the list
corresponds to the lowest group value of the factor variable, and the last coefficient
corresponds to the highest value. For example, if there are six categories of the factor
variable, the coefficients –1, 0, 0, 0, 0.5, and 0.5 contrast the first group with the fifth
and sixth groups. For most applications, the coefficients should sum to 0. Sets that do
not sum to 0 can also be used, but a warning message is displayed.
353
One-Way ANOVA
Once you have determined that differences exist among the means, post hoc range
tests and pairwise multiple comparisons can determine which means differ. Range
tests identify homogeneous subsets of means that are not different from each other.
Pairwise multiple comparisons test the difference between each pair of means, and
yield a matrix where asterisks indicate significantly different group means at an
alpha level of 0.05.
Tukey's honestly significant difference test, Hochberg's GT2, Gabriel, and Scheffé are
multiple comparison tests and range tests. Other available range tests are Tukey's b,
S-N-K (Student-Newman-Keuls), Duncan, R-E-G-W F (Ryan-Einot-Gabriel-Welsch
F test), R-E-G-W Q (Ryan-Einot-Gabriel-Welsch range test), and Waller-Duncan.
Available multiple comparison tests are Bonferroni, Tukey's honestly significant
difference test, Sidak, Gabriel, Hochberg, Dunnett, Scheffé, and LSD (least
significant difference).
354
Chapter 21
LSD. Uses t tests to perform all pairwise comparisons between group means. No
adjustment is made to the error rate for multiple comparisons.
Bonferroni. Uses t tests to perform pairwise comparisons between group means,
but controls overall error rate by setting the error rate for each test to the
experimentwise error rate divided by the total number of tests. Hence, the
observed significance level is adjusted for the fact that multiple comparisons
are being made.
Sidak. Pairwise multiple comparison test based on a t statistic. Sidak adjusts
the significance level for multiple comparisons and provides tighter bounds
than Bonferroni.
Scheffe. Performs simultaneous joint pairwise comparisons for all possible
pairwise combinations of means. Uses the F sampling distribution. Can be used
to examine all possible linear combinations of group means, not just pairwise
comparisons.
R-E-G-W F. Ryan-Einot-Gabriel-Welsch multiple stepdown procedure based on an
F test.
R-E-G-W Q. Ryan-Einot-Gabriel-Welsch multiple stepdown procedure based on
the Studentized range.
S-N-K. Makes all pairwise comparisons between means using the Studentized
range distribution. With equal sample sizes, it also compares pairs of means
within homogeneous subsets, using a stepwise procedure. Means are ordered
from highest to lowest, and extreme differences are tested first.
Tukey. Uses the Studentized range statistic to make all of the pairwise comparisons
between groups. Sets the experimentwise error rate at the error rate for the
collection for all pairwise comparisons.
Tukey's-b. Uses the Studentized range distribution to make pairwise comparisons
between groups. The critical value is the average of the corresponding value for
the Tukey's honestly significant difference test and the Student-Newman-Keuls.
Duncan. Makes pairwise comparisons using a stepwise order of comparisons
identical to the order used by the Student-Newman-Keuls test, but sets a
protection level for the error rate for the collection of tests, rather than an error
rate for individual tests. Uses the Studentized range statistic.
Hochberg's GT2. Multiple comparison and range test that uses the Studentized
maximum modulus. Similar to Tukey's honestly significant difference test.
355
One-Way ANOVA
Gabriel. Pairwise comparison test that used the Studentized maximum modulus
and is generally more powerful than Hochberg's GT2 when the cell sizes are
unequal. Gabriel's test may become liberal when the cell sizes vary greatly.
Waller-Duncan. Multiple comparison test based on a t statistic; uses a Bayesian
approach.
Dunnett. Pairwise multiple comparison t test that compares a set of treatments
against a single control mean. The last category is the default control category.
Alternatively, you can choose the first category. 2-sided tests that the mean at
any level (except the control category) of the factor is not equal to that of the
control category. <Control tests if the mean at any level of the factor is smaller
than that of the control category. >Control tests if the mean at any level of the
factor is greater than that of the control category.
Multiple comparison tests that do not assume equal variances are Tamhane's T2,
Dunnett's T3, Games-Howell, and Dunnett's C.
Tamhane's T2. Conservative pairwise comparisons test based on a t test. This test
is appropriate when the variances are unequal.
Dunnett's T3. Pairwise comparison test based on the Studentized maximum
modulus. This test is appropriate when the variances are unequal.
Games-Howell. Pairwise comparison test that is sometimes liberal. This test is
appropriate when the variances are unequal.
Dunnett's C. Pairwise comparison test based on the Studentized range. This test is
appropriate when the variances are unequal.
Note: You may find it easier to interpret the output from post hoc tests if you deselect
Hide empty rows and columns in the Table Properties dialog box (in an activated pivot
table, choose Table Properties from the Format menu).
356
Chapter 21
One-Way ANOVA
Exclude cases analysis by analysis. A case with a missing value for either the
dependent or the factor variable for a given analysis is not used in that analysis.
Also, a case outside the range specified for the factor variable is not used.
Exclude cases listwise. Cases with missing values for the factor variable or for
any dependent variable included on the dependent list in the main dialog box
are excluded from all analyses. If you have not specified multiple dependent
variables, this has no effect.
Chapter
22
GLM Univariate Analysis
359
360
Chapter 22
might find that gender is a significant effect and that the interaction of gender with
weather is significant.
Methods. Type I, Type II, Type III, and Type IV sums of squares can be used to
evaluate different hypotheses. Type III is the default.
Statistics. Post hoc range tests and multiple comparisons: least significant
difference, Bonferroni, Sidak, Scheffé, Ryan-Einot-Gabriel-Welsch multiple F,
Ryan-Einot-Gabriel-Welsch multiple range, Student-Newman-Keuls, Tukey's
honestly significant difference, Tukey's b, Duncan, Hochberg's GT2, Gabriel,
Waller-Duncan t test, Dunnett (one-sided and two-sided), Tamhane's T2, Dunnett's
T3, Games-Howell, and Dunnett's C. Descriptive statistics: observed means, standard
deviations, and counts for all of the dependent variables in all cells. The Levene test
for homogeneity of variance.
Plots. Spread-versus-level, residual, and profile (interaction).
Sample Output
Figure 22-1
GLM Univariate output
Tests of Between-Subjects Effects
Dependent Variable: SPVOL
Type III
Sum of
Source Squares df Mean Square F Sig.
1
Corrected Model 22.520 11 2.047 12.376 .000
Intercept 1016.981 1 1016.981 6147.938 .000
Flour 8.691 3 2.897 17.513 .000
Fat 10.118 2 5.059 30.583 .000
Surfactant .997 2 .499 3.014 .082
Fat*Surfactant 5.639 4 1.410 8.522 .001
Error 2.316 14 .165
Total 1112.960 26
Corrected Total 24.835 25
1. R Squared = .907 (Adjusted R Squared = .833)
fat * surfactant
Dependent Variable: SPVOL
95% Confidence Interval
fat surfactant Mean Std. Error Lower Bound Upper Bound
1 1 5.536 .240 5.021 6.052
2 5.891 .239 5.378 6.404
3 6.123 .241 5.605 6.641
2 1 7.023 .241 6.505 7.541
2 6.708 .301 6.064 7.353
3 6.000 .203 5.564 6.436
3 1 6.629 .301 5.984 7.274
2 7.200 .203 6.764 7.636
3 8.589 .300 7.945 9.233
362
Chapter 22
Figure 22-2
Univariate dialog box
E Optionally, you can use WLS Weight to specify a weight variable for weighted
least-squares analysis. If the value of the weighting variable is zero, negative, or
missing, the case is excluded from the analysis. A variable already used in the model
cannot be used as a weighting variable.
363
GLM Model
Figure 22-3
Univariate Model dialog box
Specify Model. A full factorial model contains all factor main effects, all covariate
main effects, and all factor-by-factor interactions. It does not contain covariate
interactions. Select Custom to specify only a subset of interactions or to specify
factor-by-covariate interactions. You must indicate all of the terms to be included
in the model.
Factors and Covariates. The factors and covariates are listed with (F) for fixed factor
and (C) for covariate. In a Univariate analysis, (R) indicates a random factor.
Model. The model depends on the nature of your data. After selecting Custom, you
can select the main effects and interactions that are of interest in your analysis.
Sum of squares. The method of calculating the sums of squares. For balanced or
unbalanced models with no missing cells, the Type III sum-of-squares method is
most commonly used.
Include intercept in model. The intercept is usually included in the model. If you can
assume that the data pass through the origin, you can exclude the intercept.
364
Chapter 22
Build Terms
Sum of Squares
For the model, you can choose a type of sums of squares. Type III is the most
commonly used and is the default.
Type I. This method is also known as the hierarchical decomposition of the
sum-of-squares method. Each term is adjusted for only the term that precedes it in the
model. Type I sums of squares are commonly used for:
A balanced ANOVA model in which any main effects are specified before any
first-order interaction effects, any first-order interaction effects are specified
before any second-order interaction effects, and so on.
A polynomial regression model in which any lower-order terms are specified
before any higher-order terms.
A purely nested model in which the first-specified effect is nested within the
second-specified effect, the second-specified effect is nested within the third, and
so on. (This form of nesting can be specified only by using syntax.)
Type II. This method calculates the sums of squares of an effect in the model adjusted
for all other “appropriate” effects. An appropriate effect is one that corresponds to all
effects that do not contain the effect being examined. The Type II sum-of-squares
method is commonly used for:
A balanced ANOVA model.
Any model that has main factor effects only.
365
GLM Contrasts
Figure 22-4
Univariate Contrasts dialog box
366
Chapter 22
Contrasts are used to test for differences among the levels of a factor. You can specify
a contrast for each factor in the model (in a repeated measures model, for each
between-subjects factor). Contrasts represent linear combinations of the parameters.
Hypothesis testing is based on the null hypothesis LB = 0, where L is the contrast
coefficients matrix and B is the parameter vector. When a contrast is specified, SPSS
creates an L matrix in which the columns corresponding to the factor match the
contrast. The remaining columns are adjusted so that the L matrix is estimable.
The output includes an F statistic for each set of contrasts. Also displayed for the
contrast differences are Bonferroni-type simultaneous confidence intervals based on
Student's t distribution.
Available Contrasts
Contrast Types
Deviation. Compares the mean of each level (except a reference category) to the mean
of all of the levels (grand mean). The levels of the factor can be in any order.
Simple. Compares the mean of each level to the mean of a specified level. This
type of contrast is useful when there is a control group. You can choose the first or
last category as the reference.
Difference. Compares the mean of each level (except the first) to the mean of previous
levels. (Sometimes called reverse Helmert contrasts.)
Helmert. Compares the mean of each level of the factor (except the last) to the mean
of subsequent levels.
Repeated. Compares the mean of each level (except the last) to the mean of the
subsequent level.
Polynomial. Compares the linear effect, quadratic effect, cubic effect, and so on. The
first degree of freedom contains the linear effect across all categories; the second
degree of freedom, the quadratic effect; and so on. These contrasts are often used
to estimate polynomial trends.
367
Profile plots (interaction plots) are useful for comparing marginal means in your
model. A profile plot is a line plot in which each point indicates the estimated
marginal mean of a dependent variable (adjusted for any covariates) at one level of a
factor. The levels of a second factor can be used to make separate lines. Each level in
a third factor can be used to create a separate plot. All fixed and random factors, if
any, are available for plots. For multivariate analyses, profile plots are created for
each dependent variable. In a repeated measures analysis, both between-subjects
factors and within-subjects factors can be used in profile plots. GLM Multivariate
and GLM Repeated Measures are available only if you have the Advanced Models
option installed.
A profile plot of one factor shows whether the estimated marginal means are
increasing or decreasing across levels. For two or more factors, parallel lines indicate
that there is no interaction between factors, which means that you can investigate the
levels of only one factor. Nonparallel lines indicate an interaction.
368
Chapter 22
Figure 22-6
Nonparallel plot (left) and parallel plot (right)
After a plot is specified by selecting factors for the horizontal axis and, optionally,
factors for separate lines and separate plots, the plot must be added to the Plots list.
Post hoc multiple comparison tests. Once you have determined that differences exist
among the means, post hoc range tests and pairwise multiple comparisons can
determine which means differ. Comparisons are made on unadjusted values. These
tests are used for fixed between-subjects factors only. In GLM Repeated Measures,
these tests are not available if there are no between-subjects factors, and the post hoc
369
multiple comparison tests are performed for the average across the levels of the
within-subjects factors. For GLM Multivariate, the post hoc tests are performed for
each dependent variable separately. GLM Multivariate and GLM Repeated Measures
are available only if you have the Advanced Models option installed.
The Bonferroni and Tukey's honestly significant difference tests are commonly
used multiple comparison tests. The Bonferroni test, based on Student's t statistic,
adjusts the observed significance level for the fact that multiple comparisons are
made. Sidak's t test also adjusts the significance level and provides tighter bounds
than the Bonferroni test. Tukey's honestly significant difference test uses the
Studentized range statistic to make all pairwise comparisons between groups and sets
the experimentwise error rate to the error rate for the collection for all pairwise
comparisons. When testing a large number of pairs of means, Tukey's honestly
significant difference test is more powerful than the Bonferroni test. For a small
number of pairs, Bonferroni is more powerful.
Hochberg's GT2 is similar to Tukey's honestly significant difference test, but the
Studentized maximum modulus is used. Usually, Tukey's test is more powerful.
Gabriel's pairwise comparisons test also uses the Studentized maximum modulus
and is generally more powerful than Hochberg's GT2 when the cell sizes are unequal.
Gabriel's test may become liberal when the cell sizes vary greatly.
Dunnett's pairwise multiple comparison t test compares a set of treatments
against a single control mean. The last category is the default control category.
Alternatively, you can choose the first category. You can also choose a two-sided or
one-sided test. To test that the mean at any level (except the control category) of the
factor is not equal to that of the control category, use a two-sided test. To test whether
the mean at any level of the factor is smaller than that of the control category, select <
Control. Likewise, to test whether the mean at any level of the factor is larger than that
of the control category, select > Control.
Ryan, Einot, Gabriel, and Welsch (R-E-G-W) developed two multiple step-down
range tests. Multiple step-down procedures first test whether all means are equal.
If all means are not equal, subsets of means are tested for equality. R-E-G-W F is
based on an F test and R-E-G-W Q is based on the Studentized range. These tests
are more powerful than Duncan's multiple range test and Student-Newman-Keuls
(which are also multiple step-down procedures), but they are not recommended
for unequal cell sizes.
When the variances are unequal, use Tamhane's T2 (conservative pairwise
comparisons test based on a t test), Dunnett's T3 (pairwise comparison test based
on the Studentized maximum modulus), Games-Howellpairwise comparison
370
Chapter 22
GLM Save
Figure 22-8
Univariate Save dialog box
You can save values predicted by the model, residuals, and related measures as new
variables in the Data Editor. Many of these variables can be used for examining
assumptions about the data. To save the values for use in another SPSS session, you
must save the current data file.
Predicted Values. The values that the model predicts for each case.
Unstandardized. The value the model predicts for the dependent variable.
Weighted. Weighted unstandardized predicted values. Available only if a WLS
variable was previously selected.
Standard error. An estimate of the standard deviation of the average value of
the dependent variable for cases that have the same values of the independent
variables.
Diagnostics. Measures to identify cases with unusual combinations of values for the
independent variables and cases that may have a large impact on the model.
372
Chapter 22
Cook's distance. A measure of how much the residuals of all cases would
change if a particular case were excluded from the calculation of the regression
coefficients. A large Cook's D indicates that excluding a case from computation
of the regression statistics, changes the coefficients substantially.
Leverage values. Uncentered leverage values. The relative influence of each
observation on the model's fit.
Residuals. An unstandardized residual is the actual value of the dependent variable
minus the value predicted by the model. Standardized, Studentized, and deleted
residuals are also available. If a WLS variable was chosen, weighted unstandardized
residuals are available.
Unstandardized. The difference between an observed value and the value
predicted by the model.
Weighted. Weighted unstandardized residuals. Available only if a WLS variable
was previously selected.
Standardized. The residual divided by an estimate of its standard deviation.
Standardized residuals which are also known as Pearson residuals, have a mean
of 0 and a standard deviation of 1.
Studentized. The residual divided by an estimate of its standard deviation that
varies from case to case, depending on the distance of each case's values on the
independent variables from the means of the independent variables.
Deleted. The residual for a case when that case is excluded from the calculation of
the regression coefficients. It is the difference between the value of the dependent
variable and the adjusted predicted value.
Save to New File. Writes an SPSS data file containing a variance-covariance matrix of
the parameter estimates in the model. Also, for each dependent variable, there will
be a row of parameter estimates, a row of significance values for the t statistics
corresponding to the parameter estimates, and a row of residual degrees of freedom.
For a multivariate model, there are similar rows for each dependent variable. You can
use this matrix file in other procedures that read an SPSS matrix file.
373
GLM Options
Figure 22-9
Univariate Options dialog box
Optional statistics are available from this dialog box. Statistics are calculated using
a fixed-effects model.
Estimated Marginal Means. Select the factors and interactions for which you want
estimates of the population marginal means in the cells. These means are adjusted for
the covariates, if any.
Compare main effects. Provides uncorrected pairwise comparisons among
estimated marginal means for any main effect in the model, for both between- and
within-subjects factors. This item is available only if main effects are selected
under the Display Means For list.
Confidence interval adjustment. Select least significant difference (LSD),
Bonferroni, or Sidak adjustment to the confidence intervals and significance.
This item is available only if Compare main effects is selected.
374
Chapter 22
23
Bivariate Correlations
377
378
Chapter 23
Sample Output
Figure 23-1
Bivariate Correlations output
Correlations
Bivariate Correlations
Figure 23-2
Bivariate Correlations dialog box
Chapter 23
Statistics. For Pearson correlations, you can choose one or both of the following:
Means and standard deviations. Displayed for each variable. The number of
cases with nonmissing values is also shown. Missing values are handled on a
variable-by-variable basis regardless of your missing values setting.
Cross-product deviations and covariances. Displayed for each pair of variables.
The cross-product of deviations is equal to the sum of the products of
mean-corrected variables. This is the numerator of the Pearson correlation
coefficient. The covariance is an unstandardized measure of the relationship
between two variables, equal to the cross-product deviation divided by N–1.
Missing Values. You can choose one of the following:
Exclude cases pairwise. Cases with missing values for one or both of a pair of
variables for a correlation coefficient are excluded from the analysis. Since each
coefficient is based on all cases that have valid codes on that particular pair of
381
Bivariate Correlations
24
Partial Correlations
383
384
Chapter 24
Sample Output
Figure 24-1
Partial Correlations output
Correlations
Partial Correlations
Figure 24-2
Partial Correlations dialog box
E Select two or more numeric variables for which partial correlations are to be
computed.
Chapter 24
25
Distances
387
388
Chapter 25
Figure 25-1
Distances dialog box
E Select at least one numeric variable to compute distances between cases, or select at
least two numeric variables to compute distances between variables.
Distances
From the Measure group, select the alternative that corresponds to your type of data
(interval, count, or binary); then, from the drop-down list, select one of the measures
that corresponds to that type of data. Available measures, by data type, are:
Interval data. Euclidean distance, squared Euclidean distance, Chebychev, block,
Minkowski, or customized.
Count data. Chi-square measure or phi-square measure.
Binary data. Euclidean distance, squared Euclidean distance, size difference,
pattern difference, variance, shape, or Lance and Williams. (Enter values for
Present and Absent to specify which two values are meaningful; Distances will
ignore all other values.)
The Transform Values group allows you to standardize data values for either cases or
variables before computing proximities. These transformations are not applicable to
binary data. Available standardization methods are z scores, range –1 to 1, range 0 to
1, maximum magnitude of 1, mean of 1, or standard deviation of 1.
The Transform Measures group allows you to transform the values generated by
the distance measure. They are applied after the distance measure has been computed.
Available options are absolute values, change sign, and rescale to 0–1 range.
390
Chapter 25
From the Measure group, select the alternative that corresponds to your type of data
(interval or binary); then, from the drop-down list, select one of the measures that
corresponds to that type of data. Available measures, by data type, are:
Interval data. Pearson correlation or cosine.
Binary data. Russell and Rao, simple matching, Jaccard, Dice, Rogers and
Tanimoto, Sokal and Sneath 1, Sokal and Sneath 2, Sokal and Sneath 3,
Kulczynski 1, Kulczynski 2, Sokal and Sneath 4, Hamann, Lambda, Anderberg's
D, Yule's Y, Yule's Q, Ochiai, Sokal and Sneath 5, phi 4-point correlation, or
dispersion. (Enter values for Present and Absent to specify which two values are
meaningful; Distances will ignore all other values.)
The Transform Values group allows you to standardize data values for either cases or
variables before computing proximities. These transformations are not applicable to
binary data. Available standardization methods are z scores, range –1 to 1, range 0 to
1, maximum magnitude of 1, mean of 1, and standard deviation of 1.
The Transform Measures group allows you to transform the values generated by
the distance measure. They are applied after the distance measure has been computed.
Available options are absolute values, change sign, and rescale to 0–1 range.
Chapter
26
Linear Regression
Linear Regression estimates the coefficients of the linear equation, involving one or
more independent variables, that best predict the value of the dependent variable.
For example, you can try to predict a salesperson's total yearly sales (the dependent
variable) from independent variables such as age, education, and years of experience.
Example. Is the number of games won by a basketball team in a season related to the
average number of points the team scores per game? A scatterplot indicates that these
variables are linearly related. The number of games won and the average number
of points scored by the opponent are also linearly related. These variables have a
negative relationship. As the number of games won increases, the average number
of points scored by the opponent decreases. With linear regression, you can model
the relationship of these variables. A good model can be used to predict how many
games teams will win.
Statistics. For each variable: number of valid cases, mean, and standard deviation.
For each model: regression coefficients, correlation matrix, part and partial
correlations, multiple R, R2, adjusted R2, change in R2, standard error of the estimate,
analysis-of-variance table, predicted values, and residuals. Also, 95% confidence
intervals for each regression coefficient, variance-covariance matrix, variance
inflation factor, tolerance, Durbin-Watson test, distance measures (Mahalanobis,
Cook, and leverage values), DfBeta, DfFit, prediction intervals, and casewise
diagnostics. Plots: scatterplots, partial plots, histograms, and normal probability plots.
391
392
Chapter 26
Assumptions. For each value of the independent variable, the distribution of the
dependent variable must be normal. The variance of the distribution of the dependent
variable should be constant for all values of the independent variable. The relationship
between the dependent variable and each independent variable should be linear, and
all observations should be independent.
Sample Output
Figure 26-1
Linear Regression output
70
60
Number of Games Won
50
40
30
20
10
90 100 110 120
70
60
Number of Games Won
50
40
30
20
10
80 90 100 110 120
Linear Regression
Std. Error
Variables
Adjusted R of the
Entered Removed R R Square Square Estimate
Model 1 Defense
Points
Per
Game,
. .947 .898 .889 4.40
Scoring
Points
Per
1,2
Game
1. Indep. vars: (constant) Defense Points Per Game, Scoring Points Per Game...
2. All requested variables entered.
3. Dependent Variable: Number of Games Won
4. Method: Enter
ANOVA 2
Sum of Mean
Squares df Square F Significance
Model 1 Regression 4080.533 2 2040.266 105.198 .0001
Residual 465.467 24 19.394
Total 4546.000 26
1. Indep. vars: (constant) Defense Points Per Game, Scoring Points Per Game...
2. Dependent Variable: Number of Games Won
394
Chapter 26
2.0
1.5
1.0
Standardized Residual
.5
0.0
-.5
-1.0
-1.5
-2.0
10 20 30 40 50 60 70
Linear Regression
Figure 26-2
Linear Regression dialog box
WLS. Allows you to obtain a weighted least-squares model. Data points are weighted
by the reciprocal of their variances. This means that observations with large variances
have less impact on the analysis than observations associated with small variances. If
396
Chapter 26
the value of the weighting variable is zero, negative, or missing, the case is excluded
from the analysis.
The significance values in your output are based on fitting a single model. Therefore,
the significance values are generally invalid when a stepwise method (Stepwise,
Forward, or Backward) is used.
397
Linear Regression
All variables must pass the tolerance criterion to be entered in the equation,
regardless of the entry method specified. The default tolerance level is 0.0001. Also,
a variable is not entered if it would cause the tolerance of another variable already in
the model to drop below the tolerance criterion.
All independent variables selected are added to a single regression model.
However, you can specify different entry methods for different subsets of variables.
For example, you can enter one block of variables into the regression model using
stepwise selection and a second block using forward selection. To add a second block
of variables to the regression model, click Next.
Cases defined by the selection rule are included in the analysis. For example, if
you select a variable, equals, and 5 for the value, then only cases for which the
selected variable has a value equal to 5 are included in the analysis. A string value
is also permitted.
398
Chapter 26
Plots can aid in the validation of the assumptions of normality, linearity, and equality
of variances. Plots are also useful for detecting outliers, unusual observations, and
influential cases. After saving them as new variables, predicted values, residuals,
and other diagnostics are available in the Data Editor for constructing plots with the
independent variables. The following plots are available:
Scatterplots. You can plot any two of the following: the dependent variable,
standardized predicted values, standardized residuals, deleted residuals, adjusted
predicted values, Studentized residuals, or Studentized deleted residuals. Plot the
standardized residuals against the standardized predicted values to check for linearity
and equality of variances.
Source variable list. Lists the dependent variable (DEPENDNT) and the following
predicted and residual variables: Standardized predicted values (*ZPRED),
Standardized residuals (*ZRESID), Deleted residuals (*DRESID), Adjusted
predicted values (*ADJPRED), Studentized residuals (*SRESID), Studentized
deleted residuals (*SDRESID).
Produce all partial plots. Displays scatterplots of residuals of each independent
variable and the residuals of the dependent variable when both variables are regressed
separately on the rest of the independent variables. At least two independent variables
must be in the equation for a partial plot to be produced.
399
Linear Regression
Standardized Residual Plots. You can obtain histograms of standardized residuals and
normal probability plots comparing the distribution of standardized residuals to
a normal distribution.
If any plots are requested, summary statistics are displayed for standardized predicted
values and standardized residuals (*ZPRED and *ZRESID).
You can save predicted values, residuals, and other statistics useful for diagnostics.
Each selection adds one or more new variables to your active data file.
Predicted Values. Values that the regression model predicts for each case.
Unstandardized. The value the model predicts for the dependent variable.
400
Chapter 26
Linear Regression
Chapter 26
square root of p/N, where p is the number of parameters in the model and N is
the number of cases.
Covariance ratio. The ratio of the determinant of the covariance matrix with a
particular case excluded from the calculation of the regression coefficients to the
determinant of the covariance matrix with all cases included. If the ratio is close
to 1, the case does not significantly alter the covariance matrix.
Save to New File. Saves regression coefficients to a file that you specify.
Export model information to XML file. Exports model information to the specified file.
SmartScore and future releases of WhatIf? will be able to use this file.
Linear Regression
Model fit. The variables entered and removed from the model are listed, and the
following goodness-of-fit statistics are displayed: multiple R, R2 and adjusted R2,
standard error of the estimate, and an analysis-of-variance table.
R squared change. The change in the R2 statistic that is produced by adding or deleting
an independent variable. If the R2 change associated with a variable is large, that
means that the variable is a good predictor of the dependent variable.
Descriptives. Provides the number of valid cases, the mean, and the standard deviation
for each variable in the analysis. A correlation matrix with a one-tailed significance
level and the number of cases for each correlation are also displayed.
Part and partial correlations. Displays the zero-order, part, and partial correlations.
Values of a correlation coefficient range from –1 to 1. The sign of the coefficient
indicates the direction of the relationship, and its absolute value indicates the strength,
with larger absolute values indicating stronger relationships.
Collinearity diagnostics. Collinearity (or multicollinearity) is the undesirable situation
when one independent variable is a linear function of other independent variables.
Eigenvalues of the scaled and uncentered cross-products matrix, condition indices,
and variance-decomposition proportions are displayed along with variance inflation
factors (VIF) and tolerances for individual variables.
Residuals. Displays the Durbin-Watson test for serial correlation of the residuals and
casewise diagnostics for the cases meeting the selection criterion (outliers above
n standard deviations).
404
Chapter 26
Linear Regression
27
Curve Estimation
The Curve Estimation procedure produces curve estimation regression statistics and
related plots for 11 different curve estimation regression models. A separate model is
produced for each dependent variable. You can also save predicted values, residuals,
and prediction intervals as new variables.
Example. A fire insurance company conducts a study to relate the amount of damage
in serious residential fires to the distance between the closest fire station and the
residence. A scatterplot reveals that the relationship between fire damage and distance
to the fire station is linear. You might fit a linear model to the data and check the
validity of assumptions and the goodness of fit of the model.
Statistics. For each model: regression coefficients, multiple R, R2, adjusted R2,
standard error of the estimate, analysis-of-variance table, predicted values, residuals,
and prediction intervals. Models: linear, logarithmic, inverse, quadratic, cubic, power,
compound, S-curve, logistic, growth, and exponential.
407
408
Chapter 27
used, the following assumptions should be met. For each value of the independent
variable, the distribution of the dependent variable must be normal. The variance
of the distribution of the dependent variable should be constant for all values of
the independent variable. The relationship between the dependent variable and the
independent variable should be linear, and all observations should be independent.
Sample Output
Figure 27-1
Curve Estimation output
MODEL: MOD_1.
Multiple R .96098
R Square .92348
Adjusted R Square .91759
Standard Error 2.31635
Analysis of Variance:
Name Label
ERR_1 Error for DAMAGE with DISTANCE from CURVEFIT, MOD_1 LINEAR
409
Curve Estimation
40
30
20
Observed
10 Linear
0 1 2 3 4 5 6 7
Chapter 27
Figure 27-2
Curve Estimation dialog box
E Select one or more dependent variables. A separate model is produced for each
dependent variable.
E Select an independent variable (either a variable in the working data file or Time).
Curve Estimation
Plot models. Plots the values of the dependent variable and each selected model
against the independent variable. A separate chart is produced for each dependent
variable.
Display ANOVA table. Displays a summary analysis-of-variance table for each
selected model.
Chapter 27
Save Variables. For each selected model, you can save predicted values, residuals
(observed value of the dependent variable minus the model predicted value),
and prediction intervals (upper and lower bounds). The new variable names and
descriptive labels are displayed in a table in the output window.
Predict Cases. If you select Time instead of a variable in the working data file as the
independent variable, you can specify a forecast period beyond the end of the time
series. You can choose one of the following alternatives:
Predict from estimation period through last case. Predicts values for all cases in the
file, based on the cases in the estimation period. The estimation period, displayed
at the bottom of the dialog box, is defined with the Range subdialog box of the
Select Cases option on the Data menu. If no estimation period has been defined,
all cases are used to predict values.
Predict through. Predicts values through the specified date, time, or observation
number, based on the cases in the estimation period. This can be used to forecast
values beyond the last case in the time series. The available text boxes for
specifying the end of the prediction period are dependent on the currently defined
date variables. If there are no defined date variables, you can specify the ending
observation (case) number.
Use the Define Dates option on the Data menu to create date variables.
Chapter
28
Discriminant Analysis
Discriminant analysis is useful for situations where you want to build a predictive
model of group membership based on observed characteristics of each case. The
procedure generates a discriminant function (or, for more than two groups, a set of
discriminant functions) based on linear combinations of the predictor variables that
provide the best discrimination between the groups. The functions are generated from
a sample of cases for which group membership is known; the functions can then be
applied to new cases with measurements for the predictor variables but unknown
group membership.
Note: The grouping variable can have more than two values. The codes for the
grouping variable must be integers, however, and you need to specify their minimum
and maximum values. Cases with values outside of these bounds are excluded from
the analysis.
Example. On average, people in temperate zone countries consume more calories per
day than those in the tropics, and a greater proportion of the people in the temperate
zones are city dwellers. A researcher wants to combine this information in a function
to determine how well an individual can discriminate between the two groups of
countries. The researcher thinks that population size and economic information may
also be important. Discriminant analysis allows you to estimate coefficients of the
linear discriminant function, which looks like the right side of a multiple linear
regression equation. That is, using coefficients a, b, c, and d, the function is:
413
414
Chapter 28
If these variables are useful for discriminating between the two climate zones, the
values of D will differ for the temperate and tropic countries. If you use a stepwise
variable selection method, you may find that you do not need to include all four
variables in the function.
Statistics. For each variable: means, standard deviations, univariate ANOVA. For
each analysis: Box's M, within-groups correlation matrix, within-groups covariance
matrix, separate-groups covariance matrix, total covariance matrix. For each
canonical discriminant function: eigenvalue, percentage of variance, canonical
correlation, Wilks' lambda, chi-square. For each step: prior probabilities, Fisher's
function coefficients, unstandardized function coefficients, Wilks' lambda for each
canonical function.
Data. The grouping variable must have a limited number of distinct categories, coded
as integers. Independent variables that are nominal must be recoded to dummy or
contrast variables.
Assumptions. Cases should be independent. Predictor variables should have a
multivariate normal distribution, and within-group variance-covariance matrices
should be equal across groups. Group membership is assumed to be mutually
exclusive (that is, no case belongs to more than one group) and collectively exhaustive
(that is, all cases are members of a group). The procedure is most effective when
group membership is a truly categorical variable; if group membership is based on
values of a continuous variable (for example, high IQ versus low IQ), you should
consider using linear regression to take advantage of the richer information offered by
the continuous variable itself.
Sample Output
Figure 28-1
Discriminant analysis output
Eigenvalues
% of Cumulative Canonical
Function Eigenvalue Variance % Correlation
1 1.002 100.0 100.0 .707
415
Discriminant Analysis
Wilks' Lambda
Test of Wilks'
Function(s) Lambda Chi-square df Sig.
1 .499 31.934 4 .000
Structure Matrix
Function
1
CALORIES .986
LOG_GDP .790
URBAN .488
LOG_POP .082
Functions at Group
Centroids
Function
CLIMATE 1
tropical -.869
temperate 1.107
Chapter 28
Figure 28-2
Discriminant Analysis dialog box
E Select an integer-valued grouping variable and click Define Range to specify the
categories of interest.
E Select the independent, or predictor, variables. (If your grouping variable does not
have integer values, Automatic Recode on the Transform menu will create one that
does.)
Discriminant Analysis
Specify the minimum and maximum value of the grouping value for the analysis.
Cases with values outside of this range are not used in the discriminant analysis but
are classified into one of the existing groups based on the results of the analysis. The
minimum and maximum must be integers.
To select cases for your analysis, in the main dialog box click Select, choose a
selection variable, and click Value to enter an integer as the selection value. Only cases
with that value for the selection variable are used to derive the discriminant functions.
Statistics and classification results are generated for both selected and unselected
cases. This provides a mechanism for classifying new cases based on previously
existing data or for partitioning your data into training and testing subsets to perform
validation on the model generated.
418
Chapter 28
Discriminant Analysis
Method. Select the statistic to be used for entering or removing new variables.
Available alternatives are Wilks' lambda, unexplained variance, Mahalanobis'
distance, smallest F ratio, and Rao's V. With Rao's V, you can specify the minimum
increase in V for a variable to enter.
Wilks' lambda. A variable selection method for stepwise discriminant analysis
that chooses variables for entry into the equation on the basis of how much
they lower Wilks' lambda. At each step, the variable that minimizes the overall
Wilks' lambda is entered.
Unexplained variance. At each step, the variable that minimizes the sum of the
unexplained variation between groups is entered.
420
Chapter 28
Discriminant Analysis
Prior Probabilities. These values are used in classification. You can specify equal prior
probabilities for all groups, or you can let the observed group sizes in your sample
determine the probabilities of group membership.
Display. Available display options are casewise results, summary table, and
leave-one-out classification.
Casewise results. Codes for actual group, predicted group, posterior probabilities,
and discriminant scores are displayed for each case.
Summary table. The number of cases correctly and incorrectly assigned to each of
the groups based on the discriminant analysis. Sometimes called the "Confusion
Matrix."
Leave-one-out classification. Each case in the analysis is classified by the functions
derived from all cases other than that case. It is also known as the "U-method."
Replace missing values with mean. Select this option to substitute the mean of an
independent variable for a missing value during the classification phase only.
Use Covariance Matrix. You can choose to classify cases using a within-groups
covariance matrix or a separate-groups covariance matrix.
422
Chapter 28
You can add new variables to your active data file. Available options are predicted
group membership (a single variable), discriminant scores (one variable for each
discriminant function in the solution), and probabilities of group membership given
the discriminant scores (one variable for each group).
You can also export model information to the specified file. SmartScore and future
releases of WhatIf? will be able to use this file.
Chapter
29
Factor Analysis
423
424
Chapter 29
Factor Analysis
Sample Output
Figure 29-1
Factor analysis output
Descriptive Statistics
Std. Analysis
Mean Deviation N
Average female life expectancy 72.833 8.272 72
Infant mortality (deaths per 1000 live
35.132 32.222 72
births)
People who read (%) 82.472 18.625 72
Birth rate per 1000 people 24.375 10.552 72
Fertility: average number of kids 3.205 1.593 72
People living in cities (%) 62.583 22.835 72
Log (base 10) of GDP_CAP 3.504 .608 72
Population increase (% per year)) 1.697 1.156 72
Birth to death ratio 3.577 2.313 72
Death rate per 1000 people 8.038 3.174 72
Log (base 10) of Population 4.153 .686 72
Communalities
Initial Extraction
LIFEEXPF 1.000 .953
BABYMORT 1.000 .949
LITERACY 1.000 .825
BIRTH_RT 1.000 .943
FERTILTY 1.000 .875
URBAN 1.000 .604
LOG_GDP 1.000 .738
POP_INCR 1.000 .945
B_TO_D 1.000 .925
DEATH_RT 1.000 .689
LOG_POP 1.000 .292
Chapter 29
Scree Plot
7
2
Eigenvalue
0
1 2 3 4 5 6 7 8 9 10 11
Component Number
427
Factor Analysis
Component
1 2
BIRTH_RT .969
FERTILTY .931
LITERACY -.880 .226
LIFEEXPF -.856 .469
BABYMORT .853 -.469
POP_INCR .847 .476
LOG_GDP -.794 .327
URBAN -.561 .539
DEATH_RT -.827
B_TO_D .614 .741
LOG_POP -.520
1 2
Component 1 .982 -.190
2 .190 .982
Chapter 29
people living in ci t
aver age female li fe population increase
.5
log ( base 10) of gdp
people who read (%)
fertility:
birth rateaverage n
per 100
0.0
-.5
-1.0
-1.0 -.5 0.0 .5 1.0
Component 1
Factor Analysis
Figure 29-2
Factor Analysis dialog box
To select cases for your analysis, choose a selection variable, and click Value to
enter an integer as the selection value. Only cases with that value for the selection
variable are used in the factor analysis.
430
Chapter 29
Statistics. Univariate statistics include the mean, standard deviation, and number
of valid cases for each variable. Initial solution displays initial communalities,
eigenvalues, and the percentage of variance explained.
Correlation Matrix. The available options are coefficients, significance levels,
determinant, KMO and Bartlett's test of sphericity, inverse, reproduced, and
anti-image.
KMO and Bartlett's Test of Sphericity. The Kaiser-Meyer-Olkin measure of
sampling adequacy tests whether the partial correlations among variables are
small. Bartlett's test of sphericity tests whether the correlation matrix is an
identity matrix, which would indicate that the factor model is inappropriate.
Reproduced. The estimated correlation matrix from the factor solution. Residuals
(difference between estimated and observed correlations) are also displayed.
Anti-image. The anti-image correlation matrix contains the negatives of the
partial correlation coefficients, and the anti-image covariance matrix contains
the negatives of the partial covariances. In a good factor model, most of the
off-diagonal elements will be small. The measure of sampling adequacy for a
variable is displayed on the diagonal of the anti-image correlation matrix.
431
Factor Analysis
Method. Allows you to specify the method of factor extraction. Available methods are
principal components, unweighted least squares, generalized least squares, maximum
likelihood, principal axis factoring, alpha factoring, and image factoring.
Principal Components Analysis. A factor extraction method used to form
uncorrelated linear combinations of the observed variables. The first component
has maximum variance. Successive components explain progressively smaller
portions of the variance and are all uncorrelated with each other. Principal
components analysis is used to obtain the initial factor solution. It can be used
when a correlation matrix is singular.
Unweighted Least-Squares Method. A factor extraction method that minimizes the
sum of the squared differences between the observed and reproduced correlation
matrices ignoring the diagonals.
432
Chapter 29
Factor Analysis
Method. Allows you to select the method of factor rotation. Available methods are
varimax, direct oblimin, quartimax, equamax, or promax.
434
Chapter 29
Factor Analysis
Save as variables. Creates one new variable for each factor in the final solution. Select
one of the following alternative methods for calculating the factor scores: regression,
Bartlett, or Anderson-Rubin.
Regression Method. A method for estimating factor score coefficients. The scores
produced have mean of 0 and a variance equal to the squared multiple correlation
between the estimated factor scores and the true factor values. The scores may be
correlated even when factors are orthogonal.
Bartlett Scores. A method of estimating factor score coefficients. The scores
produced have a mean of 0. The sum of squares of the unique factors over the
range of variables is minimized.
Anderson-Rubin Method. A method of estimating factor score coefficients; a
modification of the Bartlett method which ensures orthogonality of the estimated
factors. The scores produced have a mean of 0, a standard deviation of 1, and
are uncorrelated.
Display factor score coefficient matrix. Shows the coefficients by which variables are
multiplied to obtain factor scores. Also shows the correlations between factor scores.
436
Chapter 29
Missing Values. Allows you to specify how missing values are handled. The available
alternatives are to exclude cases listwise, exclude cases pairwise, or replace with
mean.
Coefficient Display Format. Allows you to control aspects of the output matrices.
You sort coefficients by size and suppress coefficients with absolute values less
than the specified value.
30
Choosing a Procedure for Clustering
TwoStep Cluster Analysis. For many applications, the TwoStep Cluster Analysis
procedure will be the method of choice. It provides the following unique features:
Automatic selection of the best number of clusters, in addition to measures
for choosing between cluster models.
Ability to create cluster models simultaneously based on categorical and
continuous variables.
Ability to save the cluster model to an external XML file, then read that file and
update the cluster model using newer data.
Additionally, the TwoStep Cluster Analysis procedure can analyze large data files.
437
438
Chapter 30
31
TwoStep Cluster Analysis
439
440
Chapter 31
Figure 31-1
TwoStep Cluster Analysis dialog box
Distance Measure. This selection determines how the similarity between two clusters
is computed.
Log-likelihood. The likelihood measure places a probability distribution on the
variables. Continuous variables are assumed to be normally distributed, while
categorical variables are assumed to be multinomial. All variables are assumed to
be independent.
Euclidean. The Euclidean measure is the “straight line” distance between two
clusters. It can be used only when all of the variables are continuous.
Number of Clusters. This selection allows you to specify how the number of clusters is
to be determined.
441
Chapter 31
Outlier Treatment. This group allows you to treat outliers specially during clustering if
the cluster features (CF) tree fills. The CF tree is full if it cannot accept any more
cases in a leaf node and no leaf node can be split.
If you select noise handling and the CF tree fills, it will be regrown after placing
cases in sparse leaves into a “noise” leaf. A leaf is considered sparse if it contains
fewer than the specified percentage of cases of the maximum leaf size. After
the tree is regrown, the outliers will be placed in the CF tree if possible. If
not, the outliers are discarded.
If you do not select noise handling and the CF tree fills, it will be regrown
using a larger distance change threshold. After final clustering, values that
cannot be assigned to a cluster are labeled outliers. The outlier cluster is given
an identification number of -1 and is not included in the count of the number
of clusters.
444
Chapter 31
Memory Allocation. This group allows you to specify the maximum amount of
memory in megabytes (MB) that the cluster algorithm should use. If the procedure
exceeds this maximum, it will use the disk to store information that will not fit in
memory. Specify a number greater than or equal to 4.
Consult your system administrator for the largest value that you can specify
on your system.
The algorithm may fail to find the correct or desired number of clusters if this
value is too low.
Advanced Options
CF Tree Tuning Criteria. The following clustering algorithm settings apply specifically
to the cluster features (CF) tree and should be changed with care:
Initial Distance Change Threshold. This is the initial threshold used to grow the CF
tree. If inserting a given case into a leaf of the CF tree would yield tightness less
than the threshold, the leaf is not split. If the tightness exceeds the threshold,
the leaf is split.
Maximum Branches (per leaf node). The maximum number of child nodes that
a leaf node can have.
Maximum Tree Depth. The maximum number of levels that the CF tree can have.
Maximum Number of Nodes Possible. This indicates the maximum number of
CF tree nodes that could potentially be generated by the procedure, based on
the function (bd+1-1) / (b-1), where b is the maximum branches and d is the
maximum tree depth. Be aware that an overly large CF tree can be a drain on
system resources and can adversely affect the performance of the procedure. At a
minimum, each node requires 16 bytes.
Cluster Model Update. This group allows you to import and update a cluster model
generated in a prior analysis. The input file contains the CF tree in XML format. The
model will then be updated with the data in the active file. You must select the
445
variable names in the main dialog box in the same order in which they were specified
in the prior analysis. The XML file remains unaltered, unless you specifically
write the new model information to the same filename. For more information, see
“TwoStep Cluster Analysis Output” on page 447.
If a cluster model update is specified, the options pertaining to generation of the
CF tree that were specified for the original model are used. More specifically, the
distance measure, noise handling, memory allocation, or CF tree tuning criteria
settings for the saved model are used, and any settings for these options in the dialog
boxes are ignored.
Note: When performing a cluster model update, the procedure assumes that none
of the selected cases in the working data file were used to create the original cluster
model. The procedure also assumes that the cases used in the model update come
from the same population as the cases used to create the original model; that is, the
means and variances of continuous variables and levels of categorical variables are
assumed to be the same across both sets of cases. If your “new” and “old” sets of
cases come from heterogeneous populations, you should run the TwoStep Cluster
Analysis procedure on the combined sets of cases for the best results.
446
Chapter 31
Within cluster percentage chart. Displays charts showing the within-cluster variation
of each variable. For each categorical variable, a clustered bar chart is produced,
showing the category frequency by cluster ID. For each continuous variable, an error
bar chart is produced, showing error bars by cluster ID.
Cluster pie chart. Displays a pie chart showing the percentage and counts of
observations within each cluster.
Variable Importance Plot. Displays several different charts showing the importance
of each variable within each cluster. The output is sorted by the importance rank
of each variable.
Rank Variables. This option determines whether plots will be created for each
cluster (By cluster) or for each variable (By variable).
Importance Measure. This option allows you to select which measure of variable
importance to plot. Chi-square or t-test of significance reports a Pearson chi-square
statistic as the importance of a categorical variable and a t statistic as the
importance of a continuous variable. Significance reports one minus the p value
447
for the test of equality of means for a continuous variable and the expected
frequency with the overall data set for a categorical variable.
Confidence level. This option allows you to set the confidence level for the test of
equality of a variable's distribution within a cluster versus the variable's overall
distribution. Specify a number less than 100 and greater than or equal to 50. The
value of the confidence level is shown as a vertical line in the variable importance
plots, if the plots are created by variable or if the significance measure is plotted.
Omit insignificant variables. Variables that are not significant at the specified
confidence level are not displayed in the variable importance plots.
Statistics. This group provides options for displaying tables of the clustering results.
The descriptive statistics and cluster frequencies are produced for the final cluster
model, while the information criterion table displays results for a range of cluster
solutions.
448
Chapter 31
Descriptives by cluster. Displays two tables that describe the variables in each
cluster. In one table, means and standard deviations are reported for continuous
variables by cluster. The other table reports frequencies of categorical variables
by cluster.
Cluster frequencies. Displays a table that reports the number of observations
in each cluster.
Information criterion (AIC or BIC). Displays a table containing the values of the AIC
or BIC, depending on the criterion chosen in the main dialog box, for different
numbers of clusters. This table is provided only when the number of clusters is
being determined automatically. If the number of clusters is fixed, this setting is
ignored and the table is not provided.
Working Data File. This group allows you to save variables to the working data file.
Create cluster membership variable. This variable contains a cluster identification
number for each case. The name of this variable is tsc_n, where n is a positive
integer indicating the ordinal of the working data file save operation completed
by this procedure in a given session.
XML Files. The final cluster model and CF tree are two types of output files that can
be exported in XML format.
Export final model. The final cluster model is exported to the specified file.
SmartScore and future releases of WhatIf? will be able to use this file.
Export CF tree. This option allows you to save the current state of the cluster tree
and update it later using newer data.
Chapter
32
Hierarchical Cluster Analysis
449
450
Chapter 32
Sample Output
Figure 32-1
Hierarchical cluster analysis output
Agglomeration Schedule
Stage Cluster
Cluster Combined First Appears
Cluster Cluster Cluster Cluster Next
1 2 Coefficients 1 2 Stage
Stage 1 11 12 .112 0 0 2
2 6 11 .132 0 1 4
3 7 9 .185 0 0 5
4 6 8 .227 2 0 7
5 7 10 .274 3 0 7
6 1 3 .423 0 0 10
7 6 7 .438 4 5 14
8 13 14 .484 0 0 15
9 2 5 .547 0 0 11
10 1 4 .691 6 0 11
11 1 2 1.023 10 9 13
12 15 16 1.370 0 0 13
13 1 15 1.716 11 12 14
14 1 6 2.642 13 7 15
15 1 13 4.772 14 8 0
Cluster Membership
4 3 2
Label Clusters Clusters Clusters
Case 1 Argentina 1 1 1
2 Brazil 1 1 1
3 Chile 1 1 1
4 Domincan
1 1 1
R.
5 Indonesia 1 1 1
6 Austria 2 2 1
7 Canada 2 2 1
8 Denmark 2 2 1
9 Italy 2 2 1
10 Japan 2 2 1
11 Norway 2 2 1
12 Switzerland 2 2 1
13 Bangladesh 3 3 2
14 India 3 3 2
15 Bolivia 4 1 1
16 Paraguay 4 1 1
451
Vertical Icicle
Case
4:Domincan R
13:Banglades
12:Switzerlan
16:Paraguay
5:Indonesia
1:Argentina
8:Denmark
11:Norway
7:Canada
15:Bolivia
10:Japan
6:Austria
14:India
2:Brazil
3:Chile
9:Italy
14
13
10
12
11
16
15
9
3
Number
of
clusters
1 XX XX XX XX XX XX XXX XX XX XX XX XX XX XXX X
2 XX X XX XX XX XX XXX XX XX XX XX XX XX XXX X
3 XX X XX XX XX XX XXX XX X XX XX XX XX XXX X
4 XX X XX XX XX XX XXX XX X XX X XX XX XXX X
5 XX X XX XX XX XX XXX XX X X X XX XX XXX X
6 XX X XX XX XX XX XXX XX X X X XX X XXX X
7 XX X XX XX XX XX XXX XX X X X XX X XX X
8 XX X XX XX XX XX XXX XX X X X X X XX X
9 X X XX XX XX XX XXX XX X X X X X XX X
10 X X XX XX X XX XXX XX X X X X X XX X
11 X X XX XX X XX XXX XX X X X X X X X
12 X X X XX X XX XXX XX X X X X X X X
13 X X X XX X X XXX XX X X X X X X X
14 X X X X X X XXX XX X X X X X X X
15 X X X X X X XXX X X X X X X X X
* * * * * * H I E R A R C H I C A L C L U S T E R A N A L Y S I S * * * * * *
C A S E 0 5 10 15 20 25
Label Num +---------+---------+---------+---------+---------+
LIFEEXPF 2 òûòòòòòø
BABYMORT 5 ò÷ ùòòòø
LITERACY 3 òòòòòòò÷ ùòòòòòòòòòòòø
BIRTH_RT 6 òûòòòòòòòòò÷ ùòòòòòòòòòòòòòòòø
FERTILTY 10 ò÷ ó ó
URBAN 1 òòòòòòòòòòòòòòòûòòòòòòò÷ ùòòòòòòòòòø
LOG_GDP 8 òòòòòòòòòòòòòòò÷ ó ó
POP_INCR 4 òòòòòòòûòòòòòòòòòòòòòòòòòòòòòòòòòø ó ó
B_TO_D 9 òòòòòòò÷ ùòòòòò÷ ó
DEATH_RT 7 òòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòò÷ ó
LOG_POP 11 òòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòò÷
Chapter 32
Figure 32-2
Hierarchical Cluster Analysis dialog box
E If you are clustering cases, select at least one numeric variable. If you are clustering
variables, select at least three numeric variables.
Optionally, you can select an identification variable to label cases.
453
Chapter 32
Transform Values. Allows you to standardize data values for either cases or
values before computing proximities (not available for binary data). Available
standardization methods are z scores, range –1 to 1, range 0 to 1, maximum magnitude
of 1, mean of 1, and standard deviation of 1.
Transform Measures. Allows you to transform the values generated by the distance
measure. They are applied after the distance measure has been computed. Available
alternatives are absolute values, change sign, and rescale to 0–1 range.
Agglomeration schedule. Displays the cases or clusters combined at each stage, the
distances between the cases or clusters being combined, and the last cluster level at
which a case (or variable) joined the cluster.
Proximity matrix. Gives the distances or similarities between items.
Cluster Membership. Displays the cluster to which each case is assigned at one or
more stages in the combination of clusters. Available options are single solution
and range of solutions.
455
Cluster Membership. Allows you to save cluster memberships for a single solution
or a range of solutions. Saved variables can then be used in subsequent analyses to
explore other differences between groups.
Chapter
33
K-Means Cluster Analysis
457
458
Chapter 33
Assumptions. Distances are computed using simple Euclidean distance. If you want
to use another distance or similarity measure, use the Hierarchical Cluster Analysis
procedure. Scaling of variables is an important consideration—if your variables are
measured on different scales (for example, one variable is expressed in dollars and
another is expressed in years), your results may be misleading. In such cases, you
should consider standardizing your variables before you perform the k-means cluster
analysis (this can be done in the Descriptives procedure). The procedure assumes that
you have selected the appropriate number of clusters and that you have included all
relevant variables. If you have chosen an inappropriate number of clusters or omitted
important variables, your results may be misleading.
Sample Output
Figure 33-1
K-means cluster analysis output
Initial Cluster Centers
Cluster
1 2 3 4
ZURBAN -1.88606 -1.54314 1.45741 .55724
ZLIFEEXP -3.52581 -1.69358 .62725 .99370
ZLITERAC -2.89320 -1.65146 -.51770 .88601
ZPOP_INC .93737 .16291 3.03701 -1.12785
ZBABYMOR 4.16813 1.38422 -.69589 -.88983
ZBIRTH_R 2.68796 .42699 .33278 -1.08033
ZDEATH_R 4.41517 .63185 -1.89037 .63185
ZLOG_GDP -1.99641 -1.78455 .53091 1.22118
ZB_TO_D -.52182 -.31333 4.40082 -.99285
ZFERTILT 2.24070 .75481 .46008 -.76793
ZLOG_POP .24626 2.65246 -1.29624 -.74406
459
Iteration History
Cluster
1 2 3 4
ZURBAN -1.70745 -.30863 .16816 .62767
ZLIFEEXP -2.52826 -.15939 -.28417 .80611
ZLITERAC -2.30833 .13880 -.81671 .73368
ZPOP_INC .59747 .13400 1.45301 -.95175
ZBABYMOR 2.43210 .22286 .25622 -.80817
ZBIRTH_R 1.52607 .12929 1.13716 -.99285
ZDEATH_R 2.10314 -.44640 -.71414 .31319
ZLOG_GDP -1.77704 -.58745 -.16871 .94249
ZB_TO_D -.29856 .19154 1.45251 -.84758
ZFERTILT 1.51003 -.12150 1.27010 -.87669
ZLOG_POP .83475 .34577 -.49499 -.22199
1 2 3 4
Cluster 1 5.627 5.640 7.924
2 5.627 2.897 3.249
3 5.640 2.897 5.246
4 7.924 3.249 5.246
460
Chapter 33
ANOVA
Cluster Error
Mean Mean
Square df Square df F Sig.
ZURBAN 10.409 3 .541 68 19.234 .000
ZLIFEEXP 19.410 3 .210 68 92.614 .000
ZLITERAC 18.731 3 .229 68 81.655 .000
ZPOP_INC 18.464 3 .219 68 84.428 .000
ZBABYMOR 18.621 3 .239 68 77.859 .000
ZBIRTH_R 19.599 3 .167 68 117.339 .000
ZDEATH_R 13.628 3 .444 68 30.676 .000
ZLOG_GDP 17.599 3 .287 68 61.313 .000
ZB_TO_D 16.316 3 .288 68 56.682 .000
ZFERTILT 18.829 3 .168 68 112.273 .000
ZLOG_POP 3.907 3 .877 68 4.457 .006
Figure 33-2
K-Means Cluster Analysis dialog box
E Specify the number of clusters. The number of clusters must be at least two and must
not be greater than the number of cases in the data file.
Chapter 33
These options are available only if you select the Iterate and Classify method from the
main dialog box.
Maximum Iterations. Limits the number of iterations in the k-means algorithm.
Iteration stops after this many iterations even if the convergence criterion is not
satisfied. This number must be between 1 and 999.
To reproduce the algorithm used by the Quick Cluster command prior to version 5.0,
set Maximum Iterations to 1.
Convergence Criterion. Determines when iteration ceases. It represents a proportion of
the minimum distance between initial cluster centers, so it must be greater than 0 but
not greater than 1. If the criterion equals 0.02, for example, iteration ceases when a
complete iteration does not move any of the cluster centers by a distance of more than
2% of the smallest distance between any of the initial cluster centers.
Use running means. Allows you to request that cluster centers be updated after each
case is assigned. If you do not select this option, new cluster centers are calculated
after all cases have been assigned.
You can save information about the solution as new variables to be used in subsequent
analyses:
Cluster membership. Creates a new variable indicating the final cluster membership of
each case. Values of the new variable range from 1 to the number of clusters.
Distance from cluster center. Creates a new variable indicating the Euclidean distance
between each case and its classification center.
Statistics. You can select the following statistics: initial cluster centers, ANOVA table,
and cluster information for each case.
Initial cluster centers. First estimate of the variable means for each of the clusters.
By default, a number of well-spaced cases equal to the number of clusters
is selected from the data. Initial cluster centers are used for a first round of
classification and are then updated.
ANOVA table. Displays an analysis-of-variance table which includes univariate
F tests for each clustering variable. The F tests are only descriptive and the
resulting probabilities should not be interpreted. The ANOVA table is not
displayed if all cases are assigned to a single cluster.
Cluster information for each case. Displays for each case the final cluster
assignment and the Euclidean distance between the case and the cluster center
used to classify the case. Also displays Euclidean distance between final cluster
centers.
464
Chapter 33
Missing Values. Available options are Exclude cases listwise or Exclude cases
pairwise.
Exclude cases listwise. Excludes cases with missing values for any clustering
variable from the analysis.
Exclude cases pairwise. Assigns cases to clusters based on distances computed
from all variables with nonmissing values.
Chapter
34
Nonparametric Tests
The Nonparametric Tests procedure provides several tests that do not require
assumptions about the shape of the underlying distribution:
Chi-Square Test. Tabulates a variable into categories and computes a chi-square
statistic based on the differences between observed and expected frequencies.
Binomial Test. Compares the observed frequency in each category of a dichotomous
variable with expected frequencies from the binomial distribution.
Runs Test. Tests whether the order of occurrence of two values of a variable is random.
One-Sample Kolmogorov-Smirnov Test. Compares the observed cumulative distribution
function for a variable with a specified theoretical distribution, which may be normal,
uniform, or Poisson.
Two-Independent-Samples Tests. Compares two groups of cases on one variable. The
Mann-Whitney U test, the two-sample Kolmogorov-Smirnov test, Moses test of
extreme reactions, and the Wald-Wolfowitz runs test are available.
Tests for Several Independent Samples. Compares two or more groups of cases on one
variable. The Kruskal-Wallis test, the Median test, and the Jonckheere-Terpstra
test are available.
Two-Related-Samples Tests. Compares the distributions of two variables. The
Wilcoxon signed-rank test, the sign test, and the McNemar test are available.
Tests for Several Related Samples. Compares the distributions of two or more
variables. Friedman's test, Kendall's W, and Cochran's Q are available.
Quartiles and the mean, standard deviation, minimum, maximum, and number of
nonmissing cases are available for all of the above tests.
465
466
Chapter 34
Chi-Square Test
The Chi-Square Test procedure tabulates a variable into categories and computes a
chi-square statistic. This goodness-of-fit test compares the observed and expected
frequencies in each category to test either that all categories contain the same
proportion of values or that each category contains a user-specified proportion of
values.
Examples. The chi-square test could be used to determine if a bag of jelly beans
contains equal proportions of blue, brown, green, orange, red, and yellow candies.
You could also test to see if a bag of jelly beans contains 5% blue, 30% brown, 10%
green, 20% orange, 15% red, and 15% yellow candies.
Statistics. Mean, standard deviation, minimum, maximum, and quartiles. The number
and the percentage of nonmissing and missing cases, the number of cases observed
and expected for each category, residuals, and the chi-square statistic.
Nonparametric Tests
Sample Output
Figure 34-1
Chi-Square Test output
Observed Expected
N N Residual
Blue 6 18.8 -12.8
Brown 33 18.8 14.2
Green 9 18.8 -9.8
Yellow 17 18.8 -1.8
Orange 22 18.8 3.2
Red 26 18.8 7.2
Total 113
Test Statistics
Color of
Jelly Bean
1
Chi-Square 27.973
df 5
Asymptotic
.000
Significance
Chapter 34
Observed Expected
N N Residual
Blue 6 5.7 .3
Brown 33 33.9 -.9
Green 9 11.3 -2.3
Yellow 17 17.0 .0
Orange 22 22.6 -.6
Red 26 22.6 3.4
Total 113
Test Statistics
Color of
Jelly Bean
1
Chi-Square 1.041
df 5
Asymptotic
.959
Significance
Nonparametric Tests
Figure 34-2
Chi-Square Test dialog box
E Select one or more test variables. Each variable produces a separate test.
Optionally, you can click Options for descriptive statistics, quartiles, and control of
the treatment of missing data.
Chapter 34
The first value of the list corresponds to the lowest group value of the test variable,
and the last value corresponds to the highest value. Elements of the value list are
summed, and then each value is divided by this sum to calculate the proportion of
cases expected in the corresponding category. For example, a value list of 3, 4, 5, 4
specifies expected proportions of 3/16, 4/16, 5/16, and 4/16.
Statistics. You can choose one or both of the following summary statistics:
Descriptive. Displays the mean, standard deviation, minimum, maximum, and
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
Nonparametric Tests
Binomial Test
The Binomial Test procedure compares the observed frequencies of the two categories
of a dichotomous variable to the frequencies expected under a binomial distribution
with a specified probability parameter. By default, the probability parameter for
both groups is 0.5. To change the probabilities, you can enter a test proportion for
the first group. The probability for the second group will be 1 minus the specified
probability for the first group.
Example. When you toss a dime, the probability of a head equals 1/2. Based on this
hypothesis, a dime is tossed 40 times, and the outcomes are recorded (heads or tails).
From the binomial test, you might find that 3/4 of the tosses were heads and that the
observed significance level is small (0.0027). These results indicate that it is not
likely that the probability of a head equals 1/2; the coin is probably biased.
Statistics. Mean, standard deviation, minimum, maximum, number of nonmissing
cases, and quartiles.
Chapter 34
Assumptions. Nonparametric tests do not require assumptions about the shape of the
underlying distribution. The data are assumed to be a random sample.
Sample Output
Figure 34-4
Binomial Test output
Binomial Test
Asymptotic
Observed Test Significance
Category N Proportion Proportion (2-tailed)
Coin Group 1 Head 30 .75 .50 .0031
Group 2 Tail 10 .25
Total 40 1.00
1. Based on Z Approximation
Nonparametric Tests
Figure 34-5
Binomial Test dialog box
Optionally, you can click Options for descriptive statistics, quartiles, and control of
the treatment of missing data.
Chapter 34
Statistics. You can choose one or both of the following summary statistics:
Descriptive. Displays the mean, standard deviation, minimum, maximum, and
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
Missing Values. Controls the treatment of missing values.
Exclude cases test-by-test. When several tests are specified, each test is evaluated
separately for missing values.
Exclude cases listwise. Cases with missing values for any variable tested are
excluded from all analyses.
See the SPSS Command Syntax Reference for complete syntax information.
Runs Test
The Runs Test procedure tests whether the order of occurrence of two values of a
variable is random. A run is a sequence of like observations. A sample with too many
or too few runs suggests that the sample is not random.
Examples. Suppose that 20 people are polled to find out if they would purchase a
product. The assumed randomness of the sample would be seriously questioned if
all 20 people were of the same gender. The runs test can be used to determine if the
sample was drawn at random.
Statistics. Mean, standard deviation, minimum, maximum, number of nonmissing
cases, and quartiles.
475
Nonparametric Tests
Sample Output
Figure 34-7
Runs Test output
Runs Test
Gender
1
Test Value 1.00
Cases < Test Value 7
Cases >= Test Value 13
Total Cases 20
Number of Runs 15
Z 2.234
Asymptotic
.025
Significance (2-tailed)
1. Median
Chapter 34
Figure 34-8
Runs Test dialog box
Optionally, you can click Options for descriptive statistics, quartiles, and control of
the treatment of missing data.
Nonparametric Tests
Statistics. You can choose one or both of the following summary statistics:
Descriptive. Displays the mean, standard deviation, minimum, maximum, and
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
Missing Values. Controls the treatment of missing values.
Exclude cases test-by-test. When several tests are specified, each test is evaluated
separately for missing values.
Exclude cases listwise. Cases with missing values for any variable are excluded
from all analyses.
Chapter 34
Nonparametric Tests
Sample Output
Figure 34-10
One-Sample Kolmogorov-Smirnov Test output
One-Sample Kolmogorov-Smirnov Test
Income
N 20
1,2
Normal Parameters Mean 56250.00
Std. Deviation 45146.40
Most Extreme Differences Absolute .170
Positive .170
Negative -.164
Kolmogorov-Smirnov Z
.760
Chapter 34
Figure 34-11
One-Sample Kolmogorov-Smirnov Test dialog box
E Select one or more numeric test variables. Each variable produces a separate test.
Optionally, you can click Options for descriptive statistics, quartiles, and control of
the treatment of missing data.
Nonparametric Tests
Statistics. You can choose one or both of the following summary statistics:
Descriptive. Displays the mean, standard deviation, minimum, maximum, and
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
Missing Values. Controls the treatment of missing values.
Exclude cases test-by-test. When several tests are specified, each test is evaluated
separately for missing values.
Exclude cases listwise. Cases with missing values for any variable are excluded
from all analyses.
Two-Independent-Samples Tests
The Two-Independent-Samples Tests procedure compares two groups of cases on
one variable.
Example. New dental braces have been developed that are intended to be more
comfortable, to look better, and to provide more rapid progress in realigning teeth. To
find out if the new braces have to be worn as long as the old braces, 10 children are
randomly chosen to wear the old braces, and another 10 are chosen to wear the new
braces. From the Mann-Whitney U test, you might find that, on average, those with
the new braces did not have to wear the braces as long as those with the old braces.
Statistics. Mean, standard deviation, minimum, maximum, number of nonmissing
cases, and quartiles. Tests: Mann-Whitney U, Moses extreme reactions,
Kolmogorov-Smirnov Z, Wald-Wolfowitz runs.
482
Chapter 34
Sample Output
Figure 34-13
Two-Independent-Samples output
Ranks
Mean Sum of
N Rank Ranks
Time Type of Old
10 14.10 141.00
Worn in Braces Braces
Days
New
10 6.90 69.00
Braces
Total 20
483
Nonparametric Tests
Test Statistics 2
Time Worn
in Days
Mann-Whitney U 14.000
Wilcoxon W 69.000
Z -2.721
Asymptotic
Significance .007
(2-tailed)
Exact Significance 1
.005
[2*(1-tailed Sig.)]
Chapter 34
Figure 34-14
Two-Independent-Samples Tests dialog box
E Select a grouping variable and click Define Groups to split the file into two groups
or samples.
Nonparametric Tests
statistic is the smaller of these two numbers. The Wilcoxon rank sum W statistic,
also displayed, is the rank sum of the smaller sample. If both samples have the
same number of observations, W is the rank sum of the group named first in the
Two-Independent-Samples Define Groups dialog box.
The Kolmogorov-Smirnov Z test and the Wald-Wolfowitz runs test are more
general tests that detect differences in both the locations and the shapes of the
distributions. The Kolmogorov-Smirnov test is based on the maximum absolute
difference between the observed cumulative distribution functions for both samples.
When this difference is significantly large, the two distributions are considered
different. The Wald-Wolfowitz runs test combines and ranks the observations from
both groups. If the two samples are from the same population, the two groups should
be randomly scattered throughout the ranking.
The Moses extreme reactions test assumes that the experimental variable will
affect some subjects in one direction and other subjects in the opposite direction. It
tests for extreme responses compared to a control group. This test focuses on the span
of the control group and is a measure of how much extreme values in the experimental
group influence the span when combined with the control group. The control group is
defined by the group 1 value in the Two-Independent-Samples Define Groups dialog
box. Observations from both groups are combined and ranked. The span of the control
group is computed as the difference between the ranks of the largest and smallest
values in the control group plus 1. Because chance outliers can easily distort the range
of the span, 5% of the control cases are trimmed automatically from each end.
To split the file into two groups or samples, enter an integer value for Group 1 and
another for Group 2. Cases with other values are excluded from the analysis.
486
Chapter 34
Statistics. You can choose one or both of the following summary statistics:
Descriptive. Displays the mean, standard deviation, minimum, maximum, and the
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
Missing Values. Controls the treatment of missing values.
Exclude cases test-by-test. When several tests are specified, each test is evaluated
separately for missing values.
Exclude cases listwise. Cases with missing values for any variable are excluded
from all analyses.
Nonparametric Tests
Two-Related-Samples Tests
The Two-Related-Samples Tests procedure compares the distributions of two
variables.
Example. In general, do families receive the asking price when they sell their homes?
By applying the Wilcoxon signed-rank test to data for 10 homes, you might learn that
seven families receive less than the asking price, one family receives more than the
asking price, and two families receive the asking price.
Statistics. Mean, standard deviation, minimum, maximum, number of nonmissing
cases, and quartiles. Tests: Wilcoxon signed rank, sign, McNemar.
Sample Output
Figure 34-17
Two-Related-Samples output
Ranks
Mean Sum of
N Rank Ranks
Asking Price Negative 1
7 4.93 34.50
- Sale Price Ranks
Positive 2
1 1.50 1.50
Ranks
Ties 23
Total 10
Chapter 34
Test Statistics 2
Asking Price
- Sale Price
Z -2.3131
Asymptotic
Significance .021
(2-tailed)
Nonparametric Tests
Chapter 34
Statistics. You can choose one or both of the following summary statistics:
Descriptive. Displays the mean, standard deviation, minimum, maximum, and the
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
Missing Values. Controls the treatment of missing values.
Exclude cases test-by-test. When several tests are specified, each test is evaluated
separately for missing values.
Exclude cases listwise. Cases with missing values for any variable are excluded
from all analyses.
Nonparametric Tests
Example. Do three brands of 100-watt lightbulbs differ in the average time the bulbs
will burn? From the Kruskal-Wallis one-way analysis of variance, you might learn
that the three brands do differ in average lifetime.
Statistics. Mean, standard deviation, minimum, maximum, number of nonmissing
cases, and quartiles. Tests: Kruskal-Wallis H, median.
Sample Output
Figure 34-20
Tests for Several Independent Samples output
Ranks
Mean
N Rank
Hours Brand Brand A 10 15.20
Brand B 10 25.50
Brand C 10 5.80
Total 30
Hours
Chi-Square 25.061
df 2
Asymptotic
.000
Significance
Chapter 34
Figure 34-21
Tests for Several Independent Samples dialog box
E Select a grouping variable and click Define Range to specify minimum and maximum
integer values for the grouping variable.
Nonparametric Tests
To define the range, enter integer values for minimum and maximum that correspond
to the lowest and highest categories of the grouping variable. Cases with values
outside of the bounds are excluded. For example, if you specify a minimum value
of 1 and a maximum value of 3, only the integer values of 1 through 3 are used.
The minimum value must be less than the maximum value, and both values must
be specified.
494
Chapter 34
Statistics. You can choose one or both of the following summary statistics.
Descriptive. Displays the mean, standard deviation, minimum, maximum, and the
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
Missing Values. Controls the treatment of missing values.
Exclude cases test-by-test. When several tests are specified, each test is evaluated
separately for missing values.
Exclude cases listwise. Cases with missing values for any variable are excluded
from all analyses.
See the SPSS Command Syntax Reference for complete syntax information.
495
Nonparametric Tests
Sample Output
Figure 34-24
Tests for Several Related Samples output
Ranks
Mean
Rank
Doctor 1.50
Lawyer 2.50
Police 3.40
Teacher 2.60
496
Chapter 34
Test Statistics 1
N 10
Chi-Square 10.920
df 3
Asymptotic Significance .012
1. Friedman Test
Nonparametric Tests
Descriptive. Displays the mean, standard deviation, minimum, maximum, and the
number of nonmissing cases.
Quartiles. Displays values corresponding to the 25th, 50th, and 75th percentiles.
35
Multiple Response Analysis
Two procedures are available for analyzing multiple dichotomy and multiple category
sets. The Multiple Response Frequencies procedure displays frequency tables.
The Multiple Response Crosstabs procedure displays two- and three-dimensional
crosstabulations. Before using either procedure, you must define multiple response
sets.
Example. This example illustrates the use of multiple response items in a market
research survey. The data are fictitious and should not be interpreted as real. An
airline might survey passengers flying a particular route to evaluate competing
carriers. In this example, American Airlines wants to know about its passengers' use
of other airlines on the Chicago-New York route and the relative importance of
schedule and service in selecting an airline. The flight attendant hands each passenger
a brief questionnaire upon boarding. The first question reads: Circle all airlines you
have flown at least once in the last six months on this route—American, United,
TWA, USAir, Other. This is a multiple response question, since the passenger can
circle more than one response. However, this question cannot be coded directly
because a variable can have only one value for each case. You must use several
variables to map responses to each question. There are two ways to do this. One is
to define a variable corresponding to each of the choices (for example, American,
United, TWA, USAir, and Other). If the passenger circles United, the variable
united is assigned a code of 1, otherwise 0. This is a multiple dichotomy method
of mapping variables. The other way to map responses is the multiple category
method, in which you estimate the maximum number of possible responses to the
question and set up the same number of variables, with codes used to specify the
airline flown. By perusing a sample of questionnaires, you might discover that no
user has flown more than three different airlines on this route in the last six months.
Further, you find that due to the deregulation of airlines, 10 other airlines are named
in the Other category. Using the multiple response method, you would define three
variables, each coded as 1 = american, 2 = united, 3 = twa, 4 = usair, 5 = delta, and
499
500
Chapter 35
so on. If a given passenger circles American and TWA, the first variable has a code
of 1, the second has a code of 3, and the third has a missing-value code. Another
passenger might have circled American and entered Delta. Thus, the first variable has
a code of 1, the second has a code of 5, and the third a missing-value code. If you
use the multiple dichotomy method, on the other hand, you end up with 14 separate
variables. Although either method of mapping is feasible for this survey, the method
you choose depends on the distribution of responses.
Figure 35-1
Define Multiple Response Sets dialog box
E If your variables are coded as dichotomies, indicate which value you want to have
counted. If your variables are coded as categories, define the range of the categories.
E Click Add to add the multiple response set to the list of defined sets.
502
Chapter 35
Missing Values. Cases with missing values are excluded on a table-by-table basis.
Alternatively, you can choose one or both of the following:
Exclude cases listwise within dichotomies. Excludes cases with missing values
for any variable from the tabulation of the multiple dichotomy set. This applies
only to multiple response sets defined as dichotomy sets. By default, a case
is considered missing for a multiple dichotomy set if none of its component
variables contains the counted value. Cases with missing values for some (but
not all variables) are included in the tabulations of the group if at least one
variable contains the counted value.
Exclude cases listwise within categories. Excludes cases with missing values for
any variable from tabulation of the multiple category set. This applies only to
multiple response sets defined as category sets. By default, a case is considered
missing for a multiple category set only if none of its components has valid
values within the defined range.
Example. Each variable created from a survey question is an elementary variable. To
analyze a multiple response item, you must combine the variables into one of two
types of multiple response sets: a multiple dichotomy set or a multiple category set.
For example, if an airline survey asked which of three airlines (American, United,
TWA) you have flown in the last six months and you used dichotomous variables and
defined a multiple dichotomy set, each of the three variables in the set would become
a category of the group variable. The counts and percentages for the three airlines
are displayed in one frequency table. If you discover that no respondent mentioned
more than two airlines, you could create two variables, each having three codes, one
for each airline. If you define a multiple category set, the values are tabulated by
503
adding the same codes in the elementary variables together. The resulting set of
values is the same as those for each of the elementary variables. For example, 30
responses for United are the sum of the 5 United responses for airline 1 and the 25
United responses for airline 2. The counts and percentages for the three airlines
are displayed in one frequency table.
Statistics. Frequency tables displaying counts, percentages of responses, percentages
of cases, number of valid cases, and number of missing cases.
Sample Output
Figure 35-2
Multiple Response Frequencies output
504
Chapter 35
Figure 35-3
Multiple Response Frequencies dialog box
columns on three lines, with up to eight characters per line. To avoid splitting words,
you can reverse row and column items or redefine labels.
Example. Both multiple dichotomy and multiple category sets can be crosstabulated
with other variables in this procedure. An airline passenger survey asks passengers
for the following information: Circle all of the following airlines you have flown at
least once in the last six months (American, United, TWA). Which is more important
in selecting a flight—schedule or service? Select only one. After entering the
data as dichotomies or multiple categories and combining them into a set, you can
crosstabulate the airline choices with the question involving service or schedule.
Statistics. Crosstabulation with cell, row, column, and total counts, and cell, row,
column, and total percentages. The cell percentages can be based on cases or
responses.
Chapter 35
Sample Output
Figure 35-4
Multiple Response Crosstabs output
Figure 35-5
Multiple Response Crosstabs dialog box
E Select one or more numeric variables or multiple response sets for each dimension
of the crosstabulation.
Optionally, you can obtain a two-way crosstabulation for each category of a control
variable or multiple response set. Select one or more items for the Layer(s) list.
Chapter 35
Value ranges must be defined for any elementary variable in the crosstabulation.
Enter the integer minimum and maximum category values that you want to tabulate.
Categories outside the range are excluded from analysis. Values within the inclusive
range are assumed to be integers (non-integers are truncated).
Cell Percentages. Cell counts are always displayed. You can choose to display row
percentages, column percentages, and two-way table (total) percentages.
Percentages Based on. You can base cell percentages on cases (or respondents). This
is not available if you select matching of variables across multiple category sets. You
can also base cell percentages on responses. For multiple dichotomy sets, the number
of responses is equal to the number of counted values across cases. For multiple
category sets, the number of responses is the number of values in the defined range.
Missing Values. You can choose one or both of the following:
Exclude cases listwise within dichotomies. Excludes cases with missing values
for any variable from the tabulation of the multiple dichotomy set. This applies
only to multiple response sets defined as dichotomy sets. By default, a case
is considered missing for a multiple dichotomy set if none of its component
variables contains the counted value. Cases with missing values for some, but not
509
all, variables are included in the tabulations of the group if at least one variable
contains the counted value.
Exclude cases listwise within categories. Excludes cases with missing values for
any variable from tabulation of the multiple category set. This applies only to
multiple response sets defined as category sets. By default, a case is considered
missing for a multiple category set only if none of its components has valid
values within the defined range.
By default, when crosstabulating two multiple category sets, the procedure tabulates
each variable in the first group with each variable in the second group and sums the
counts for each cell; therefore, some responses can appear more than once in a table.
You can choose the following option:
Match variables across response sets. Pairs the first variable in the first group with the
first variable in the second group, and so on. If you select this option, the procedure
bases cell percentages on responses rather than respondents. Pairing is not available
for multiple dichotomy sets or elementary variables.
36
Reporting Results
Case listings and descriptive statistics are basic tools for studying and presenting
data. You can obtain case listings with the Data Editor or the Summarize procedure,
frequency counts and descriptive statistics with the Frequencies procedure, and
subpopulation statistics with the Means procedure. Each of these uses a format
designed to make information clear. If you want to display the information in a
different format, Report Summaries in Rows and Report Summaries in Columns give
you the control you need over data presentation.
511
512
Chapter 36
Sample Output
Figure 36-1
Combined report with case listings and summary statistics
513
Reporting Results
E Select one or more variables for Data Columns. One column in the report is generated
for each variable selected.
E For reports sorted and displayed by subgroups, select one or more variables for
Break Columns.
E For reports with summary statistics for subgroups defined by break variables, select
the break variable in the Break Columns list and click Summary in the Break Columns
group to specify the summary measure(s).
E For reports with overall summary statistics, click Summary in the Report group to
specify the summary measure(s).
Figure 36-2
Report Summaries in Rows dialog box
514
Chapter 36
Column Title. For the selected variable, controls the column title. Long titles are
automatically wrapped within the column. Use the Enter key to manually insert line
breaks where you want titles to wrap.
Value Position within Column. For the selected variable, controls the alignment of data
values or value labels within the column. Alignment of values or labels does not
affect alignment of column headings. You can either indent the column contents by a
specified number of characters or center the contents.
Column Content. For the selected variable, controls the display of either data values or
defined value labels. Data values are always displayed for any values that do not have
defined value labels. (Not available for data columns in column summary reports.)
515
Reporting Results
Available summary statistics are sum, mean, minimum, maximum, number of cases,
percentage of case above or below a specified value, percentage of cases within a
specified range of values, standard deviation, kurtosis, variance, and skewness.
Chapter 36
Page Control. Controls spacing and pagination for categories of the selected break
variable. You can specify a number of blank lines between break categories or start
each break category on a new page.
Blank Lines before Summaries. Controls the number of blank lines between break
category labels or data and summary statistics. This is particularly useful for
combined reports that include both individual case listings and summary statistics for
break categories; in these reports, you can insert space between the case listings and
the summary statistics.
Report Options
Report Options controls the treatment and display of missing values and report page
numbering.
Figure 36-6
Report Options dialog box
Exclude cases with missing values listwise. Eliminates (from the report) any case with
missing values for any of the report variables.
Missing Values Appear as. Allows you to specify the symbol that represents missing
values in the data file. The symbol can be only one character and is used to represent
both system-missing and user-missing values.
Number Pages from. Allows you to specify a page number for the first page of the
report.
Report Layout
Report Layout controls the width and length of each report page, placement of the
report on the page, and the insertion of blank lines and labels.
517
Reporting Results
Figure 36-7
Report Layout dialog box
Page Layout. Controls the page margins expressed in lines (top and bottom) and
characters (left and right) and report alignment within the margins.
Page Titles and Footers. Controls the number of lines that separate page titles and
footers from the body of the report.
Break Columns. Controls the display of break columns. If multiple break variables are
specified, they can be in separate columns or in the first column. Placing all break
variables in the first column produces a narrower report.
Column Titles. Controls the display of column titles, including title underlining, space
between titles and the body of the report, and vertical alignment of column titles.
Data Column Rows & Break Labels. Controls the placement of data column information
(data values and/or summary statistics) in relation to the break labels at the start of
each break category. The first row of data column information can start either on the
same line as break category label or on a specified number of lines after the break
category label. (Not available for columns summary reports.)
518
Chapter 36
Report Titles
Report Titles controls the content and placement of report titles and footers. You
can specify up to 10 lines of page titles and up to 10 lines of page footers, with
left-justified, centered, and right-justified components on each line.
Figure 36-8
Report Titles dialog box
If you insert variables into titles or footers, the current value label or value of the
variable is displayed in the title or footer. In titles, the value label corresponding to the
value of the variable at the beginning of the page is displayed. In footers, the value
label corresponding to the value of the variable at the end of the page is displayed. If
there is no value label, the actual value is displayed.
Special Variables. The special variables DATE and PAGE allow you to insert the
current date or the page number into any line of a report header or footer. If your
data file contains variables named DATE or PAGE, you cannot use these variables in
report titles or footers.
519
Reporting Results
Chapter 36
Sample Output
Figure 36-9
Summary report with summary statistics in columns
E Select one or more variables for Data Columns. One column in the report is generated
for each variable selected.
E To change the summary measure for a variable, select the variable in the Data
Columns list and click Summary.
E To obtain more than one summary measure for a variable, select the variable in
the source list and move it into the Data Columns list multiple times, one for each
summary measure you want.
E To display a column containing the sum, mean, ratio, or other function of existing
columns, click Insert Total. This places a variable called total into the Data Columns
list.
E For reports sorted and displayed by subgroups, select one or more variables for
Break Columns.
521
Reporting Results
Figure 36-10
Report Summaries in Columns dialog box
Chapter 36
Available summary statistics are sum, mean, minimum, maximum, number of cases,
percentage of case above or below a specified value, percentage of cases within a
specified range of values, standard deviation, variance, kurtosis, and skewness.
Sum of columns. The total column is the sum of the columns in the Summary Column
list.
Mean of columns. The total column is the average of the columns in the Summary
Column list.
Minimum of columns. The total column is the minimum of the columns in the
Summary Column list.
Maximum of columns. The total column is the maximum of the columns in the
Summary Column list.
1st column – 2nd column. The total column is the difference of the columns in the
Summary Column list. The Summary Column list must contain exactly two columns.
523
Reporting Results
1st column / 2nd column. The total column is the quotient of the columns in the
Summary Column list. The Summary Column list must contain exactly two columns.
% 1st column / 2nd column. The total column is the first column's percentage of the
second column in the Summary Column list. The Summary Column list must contain
exactly two columns.
Product of columns. The total column is the product of the columns in the Summary
Column list.
Chapter 36
Blank Lines before Subtotal. Controls the number of blank lines between break
category data and subtotals.
Grand Total. Displays and labels a grand total for each column; displayed at the
bottom of the column.
Missing values. You can exclude missing values from the report or select a single
character to indicate missing values in the report.
Reporting Results
Insert summary lines into data columns for variables other than the data column
variable, or for various combinations (composite functions) of summary
functions.
Use Median, Mode, Frequency, and Percent as summary functions.
Control more precisely the display format of summary statistics.
Insert blank lines at various points in reports.
Insert blank lines after every nth case in listing reports.
Because of the complexity of the REPORT syntax, you may find it useful, when
building a new report with syntax, to approximate the report generated from the
dialog boxes, copy and paste the corresponding syntax, and refine that syntax to yield
the exact report that you want.
See the SPSS Command Syntax Reference for complete syntax information.
Chapter
37
Reliability Analysis
Reliability analysis allows you to study the properties of measurement scales and the
items that make them up. The Reliability Analysis procedure calculates a number of
commonly used measures of scale reliability and also provides information about the
relationships between individual items in the scale. Intraclass correlation coefficients
can be used to compute interrater reliability estimates.
Example. Does my questionnaire measure customer satisfaction in a useful way?
Using reliability analysis, you can determine the extent to which the items in
your questionnaire are related to each other, you can get an overall index of the
repeatability or internal consistency of the scale as a whole, and you can identify
problem items that should be excluded from the scale.
Statistics. Descriptives for each variable and for the scale, summary statistics across
items, inter-item correlations and covariances, reliability estimates, ANOVA table,
intraclass correlation coefficients, Hotelling's T2, and Tukey's test of additivity.
Models. The following models of reliability are available:
Alpha (Cronbach). This is a model of internal consistency, based on the average
inter-item correlation.
Split-half. This model splits the scale into two parts and examines the correlation
between the parts.
Guttman. This model computes Guttman's lower bounds for true reliability.
Parallel. This model assumes that all items have equal variances and equal error
variances across replications.
Strict parallel. This model makes the assumptions of the parallel model and also
assumes equal means across items.
527
528
Chapter 37
Sample Output
Figure 37-1
Reliability output
Correlation Matrix
ANY 1.0000
BORED .8150 1.0000
CRITICS .8128 .8256 1.0000
PEERS .7823 .8068 .8045 1.0000
Reliability Analysis
Figure 37-2
Reliability Analysis dialog box
Chapter 37
You can select various statistics describing your scale and items. Statistics reported
by default include the number of cases, the number of items, and reliability estimates
as follows:
Alpha models: Coefficient alpha. For dichotomous data, this is equivalent to the
Kuder-Richardson 20 (KR20) coefficient.
Split-half models: Correlation between forms, Guttman split-half reliability,
Spearman-Brown reliability (equal and unequal length), and coefficient alpha
for each half.
Guttman models: Reliability coefficients lambda 1 through lambda 6.
Parallel and Strictly parallel models: Test for goodness-of-fit of model, estimates
of error variance, common variance, and true variance, estimated common
inter-item correlation, estimated reliability, and unbiased estimate of reliability.
531
Reliability Analysis
Descriptives for. Produces descriptive statistics for scales or items across cases.
Available options are Item, Scale, and Scale if item deleted.
Scale if item deleted. Displays summary statistics comparing each item to the scale
composed of the other items. Statistics include scale mean and variance if the item
were deleted from the scale, correlation between the item and the scale composed
of other items, and Cronbach's alpha if the item were deleted from the scale.
Summaries. Provides descriptive statistics of item distributions across all items in the
scale. Available options are Means, Variances, Covariances, and Correlations.
Means. Summary statistics for item means. The smallest, largest, and average
item means, the range and variance of item means, and the ratio of the largest to
the smallest item means are displayed.
Variances. Summary statistics for item variances. The smallest, largest, and
average item variances, the range and variance of item variances, and the ratio of
the largest to the smallest item variances are displayed.
Covariances. Summary statistics for inter-item covariances. The smallest,
largest, and average inter-item covariances, the range and variance of inter-item
covariances, and the ratio of the largest to the smallest inter-item covariances
are displayed.
Correlations. Summary statistics for inter-item correlations. The smallest,
largest, and average inter-item correlations, the range and variance of inter-item
correlations, and the ratio of the largest to the smallest inter-item correlations
are displayed.
ANOVA Table. Produces tests of equal means. Available alternatives are None, F test,
Friedman chi-square, or Cochran chi-square.
F Test. Displays a repeated measures analysis-of-variance table.
Friedman chi-square. Displays Friedman's chi-square and Kendall's coefficient of
concordance. This option is appropriate for data that are in the form of ranks.
The chi-square test replaces the usual F test in the ANOVA table.
Cochran chi-square. Displays Cochran's Q. This option is appropriate for data that
are dichotomous. The Q statistic replaces the usual F statistic in the ANOVA
table.
532
Chapter 37
Hotelling's T-square. Produces a multivariate test of the null hypothesis that all items
on the scale have the same mean.
Tukey's test of additivity. Produces a test of the assumption that there is no
multiplicative interaction among the items.
Intraclass correlation coefficient. Produces measures of consistency or agreement
of values within cases.
Model. Select the model for calculating the intraclass correlation coefficient.
Available models are Two-way mixed, Two-way random, and One-way random.
Select two-way mixed when people effects are random and the item effects are
fixed, two-way random when people effects and the item effects are random, and
one-way random when people effects are random.
Type. Select the type of index. Available types are Consistency and Absolute
Agreement.
Confidence interval. Specify the level for the confidence interval. Default is 95%.
Test value. Specify the hypothesized value of the coefficient for the hypothesis
test. This is the value to which the observed value is compared. Default value is 0.
38
Multidimensional Scaling
533
534
Chapter 38
Multidimensional Scaling
Figure 38-1
Multidimensional Scaling dialog box
E In Distances, select either Data are distances or Create distances from data.
E If your data are distances, you must select at least four numeric variables for analysis,
and you can click Shape to indicate the shape of the distance matrix.
E If you want SPSS to create the distances before analyzing them, you must select at
least one numeric variable, and you can click Measure to specify the type of distance
measure you want. You can create separate matrices for each category of a grouping
variable (which can be either numeric or string) by moving that variable into the
Individual Matrices For list.
Chapter 38
If your working data file represents distances among a set of objects, or distances
between two sets of objects, you must specify the shape of your data matrix in
order to get the correct results. Choose an alternative: Square symmetric, Square
asymmetric, or Rectangular. Note: You cannot select Square symmetric if the Model
dialog box specifies row conditionality.
Multidimensional Scaling
Chapter 38
Dimensions. Allows you to specify the dimensionality of the scaling solution(s). One
solution is calculated for each number in the range. Specify integers between 1 and 6;
a minimum of 1 is allowed only if you select Euclidean distance as the scaling model.
For a single solution, specify the same number as minimum and maximum.
Scaling Model. Allows you to specify the assumptions by which the scaling is
performed. Available alternatives are Euclidean distance or Individual differences
Euclidean distance (also known as INDSCAL). For the Individual differences
Euclidean distance model, you can select Allow negative subject weights, if appropriate
for your data.
Multidimensional Scaling
39
Ratio Statistics
541
542
Chapter 39
Figure 39-1
Ratio Statistics dialog box
Ratio Statistics
Ratio Statistics
Figure 39-2
Statistics dialog box
Central Tendency. Measures of central tendency are statistics that describe the
distribution of ratios.
Median. The value such that the number of ratios less than this value and the
number of ratios greater than this value are the same.
Mean. The result of summing the ratios and dividing the result by the total
number of ratios.
Weighted mean. The result of dividing the mean of the numerator by the mean of
the denominator. It is also the mean of the ratios weighted by the denominator.
Confidence intervals. This displays confidence intervals for the mean, the median,
and the weighted mean (if requested). Specify a value greater than or equal to 0
and less than 100 as the confidence level.
Dispersion. These are statistics that measure the amount of variation, or spread,
in the observed values.
544
Chapter 39
AAD. The average absolute deviation is the result of summing the absolute
deviations of the ratios about the median and dividing the result by the total
number of ratios.
COD. The coefficient of dispersion is the result of expressing the average absolute
deviation as a percentage of the median.
PRD. The price-related differential, also known as the index of regressivity, is the
result of dividing the mean by the weighted mean.
Median centered COV. The median-centered coefficient of variation is the result of
expressing the root mean squares of deviation from the median as a percentage of
the median.
Mean centered COV. The mean-centered coefficient of variation is the result of
expressing the standard deviation as a percentage of the mean.
Standard deviation. The result of summing the squared deviations of the ratios
about the mean, dividing the result by the total number of ratios minus one,
and taking the positive square root.
Range. The result of subtracting the minimum ratio from the maximum ratio.
Minimum. The smallest ratio.
Maximum. The largest ratio.
40
Overview of the Chart Facility
High-resolution charts and plots are created by the procedures on the Graphs menu
and by many of the procedures on the Analyze menu. This chapter provides an
overview of the chart facility. Interactive charts, available on the Interactive submenu
of the Graphs menu, are covered in a separate book, SPSS Interactive Graphics.
545
546
Chapter 40
Figure 40-1
Chart dialog box
The dialog box contains icons for various types of charts and a list of data structures.
Click Define to open a chart definition dialog box such as the following one.
Figure 40-2
Chart definition dialog box
In this dialog box, you can select the variables appropriate for the chart and choose
the options you want. For information about the various choices, click Help.
547
Chapter 40
Figure 40-4
Original chart in the Chart Editor
You can modify any part of the chart or change to another type of chart illustrating the
same data. You add items or show or hide them using the menus in the Chart Editor.
This opens the Properties window. The tabs that appear in the Properties window
are specific to your selection. The online Help describes how to display the tabs
that you need.
549
Figure 40-5
Properties window
Chapter 40
Figure 40-6
Modified chart
Chart modifications are saved when you close the chart window, and the modified
chart is displayed in the Viewer.
Figure 40-7
A chart definition dialog box
Click Titles to specify titles, subtitles, and footnotes. You can click Options to control
the treatment of missing values for most charts and case labels for scatterplots.
Additionally, you can apply a template of previously selected attributes either when
you are defining the chart or after the chart has been created. The next few sections
describe how to define these characteristics at the time you define the chart.
Chapter 40
Figure 40-8
Titles dialog box
Each line can be up to 72 characters long. The number of characters that will actually
fit in the chart depends upon the font and size. Most titles are left-justified by
default and, if too long, are cropped on the right. Pie chart titles, by default, are
center-justified and, if too long, are cropped at both ends.
Titles, subtitles, and footnotes are rendered as text boxes in the Chart Editor.
You can add, delete, or revise text boxes within the Chart Editor, as well as change
their font, size, and justification.
Options
The Options dialog box provides options for treatment of missing values and display
of case labels. This dialog box is available by clicking Options on the chart definition
dialog box.
Figure 40-9
Options dialog box
553
Chapter 40
Figure 40-11
Variable-by-variable exclusion of missing values
The charts were created from a version of the Employee data.sav file that was edited
to have some system-missing (blank) values in the variables for current salary and job
category. In some other cases, the value 0 was entered and defined as missing. For
both charts, the option Display groups defined by missing values is selected, which adds
the category Missing to the other job categories displayed. In each chart, the values of
the summary function, Number of cases, are displayed in the bar labels.
In both charts, 26 cases have a system-missing value for the job category and 13
cases have the user-missing value (0). In the listwise chart, the number of cases
is the same for both variables in each bar cluster because whenever a value was
missing, the case was excluded for all variables. In the variable-by-variable chart,
the number of nonmissing cases for each variable in a category is plotted without
regard to missing values in other variables.
“missing” category to the set of markers. If there are no missing values, the
“missing” category is not displayed.
If you select this option and want to suppress display after the chart is drawn, select
the chart and then choose Properties from the Edit menu. Use the Categories tab to
move the categories you want suppressed to the Excluded list.
This option is not available for an overlay scatterplot or for single-series charts in
which the data are summarized by separate variables.
The final selection in the Options dialog box controls the status of case labels when a
scatterplot is first displayed.
Display chart with case labels. When this option is selected, all case labels are
displayed when a scatterplot is created. By default, it is deselected—that is,
the default scatterplot is displayed without labels. If you select this option,
case labels may overlap.
Chart Templates
You can apply many of the attributes and text elements from one chart to another.
This allows you to modify one chart, save that chart as a template, and then use the
template to create a number of other similar charts.
To use a template when creating a chart, select Use chart specifications from (in
the Template group in the chart definition dialog box) and click File. This opens a
standard file selection dialog box.
To apply a template to a chart already in a chart window, from the menus choose:
File
Apply Chart Template...
This opens a standard file selection dialog box. Select a file to use as a template. If
you are creating a new chart, the filename you select is displayed in the Template
group when you return to the chart definition dialog box.
A template is used to borrow the format from one chart and apply it to the new
chart you are generating. In general, any formatting information from the old chart
that can apply to the new chart will automatically apply. For example, if the old chart
is a clustered bar chart with bar colors modified to yellow and green and the new
chart is a multiple line chart, the lines will be yellow and green. If the old chart is
a simple bar chart with drop shadows and the new chart is a simple line chart, the
556
Chapter 40
lines will not have drop shadows because drop shadows don't apply to line charts.
If there are titles in the template chart but not in the new chart, you will get the
titles from the template chart. If there are titles defined in the new chart, they will
override the titles in the template chart.
E Create a chart.
E Edit the chart to contain the attributes that you want to have in a template.
E In the Save Chart Template dialog box, specify which characteristics of the chart you
want to save in the template. The online Help describes the settings in detail.
E Click Continue.
E Enter a filename and location for the new template. The template's extension is .sgt.
Chapter
41
ROC Curves
557
558
Chapter 41
Sample Output
Figure 41-1
ROC Curve output
Case Processing
Summary
Valid N
ACTUAL (listwise)
Positive1 74
Negative 76
ROC Curves
Figure 41-2
ROC Curve dialog box
Chapter 41
You can specify the following options for your ROC analysis:
Classification. Allows you to specify whether the cutoff value should be included or
excluded when making a positive classification. This currently has no effect on the
output.
Test Direction. Allows you to specify the direction of the scale in relation to the
positive category.
Parameters for Standard Error of Area. Allows you to specify the method of estimating
the standard error of the area under the curve. Available methods are nonparametric
and binegative exponential. Also allows you to set the level for the confidence
interval. The available range is 50.1% to 99.9%.
Missing Values. Allows you to specify how missing values are handled.
Chapter
42
Utilities
This chapter describes the functions found on the Utilities menu and the ability to
reorder target variable lists using the Windows system menus.
Variable Information
The Variables dialog box displays variable definition information for the currently
selected variable, including:
Data format
Variable label
User-missing values
Value labels
Figure 42-1
Variables dialog box
561
562
Chapter 42
Paste. Pastes the selected variables into the designated syntax window at the cursor
location. (Not available in the Student version.)
To modify variable definitions, use the Variable view in the Data Editor.
E Select the variable for which you want to display variable definition information.
Comments can be any length but are limited to 80 bytes (typically 80 characters
in single-byte languages) per line; lines will automatically wrap at 80 characters.
Comments are displayed in the same font as text output to accurately reflect how they
will appear when displayed in the Viewer.
A date stamp (the current date in parentheses) is automatically appended to the end
of the list of comments whenever you add or modify comments. This may lead to
some ambiguity concerning the dates associated with comments if you modify an
existing comment or insert a new comment between existing comments.
563
Utilities
Variable Sets
You can restrict the variables that appear on dialog box source variable lists by
defining and using variable sets. This is particularly useful for data files with a
large number of variables. Small variable sets make it easier to find and select the
variables for your analysis and can also enhance performance. If your data file has a
large number of variables and dialog boxes that open slowly, restricting dialog box
source lists to smaller subsets of variables should reduce the amount of time it takes
to open dialog boxes.
Set Name. Set names can be up to 12 characters long. Any characters, including
blanks, can be used. Set names are not case sensitive.
564
Chapter 42
Variables in Set. Any combination of numeric, short string, and long string variables
can be included in a set. The order of variables in the set has no effect on the display
order of the variables on dialog box source lists. A variable can belong to multiple
sets.
Use Sets
Use Sets restricts the variables displayed in dialog box source lists to the selected sets
that you have defined.
Figure 42-3
Use Sets dialog box
565
Utilities
Sets in Use. Displays the sets used to produce the source variable lists in dialog boxes.
Variables appear on the source lists in alphabetical or file order. The order of sets and
the order of variables within a set have no effect on source list variable order. By
default, two system-defined sets are in use:
ALLVARIABLES. This set contains all variables in the data file, including new variables
created during a session.
NEWVARIABLES. This set contains only new variables created during the session.
You can remove these sets from the list and select others, but there must be at least
one set on the list. If you don't remove the ALLVARIABLES set from the Sets in Use
list, any other sets you include are irrelevant.
E Select the defined variable sets that contain the variables that you want to appear in
dialog box source lists.
Chapter 42
Figure 42-4
Windows system menu with target list reordering
Move Selection Up. Moves the selected variable(s) up one position on the target list.
Move Selection Down. Moves the selected variable(s) down one position on the target
list.
You can move multiple variables simultaneously if they are contiguous (grouped
together). You cannot move noncontiguous groups of variables.
Chapter
43
Options
E Click the tabs for the settings that you want to change.
E Click OK or Apply.
567
568
Chapter 43
General Options
Figure 43-1
Options General tab
Variable Lists. Controls display of variables in dialog box list boxes. You can display
variable names or variable labels. Names or labels can be displayed in alphabetical
order or in file order, which is the order in which they actually occur in the data file
(and are displayed in the Data Editor window). Display order affects only source
variable lists. Target variable lists always reflect the order in which variables were
selected.
Session Journal. Journal file of all commands run in a session. This includes
commands entered and run in syntax windows and commands generated by dialog
box choices. You can edit the journal file and use the commands again in other
sessions. You can turn journaling off and on, append or overwrite the journal file, and
select the journal filename and location. You can copy command syntax from the
569
Options
journal file and save it in a syntax file for use with the automated Production Facility.
(Command syntax and automatic production are not available in the Student version.)
Temporary directory. Controls the location of temporary files created during a session.
In distributed mode (available with the server version), this does not affect the
location of temporary data files. In distributed mode, the location of temporary data
files is controlled by the environment variable SPSSTMPDIR, which can be set only
on the computer running the server version of the software. If you need to change the
location of the temporary directory, contact your system administrator.
Recently used file list. Controls the number of recently used files that appear on
the File menu.
Open syntax window at start-up. Syntax windows are text file windows used to enter,
edit, and run commands. If you frequently work with command syntax, select this
option to automatically open a syntax window at the beginning of each session. This
is useful primarily for experienced users who prefer to work with command syntax
instead of dialog boxes. (Not available with the Student version.)
No scientific notation for small numbers in tables. Suppresses the display of scientific
notation for small decimal values in output. Very small decimal values will be
displayed as 0 (or 0.000).
Viewer Type at Start-up. Controls the type of Viewer used and output format. The
Viewer produces interactive pivot tables and interactive charts. The Draft Viewer
converts pivot tables to text output and charts to metafiles.
Measurement System. Measurement system used (points, inches, or centimeters) for
specifying attributes such as pivot table cell margins, cell widths, and space between
tables for printing.
Language. Controls the language used in output. Does not apply to simple text output,
interactive graphics, or maps (available with the Maps option). The list of available
languages depends on the currently installed language files. A number of languages
are automatically installed when you install SPSS. For additional language files, go to
http://www.spss.com/tech/downloads/base.htm.
Note: Custom scripts that rely on language-specific text strings in the output may
not run correctly when you change the output language. For more information, see
“Script Options” on page 585.
570
Chapter 43
Notification. Controls the manner in which the program notifies you that it has
finished running a procedure and that the results are available in the Viewer.
Viewer Options
Viewer output display options affect only new output produced after you change
the settings. Output already displayed in the Viewer is not affected by changes in
these settings.
Figure 43-2
Options Viewer tab
Initial Output State. Controls which items are automatically displayed or hidden each
time you run a procedure and how items are initially aligned. You can control the
display of the following items: log, warnings, notes, titles, pivot tables, charts, and
text output (output not displayed in pivot tables). You can also turn the display of
commands in the log on or off. You can copy command syntax from the log and save
571
Options
it in a syntax file for use with the automated Production Facility. (Command syntax
and automatic production are not available in the Student version.)
Note: All output items are displayed left-aligned in the Viewer. Only the alignment
of printed output is affected by the justification settings. Centered and right-aligned
items are identified by a small symbol above and to the left of the item.
Title Font. Controls the font style, size, and color for new output titles.
Page Title Font. Controls the font style, size, and color for new page titles and page
titles generated by TITLE and SUBTITLE command syntax or created by New Page
Title on the Insert menu.
Text Output Page Size. For text output, controls the page width (expressed in number
of characters) and page length (expressed in number of lines). For some procedures,
some statistics are displayed only in wide format.
Text Output Font. Font used for text output. Text output is designed for use with a
monospaced (fixed-pitch) font. If you select a non-monospaced font, tabular output
will not align properly.
Chapter 43
Figure 43-3
Options Draft Viewer tab
Display Output Items. Controls which items are automatically displayed each time
that you run a procedure. You can control the display of the following items: log,
warnings, notes, titles, tabular output (pivot tables converted to text output), charts,
and text output (space-separated output). You can also turn on or off the display of
commands in the log. You can copy command syntax from the log and save it in a
syntax file for use with the automated Production Facility. (Command syntax and
automatic production are not available in the Student version.)
Page Breaks Between. Inserts page breaks between output from different procedures
and/or between individual output items.
Font. Font used for new output. Only fixed-pitch (monospaced) fonts are available
because space-separated text output will not align properly with a proportional font.
Tabular Output. Controls settings for pivot table output converted to tabular text output.
Column width and column separator specifications are available only if you select
Spaces for the column separator. For space-separated tabular output, by default all
573
Options
line wrapping is removed and each column is set to the width of the longest label or
value in the column. To limit the width of columns and wrap long labels, specify a
number of characters for the column width.
Note: Tab-separated tabular output will not align properly in the Draft Viewer. This
format is useful for copying and pasting results to word processing applications
where you can use any font that you want (not only fixed-pitch fonts) and set the
tabs to align output properly.
Text Output. For text output other than converted pivot table output, controls the page
width (expressed in number of characters) and page length (expressed in number of
lines). For some procedures, some statistics are displayed only in wide format.
Chapter 43
Figure 43-4
Options Output Labels tab
Output label options affect only new output produced after you change the settings.
Output already displayed in the Viewer is not affected by changes in these settings.
These settings affect only pivot table output. Text output is not affected by these
settings.
575
Options
Chart Options
Figure 43-5
Options Charts tab
Chart Template. New charts can use either the settings selected here or the settings
from a chart template file. Click Browse to select a chart template file. To create a
chart template file, create a chart with the attributes that you want and save it as a
template (choose Save Chart Template from the File menu).
Chart Aspect Ratio. The width-to-height ratio of the outer frame of new charts. You
can specify a width-to-height ratio from 0.1 to 10.0. Values less than 1 make charts
that are taller than they are wide. Values greater than 1 make charts that are wider
than they are tall. A value of 1 produces a square chart. Once a chart is created, its
aspect ratio cannot be changed.
Font. Font used for all text in new charts.
576
Chapter 43
Style Cycle Preference. The initial assignment of colors and patterns for new charts.
Cycle through colors, then patterns uses the default palette of 14 colors and then
changes the line style or the marker symbol or adds a fill pattern as necessary. Cycle
through colors only uses only colors to differentiate chart elements and does not use
patterns. Cycle through patterns only uses only line styles, marker symbols, or fill
patterns to differentiate chart elements and does not use color.
Frame. Controls the display of inner and outer frames on new charts.
Grid Lines. Controls the display of scale and category axis grid lines on new charts.
Style Cycles. Customizes the colors, line styles, marker symbols, and fill patterns for
new charts. You can change the order of the colors and patterns that are used when
a new chart is created.
Note: These settings have no effect on interactive charts (the Graphs menu's
Interactive submenu).
E Select Simple Charts and then select a color that is used for charts without categories.
E Select Grouped Charts to change the color cycle for charts with categories. To
change a category's color, select a category and then select a color for that category
from the palette.
Options
E Select Simple Charts and then select a line style that is used for line charts without
categories.
E Select Grouped Charts to change the pattern cycle for line charts with categories. To
change a category's line style, select a category and then select a line style for that
category from the palette.
Chapter 43
For example, if you create a scatterplot chart with two groups and you select Cycle
through patterns only in the main Chart Options dialog box, the first two symbols in
the Grouped Charts list are used as the markers on the new chart.
E Select Simple Charts and then select a marker symbol that is used for charts without
categories.
E Select Grouped Charts to change the pattern cycle for charts with categories. To
change a category's marker symbol, select a category and then select a symbol for
that category from the palette.
E Select Simple Charts and then select a fill pattern that is used for charts without
categories.
579
Options
E Select Grouped Charts to change the pattern cycle for charts with categories. To
change a category's fill pattern, select a category and then select a fill pattern for
that category from the palette.
Chapter 43
For interactive charts (Graphs menu, Interactive submenu), the following options
are available:
ChartLook. Select a ChartLook from the list of files and click OK or Apply. By default,
the list displays the ChartLooks saved in the Looks directory of the directory in
which the program is installed. You can use one of the ChartLooks provided with
the program, or you can create your own in the Interactive Graphics Editor (in an
activated chart, choose ChartLooks from the Format menu).
Directory. Allows you to select a ChartLook directory. Use Browse to add
directories to the list.
Browse. Allows you to select a ChartLook from another directory.
Data Saved with Chart. Controls information saved with interactive charts once the
charts are no longer attached to the data file that created them (for example, if you
open a Viewer file saved in a previous session). Saving data with the chart enables
you to perform most of the interactive functions available for charts attached to
the data file that created them (except adding variables that weren't included in the
original chart). However, this can substantially increase the size of Viewer files,
particularly for large data files.
Print Resolution. Controls the print resolution of interactive charts. In most cases,
Vector metafile will print faster and provide the best results. For bitmaps, lower
resolution charts print faster; higher resolution charts look better.
Measurement Units. Measurement system used (points, inches, or centimeters) for
specifying attributes, such as the size of the data region in a chart.
Reading Pre-8.0 Data Files. For data files created in previous versions of SPSS, you can
specify the minimum number of data values for a numeric variable used to classify
the variable as scale or categorical. Variables with fewer than the specified number of
unique values are classified as categorical. Any variable with defined value labels is
classified as categorical, regardless of the number of unique values.
Note: These settings affect only interactive charts (the Graphs menu's Interactive
submenu).
581
Options
TableLook. Select a TableLook from the list of files and click OK or Apply. By default,
the list displays the TableLooks saved in the Looks directory of the directory in
which the program is installed. You can use one of the TableLooks provided with the
program, or you can create your own in the Pivot Table Editor (choose TableLooks
from the Format menu).
Browse. Allows you to select a TableLook from another directory.
Set TableLook Directory. Allows you to change the default TableLook directory.
Adjust Column Widths for. Controls the automatic adjustment of column widths in
pivot tables.
582
Chapter 43
Labels only. Adjusts column width to the width of the column label. This produces
more compact tables, but data values wider than the label will not be displayed
(asterisks indicate values too wide to be displayed).
Labels and data. Adjusts column width to whichever is larger, the column label or
the largest data value. This produces wider tables, but it ensures that all values
will be displayed.
Default Editing Mode. Controls activation of pivot tables in the Viewer window or in
a separate window. By default, double-clicking a pivot table activates the table in
the Viewer window. You can choose to activate pivot tables in a separate window
or select a size setting that will open smaller pivot tables in the Viewer window and
larger pivot tables in a separate window.
Data Options
Figure 43-8
Options Data tab
583
Options
Transformation and Merge Options. Each time the program executes a command, it
reads the data file. Some data transformations (such as Compute and Recode) and file
transformations (such as Add Variables and Add Cases) do not require a separate pass
of the data, and execution of these commands can be delayed until the program reads
the data to execute another command, such as a statistical procedure. For large data
files, select Calculate values before used to delay execution and save processing time.
Display Format for New Numeric Variables. Controls the default display width and
number of decimal places for new numeric variables. There is no default display
format for new string variables. If a value is too large for the specified display format,
first decimal places are rounded and then values are converted to scientific notation.
Display formats do not affect internal data values. For example, the value 123456.78
may be rounded to 123457 for display, but the original unrounded value is used in
any calculations.
Set Century Range for 2-Digit Years. Defines the range of years for date-format
variables entered and/or displayed with a two-digit year (for example, 10/28/86,
29-OCT-87). The automatic range setting is based on the current year, beginning
69 years prior to and ending 30 years after the current year (adding the current
year makes a total range of 100 years). For a custom range, the ending year is
automatically determined based on the value that you enter for the beginning year.
Currency Options
You can create up to five custom currency display formats that can include special
prefix and suffix characters and special treatment for negative values.
The five custom currency format names are CCA, CCB, CCC, CCD, and CCE.
You cannot change the format names or add new ones. To modify a custom currency
format, select the format name from the source list and make the changes that you
want.
584
Chapter 43
Figure 43-9
Options Currency tab
Prefixes, suffixes, and decimal indicators defined for custom currency formats are
for display purposes only. You cannot enter values in the Data Editor using custom
currency characters.
E Select one of the currency formats from the list (CCA, CCB, CCC, CCD, CCE).
E Click OK or Apply.
585
Options
Script Options
Use the Scripts tab to specify your global procedures file and autoscript file, and
select the autoscript subroutines that you want to use. You can use scripts to automate
many functions, including customizing pivot tables.
All of the subroutines in the current autoscript file are displayed, allowing you to
enable and disable individual subroutines.
586
Chapter 43
You can also specify a different autoscript file or global procedure file.
Chapter
44
Customizing Menus and Toolbars
Menu Editor
You can use the Menu Editor to customize your menus. With the Menu Editor you
can:
Add menu items that run customized scripts.
Add menu items that run command syntax files.
Add menu items that launch other applications and automatically send data
to other applications.
You can send data to other applications in the following formats: SPSS, Excel 4.0,
Lotus 1-2-3 release 3, SYLK, tab-delimited, and dBASE IV.
E In the Menu Editor dialog box, double-click the menu to which you want to add
a new item.
E Select the menu item above which you want the new item to appear.
E Select the file type for the new item (script file, command syntax file, or external
application).
587
588
Chapter 44
Figure 44-1
Menu Editor dialog box
You can also add entirely new menus and separators between menu items.
Optionally, you can automatically send the contents of the Data Editor to another
application when you select that application on the menus.
Customizing Toolbars
You can customize toolbars and create new toolbars. Toolbars can contain any of the
available tools, including tools for all menu actions. They can also contain custom
tools that launch other applications, run command syntax files, or run script files.
Show Toolbars
Use Show Toolbars to show or hide toolbars, customize toolbars, and create new
toolbars. Toolbars can contain any of the available tools, including tools for all
menu actions. They can also contain custom tools that launch other applications, run
command syntax files, or run script files.
589
Figure 44-2
Show Toolbars dialog box
To Customize Toolbars
E From the menus choose:
View
Toolbars...
E Select the toolbar you want to customize and click Customize, or click New Toolbar
to create a new toolbar.
E For new toolbars, enter a name for the toolbar, select the windows in which you want
the toolbar to appear, and click Customize.
E Select an item in the Categories list to display available tools in that category.
E Drag and drop the tools you want onto the toolbar displayed in the dialog box.
E To remove a tool from the toolbar, drag it anywhere off the toolbar displayed in the
dialog box.
To create a custom tool to open a file, to run a command syntax file, or to run a script:
Chapter 44
E Select the action you want for the tool (open a file, run a command syntax file, or
run a script).
New tools are displayed in the User-Defined category, which also contains
user-defined menu items.
Toolbar Properties
Use Toolbar Properties to select the window types in which you want the selected
toolbar to appear. This dialog box is also used for creating names for new toolbars.
Figure 44-3
Toolbar Properties dialog box
E For existing toolbars, click Customize, and then click Properties in the Customize
Toolbar dialog box.
591
E Select the window types in which you want the toolbar to appear. For new toolbars,
also enter a toolbar name.
Customize Toolbar
Use the Customize Toolbar dialog box to customize existing toolbars and create new
toolbars. Toolbars can contain any of the available tools, including tools for all
menu actions. They can also contain custom tools that launch other applications, run
command syntax files, or run script files.
Figure 44-4
Customize Toolbar dialog box
Chapter 44
Figure 44-5
Create New Tool dialog box
Figure 44-6
Bitmap Editor
E Click the tool with the bitmap icon you want to edit on the example toolbar.
E Use the toolbox and the color palette to modify the bitmap or create a new bitmap icon.
Chapter
45
Production Facility
The Production Facility provides the ability to run the program in an automated
fashion. The program runs unattended and terminates after executing the last
command, so you can perform other tasks while it runs. Production mode is useful if
you often run the same set of time-consuming analyses, such as weekly reports.
The Production Facility uses command syntax files to tell the program what to do.
A command syntax file is a simple text file containing command syntax. You can use
any text editor to create the file. You can also generate command syntax by pasting
dialog box selections into a syntax window or by editing the journal file.
After you create syntax files and include them in a production job, you can view
and edit them from the Production Facility.
Figure 45-1
Production Facility
595
596
Chapter 45
Production job results. Each production run creates an output file with the same
name as the production job and the extension .spo. For example, a production job
file named prodjob.spp creates an output file named prodjob.spo. The output file
is a Viewer document.
Output Type. Viewer output produces pivot tables and high-resolution, interactive
charts. Draft Viewer output produces text output and metafile pictures of charts.
Text output can be edited in the Draft Viewer, but charts cannot be edited in the
Draft Viewer.
E Specify the syntax files that you want to use in the production job. Click Add to
select the syntax files.
E Run the production job file. Click the Run button on the toolbar, or from the menus
choose:
Run
Production Job
Production Facility
UNC path names. Relative path specifications for data files are relative to the current
server in distributed analysis mode, not relative to your local computer. If you have
network access to the remote server version of SPSS, we recommend that you use
UNC (universal naming convention) path names to specify the location of data files in
your command syntax files, as in:
Figure 45-2
Command syntax pasted from dialog box selections
Export Options
Export Options saves pivot tables and text output in HTML, text, Word/RTF, and
Excel format, and it saves charts in a variety of common formats used by other
applications.
598
Chapter 45
Figure 45-3
Export Options dialog box
Export
Production Facility
Export Format
For output documents, the available options are HTML, text, Word/RTF, and Excel;
for HTML and text formats, charts are exported in the currently selected chart format.
For Charts Only, select a chart export format from the drop-down list. For output
documents, pivot tables and text are exported in the following manner:
HTML file (*.htm). Pivot tables are exported as HTML tables. Text output is
exported as preformatted HTML.
Text file (*.txt). Pivot tables can be exported in tab-separated or space-separated
format. All text output is exported in space-separated format.
Excel file (*.xls). Pivot table rows, columns, and cells are exported as Excel rows,
columns, and cells, with all formatting attributes—for example, cell borders, font
styles, background colors, etc. Text output is exported with all font attributes.
Each line in the text output is a row in the Excel file, with the entire contents
of the line contained in a single cell.
Word/RTF file (*.doc). Pivot tables are exported as Word tables with all formatting
attributes—for example, cell borders, font styles, background colors, etc. Text
output is exported as formatted RTF. Text output in SPSS is always displayed in
a fixed-pitch font and is exported with the same font attributes. A fixed-pitch
(monospaced) font is required for proper alignment of space-separated text
output.
Image Format
Image Format controls the export format for charts. Charts can be exported in the
following formats: Windows metafile (WMF), Windows bitmap (BMP), encapsulated
PostScript (EPS), JPEG, TIFF, CGM, PNG, or Macintosh PICT.
Exported chart names are based on the production job filename, a sequential
number, and the extension of the selected format. For example, if the production job
prodjob.spp exports charts in Windows metafile format, the chart names would be
prodjob1.wmf, prodjob2.wmf, prodjob3.wmf, and so on.
600
Chapter 45
Text export options (for example, tab-separated or space-separated) and chart export
options (for example, color settings, size, and resolution) are set in SPSS and cannot
be changed in the Production Facility. Use Export on the File menu in SPSS to
change text and chart export options.
The only Export option available for Draft Viewer output is to export the output in
simple text format. Charts for Draft Viewer output cannot be exported.
User Prompts
Macro symbols defined in a production job file and used in a command syntax file
simplify tasks such as running the same analysis for different data files or running the
same set of commands for different sets of variables. For example, you could define
the macro symbol @datfile to prompt you for a data filename each time you run a
production job that uses the string @datfile in place of a filename.
Figure 45-4
User Prompts dialog box
601
Production Facility
Macro Symbol. The macro name used in the command syntax file to invoke the
macro that prompts the user to enter information. The macro symbol name must
begin with an @.
Prompt. The descriptive label that is displayed when the production job prompts you
to enter information. For example, you could use the phrase “What data file do you
want to use?” to identify a field that requires a data filename.
Default. The value that the production job supplies by default if you don't enter a
different value. This value is displayed when the production job prompts you for
information. You can replace or modify the value at runtime.
Enclose Value in Quotes? Enter Y or Yes if you want the value enclosed in quotes.
Otherwise, leave the field blank or enter N or No. For example, you should enter Yes
for a filename specification because filename specifications should be enclosed in
quotes.
Figure 45-5
Macro prompts in a command syntax file
602
Chapter 45
Production Options
Production Options enable you to:
Specify a default text editor for syntax files accessed with the Edit button in
the main dialog box.
Run the production job as an invisible background process or display the results
it generates as the job runs.
Specify a remote server, domain name, user ID, and password for distributed
analysis (applicable only if you have network access to the server version of
SPSS). If you don't specify these settings, the default settings in the SPSS
Server Login dialog box are used. You can select only remote servers that you
have previously defined in the Add Server dialog box in SPSS (File menu,
Switch Server, Add).
603
Production Facility
Figure 45-7
Options dialog box
Chapter 45
Output labels. Output label options (Edit menu, Options, Output Labels tab) control
the display of variable and data value information in pivot tables. You can display
variable names and/or defined variable labels, actual data values and/or defined value
labels. Descriptive variable and value labels often make it easier to interpret your
results; however, long labels can be awkward in some tables.
Column width. Pivot table options (Edit menu, Options, Pivot Table tab) control the
default TableLook and the automatic adjustment of column widths in pivot tables.
Labels only adjusts the column width to the width of the column label. This
produces more compact tables, but data values wider than the label will not be
displayed (asterisks indicate values too wide to be displayed).
Labels and data adjusts the column width to whichever is larger, the column
label or the largest data value. This produces wider tables, but it ensures that
all values will be displayed.
Production jobs use the current TableLook and Options settings in effect. You can
set the TableLook and Options settings before running your production job, or you
can use SET commands in your syntax files to control them. Using SET commands
in syntax files enables you to use multiple TableLooks and Options settings in the
same job.
E Adjust the table properties for the attributes that you want.
E Click Save Look or Save As to save the TableLook and click OK.
Production Facility
E Click OK.
You can set the default TableLook, output label settings, and automatic column width
adjustment with Options. Options settings are saved with the program. When you
run a production job, the Options settings in effect the last time that you ran the
program are applied to the production job.
SET TVARS. Controls the display of variable names and labels in new pivot tables.
SET TVARS = LABELS displays variable labels.
SET TVARS = NAMES displays variable names.
SET TVARS = BOTH displays both variable names and labels.
SET ONUMBER. Controls the display of data values or value labels in new pivot tables.
SET ONUMBER = LABELS displays value labels.
SET ONUMBER = VALUES displays data values.
SET ONUMBER = BOTH displays data values and value labels.
SET TFIT. Controls automatic column width adjustment for new pivot tables.
606
Chapter 45
SET TFIT = LABELS adjusts column width to the width of the column label.
SET TFIT = BOTH adjusts column width to the width of the column label or the
largest data value, whichever is wider.
Distributed analysis. If you have network access to the server version of SPSS, you
can also use the following switches to run the Production Facility in distributed
analysis mode:
-x. Name or IP address of the remote server.
-n. Port number.
-d. Domain name.
-u. User ID for remote server access.
-p. Password for remote server access.
If you specify any of the command lines switches for distributed analysis, you must
specify all of the distributed analysis command line switches (-x, -n, -d, -u, and -p).
You should provide the full path for both the Production Facility (spssprod.exe) and
the production job, and both should be enclosed in quotes, as in:
Production Facility
For command line switches that require additional specifications, the switch must
be followed by an equals sign followed immediately by the specification. If the
specification contains spaces (such as a two-word server name), enclose the value in
quotes or apostrophes, as in:
Default server. If you have network access to the server version of SPSS, the default
server and related information (if not specified in command line switches) is the
default server specified the SPSS Server Login dialog box. If no default is specified
there, the job runs in local mode.
If you want to run a production job in local mode but your local computer is not
your default server, specify null quoted strings for all of the distributed analysis
command line switches, as in:
Publish to Web
Publish to Web exports output for publishing to SmartViewer Web Server. Tables
and reports published in SmartViewer can be viewed and manipulated over the Web,
in real time, using a standard browser.
Pivot tables are published as dynamic tables that can be manipulated over the
Web to obtain different views of the data.
Charts are published as JPEG or PNG graphic files.
Text output is published as preformatted HTML. (By default, most Web browsers
use a fixed-pitch font for preformatted text.)
Publish. Allows you to specify the output that you want to publish:
Output Document. Publishes the entire output document, including hidden or
collapsed items.
608
Chapter 45
Output Document (No Notes). Publishes everything but the Notes tables that are
automatically produced for each procedure.
Tables Only. Excludes charts. All pivot tables and all text tables are published.
Tables Only (No Notes). Excludes charts and Notes tables.
Charts Only. Publishes only the charts in the document.
Nothing. Turns off publishing to the Web. Since all settings are saved with the
production job (.spp file), results will be published every time that you run the
production job unless you select Nothing. This turns off publishing while still
generating other types of output (Viewer files, HTML files) specified in the
production job.
46
SPSS Scripting Facility
To Run a Script
E From the menus choose:
Utilities
Run Script...
609
610
Chapter 46
Figure 46-1
Run Script dialog box
Autoscripts
Autoscripts run automatically when triggered by the creation of a specific piece of
output by a given procedure. For example, there is an autoscript that automatically
removes the upper diagonal and highlights correlation coefficients below a certain
significance whenever a Correlations table is produced by the Bivariate Correlations
procedure.
The Scripts tab of the Options dialog box (Edit menu) displays the autoscripts that
are available on your system and allows you to enable or disable individual scripts.
612
Chapter 46
Figure 46-2
Scripts tab of Options dialog box
Autoscripts are specific to a given procedure and output type. An autoscript that
formats the ANOVA tables produced by One-Way ANOVA is not triggered by
ANOVA tables produced by other statistical procedures (although you could use
global procedures to create separate autoscripts for these other ANOVA tables that
shared much of the same code). However, you can have a separate autoscript for
each type of output produced by the same procedure. For example, Frequencies
produces both a frequency table and a table of statistics, and you can have a different
autoscript for each.
For more information, see “Options” in Chapter 43 on page 567.
Figure 46-3
Modifying a script in the script window
If you prefer to create your own scripts, you can begin by choosing from a number
of starter scripts.
To Edit a Script
E From the menus choose:
File
Open
Script...
614
Chapter 46
Figure 46-4
Opening a script file
If you open more than one script, each opens in its own window.
Script Window
The script window is a fully featured programming environment that uses the Sax
BASIC language and includes a dialog box editor, object browser, debugging features,
and context-sensitive Help.
615
Figure 46-5
Script window
As you move the cursor, the name of the current procedure is displayed at the top
of the window.
Terms colored blue are reserved words in BASIC (for example Sub, End Sub,
and Dim). You can access context-sensitive Help on these terms by clicking
them and pressing F1.
Terms colored magenta are objects, properties, or methods. You can also click
these terms and press F1 for Help, but only where they appear in valid statements
and are colored magenta. (Clicking the name of an object in a comment will not
work because it brings up Help on the Sax BASIC language rather than on
SPSS objects.)
616
Chapter 46
E To change the color of a code element type, select the element and choose a color
from the drop-down palette.
617
Starter Scripts
When you create a new script, you can begin by choosing from a number of starter
scripts.
Figure 46-7
Use Starter Script dialog box
Each starter script supplies code for one or more common procedures and is
commented with hints on how to customize the script to your particular needs.
Delete by label. Delete rows or columns in a pivot table based on the contents of the
RowLabels or ColumnLabels. In order for this script to work, the Hide empty rows and
columns option must be selected in the Table Properties dialog box.
Delete navigator items. Delete items from the Viewer based on a number of different
criteria.
Footnote. Reformat a pivot table footnote, change the text in a footnote, or add a
footnote.
Reformat by labels. Reformat a pivot table based upon the row, column, or layer labels.
Reformat by value. Reformat a pivot table based upon the value of data cells or a
combination of data cells and labels.
Reformat misc pivot. Reformat or change the text in a pivot table title, corner text, or
caption.
618
Chapter 46
In addition, you can use any of the other available scripts as starter scripts, although
they may not be as easy to customize. Just open the script and save it with a different
filename.
Creating a Script
E From the menus choose:
New
Script
Creating Autoscripts
You can create an autoscript by starting with the output object that you want to serve
as the trigger. For example, to create an autoscript that runs whenever a frequency
table is produced, create a frequency table in the usual manner and single-click the
table in the Viewer to select it. You can then right-click or use the Utilities menu to
create a new autoscript triggered whenever that type of table is produced.
Figure 46-8
Creating a new autoscript
619
By default, each autoscript you create is added to the current autoscript file
(autscript.sbs) as a new procedure. The name of the procedure references the event
that serves as the trigger. For example, if you create an autoscript triggered whenever
Explore creates a Descriptives table, the name of the autoscript subroutine would
be Explore_Table_Descriptives_Create.
Figure 46-9
New autoscript procedure displayed in script window
This makes autoscripts easier to develop because you do not need to write code to
get the object you want to operate on, but it requires that autoscripts are specific to a
given piece of output and statistical procedure.
To Create an Autoscript
E Select the object you want to serve as a trigger in the Viewer.
E From the Edit menu, choose Options to enable or disable the autoscript.
620
Chapter 46
You can also use a script to trigger an autoscript indirectly. For example, you could
write a script that invokes the Correlations procedure, which in turn triggers the
autoscript registered to the resulting Correlations table.
621
Autoscript File
All autoscripts are saved in a single file (unlike other scripts, each of which is saved
in a separate file). Any new autoscripts you create are also added to this file. The
name of the current autoscript file is displayed in the Scripts tab of the Options
dialog box (Edit menu).
Figure 46-11
Autoscript subroutines displayed in Options dialog box
The Options dialog box also displays all of the autoscripts in the currently selected
autoscript file, allowing you to enable and disable individual scripts.
The default autoscript file is autscript.sbs. You can specify a different autoscript
file, but only one can be active at any one time.
622
Chapter 46
Using objects is a two-step process. First, you create a reference to the object (called
getting the object). Then, you use properties and methods to do something. You
get objects by navigating the hierarchy of objects, at each step using properties or
methods of objects higher in the hierarchy to get at the objects beneath. For example,
623
to get a pivot table object, you have to first get the output document that contains the
pivot table and then get the items in that output document.
Each object that you get is stored in a variable. (Remember that all you are really
storing in the variable is a reference to the object.) One of the first steps in creating a
script is often to declare variables for the objects that you need.
Tip: It is difficult to understand how scripts work if you do not understand how
the program works. Before writing a script, use the mouse to perform the task
several times as you normally would. At each step, consider what objects you are
manipulating and what properties of each object you are changing.
Each declaration specifies the variable name and type. For example, the first
declaration above creates an object variable named objOutputDoc and assigns this
variable to the ISpssOutputDoc object class. The variable does not yet have a value
because it has not been set to a particular output document. All the statement does
is declare that the variable exists. (This process has been referred to as “renaming
the objects you want to use.”)
Variable naming conventions. By convention, the name of each variable indicates its
type. Object variable names begin with obj, integer variables begin with int, and string
variables begin with str. These are only conventions—you can name your variables
anything you want—but following them makes it much easier to understand your
code.
SPSS object classes. ISpssOutputDoc and PivotTable are names of SPSS object
classes. Each class represents a type of object that the program can create, such as
an output document or pivot table. Each object class has specific properties and
624
Chapter 46
methods associated with it. The collection of all SPSS object classes (or types)
is referred to as the SPSS type library.
you use properties and methods of objects higher in the object hierarchy to get at the
objects beneath. The second statement above gets the designated output document
using GetDesignatedOutputDoc, a method associated with the application object,
which is the highest-level object. Similarly, to get a pivot table object, you first get
the output document that contains the pivot table, and then get the collection of
items in that output document, and so on.
This script gets the third output item in the designated output document and activates
it. If that item is not an OLE object, the script produces an error.
See below for a another example that activates the first pivot table in the designated
output document.
Sub Main
Chapter 46
End sub
This script gets the first pivot table in the designated output document and activates it.
Sub Main
End sub
Examples are also available in the online Help. You can try them yourself by pasting
the code from Help into the script window.
627
Properties set or return attributes of objects, such as color or cell width. When a
property appears to the left side of an equals sign, you are writing to it. For example,
to set the caption for an activated pivot table (objPivotTable) to "Anita's results":
When a property appears on the right side, you are reading from it. For example, to
get the caption of the activated pivot table and save it in a variable:
strFontName = objPivotTable.CaptionText
Methods perform actions on objects, such as selecting all the elements in a table:
objPivotTable.SelectTable
or removing a selection:
objPivotTable.ClearSelection
628
Chapter 46
Some methods return another object. Such methods are extremely important for
navigating the object hierarchy. For example, the GetDesignatedOutputDoc method
returns the designated output document, allowing you to access the items in that
output document:
Object Browser
The object browser displays all object classes and the methods and properties
associated with each. You can also access Help on individual properties and methods
and paste selected properties and methods into your script.
Figure 46-13
Object browser
E Select an object class from the Data Type list to display the methods and properties
for that class.
E Select properties and methods for context-sensitive Help or to paste them into your
script.
Chapter 46
Alternatively, you can create a new procedure by typing the statements that define the
procedure directly in the script.
Figure 46-15
Global script file
The default global script file is global.sbs. You can freely add procedures to this file.
You can also specify a different global file on the Scripts tab in the Options dialog
box (Edit menu), but only one file can be active as the global file at any given time.
That means that if you create a new global file and specify it as the global file, the
procedures and functions in global.sbs are no longer available.
You can view the global script file in any script window (click the #2 tab on
the left side of the window just below the toolbar), but you can edit it in only one
window at a time.
Global procedures must be called by other script procedures. You cannot run a
global script directly from the Utilities menu or a script window.
632
Chapter 46
'Begin Description
'This script changes "Sig." to "p=" in the column labels of any pivot table.
'Requirement: The Pivot Table that you want to change must be selected.
'End Description
The Editor initially displays a blank dialog box form. You can add controls, such as
radio buttons and check boxes, by selecting the appropriate tool and dragging with
the mouse. (Hold the mouse over each tool for a description.) You can also drag the
sides and corners to resize the dialog box. After adding a control, right-click the
control to set properties for that control.
Dialog monitor function. To create the dialog monitor function, right-click the dialog
box form (make sure no control is selected on the form) and enter a name for the
function in the DialogFunc field. The statements that define the function are added
to your script, although you will have to edit the function manually to define the
behavior for each action.
When finished, click the Save and Exit icon (far right on the toolbar) to add the
code for the dialog box to your script.
E Select tools from the palette and drag in the new dialog box form to add controls,
such as buttons and check boxes.
E Resize the dialog box by dragging the handles on the sides and corners.
E Right-click the form (with no control selected) and enter a name for the dialog
monitor function in the DialogFunc field.
E Click the Save and Exit icon (far right on the toolbar) when you are finished.
You have to edit your dialog monitor function manually to define the behavior of the
dialog box.
634
Chapter 46
Parameters. The function must be able to pass three parameters: one string
(strDlgItem) and two integers (intAction and intSuppValue). The parameters are values
passed between the function and the dialog box, depending on what action is taken.
For example, when a user clicks a control in the dialog box, the name of the
control is passed to the function as strDlgItem (the field name is specified in the dialog
box definition). The second parameter (intAction) is a numeric value that indicates
what action took place in the dialog box. The third parameter is used for additional
information in some cases. You must include all three parameters in the function
definition even if you do not use all of them.
Select Case intAction. The value of intAction indicates what action took place in the
dialog box. For example, when the dialog box initializes, intAction = 1. If the user
presses a button, intAction changes to 2, and so on. There are five possible actions, and
you can specify statements that execute for each action as indicated below. You do
not need to specify all five possible cases-only the ones that apply. For example, if
you do not want any statements to execute on initialization, omit Case 1.
Case intAction = 1. Specify statements to execute when the dialog box is
initialized. For example, you could disable one or more controls or add a beep.
The string strDlgItem is a null string; intSuppValue is 0.
635
This script creates a simple dialog box that opens a data file. See related sections for
explanations of the BuildDialog subroutine and dialog monitor function.
Figure 46-17
Open Data File dialog box created by script
Sub Main
Call BuildDialog
End Sub
Chapter 46
OKButton 470,7,100,21,.cmdOK
CancelButton 470,35,100,21,.cmdCancel
End Dialog
Dim dlg As UserDialog
Dialog dlg
End Sub
Examples are also available in the online Help. You can try them yourself by pasting
the code from Help into the script window.
Debugging Scripts
The Debug menu allows you to step through your code, executing one line or
subroutine at a time and viewing the result. You can also insert a break point in the
script to pause the execution at the line that contains the break point.
637
To debug an autoscript, open the autoscript file in a script window, insert break
points in the procedure that you want to debug, and then run the statistical procedure
that triggers the autoscript.
Step Into. Execute the current line. If the current line is a subroutine or function call,
stop on the first line of that subroutine or function.
Step Over. Execute to the next line. If the current line is a subroutine or function call,
execute the subroutine or function completely.
Step Out. Step out of the current subroutine or function call.
Step to Cursor. Execute to the current line.
Toggle Break. Insert or remove a break point. The script pauses at the break point,
and the debugging pane is displayed.
Quick Watch. Display the value of the current expression.
Add Watch. Add the current expression to the watch window.
Object Browser. Display the object browser.
Set Next Statement. Set the next statement to be executed. Only statements in the
current subroutine/function can be selected.
Show Next Statement. Display the next statement to be executed.
E Use the toolbar (or hot keys) to continue stepping through the script.
E Alternatively, select Toggle Break to insert a break point at the current line.
Chapter 46
Immediate tab. Click the name of any variable and click the eyeglass icon to display
the current value of the variable. You can also evaluate an expression, assign a
variable, or call a subroutine.
Type ?expr and press Enter to show the value of expr.
Type var = expr and press Enter to change the value of var.
Type subname args and press Enter to call a subroutine or built-in instruction.
Type Trace and press Enter to toggle trace mode. Trace mode prints each
statement in the immediate window when a script is running.
639
Watch tab. To display a variable, function, or expression, click it and choose Add
Watch from the Debug menu. Displayed values are updated each time execution
pauses. You can edit the expression to the left of ->. Press Enter to update all the
values immediately. Press Ctrl-Y to delete the line.
Stack tab. Displays the lines that called the current statement. The first line is the
current statement, the second line is the one that called the first, and so on. Click any
line to highlight that line in the edit window.
Loaded tab. List the currently active scripts. Click a line to view that script.
Chapter 46
Figure 46-19
Pasting command syntax into a script
When you open dialog boxes using the script window menus, the Paste button pastes
all of the code needed to run commands from within a script.
Note: You must use the script window menus to open the dialog box; otherwise,
commands will be pasted to a syntax window rather than the scripting window.
E From the script window menus, choose commands from the Statistics, Graphs, and
Utilities menus to open dialog boxes.
E Click Paste.
Note: You must use the script window menus to open the dialog box; otherwise,
commands will be pasted to a syntax window rather than the scripting window.
47
Output Management System
The Output Management System provides the ability to automatically write selected
categories of output to different output files in different formats. Formats include:
SPSS data file format (SAV). Output that would be displayed in pivot tables in the
Viewer can be written out in the form of an SPSS data file, making it possible to
use output as input for subsequent commands.
XML. Tables, text output, and even many charts can be written out in XML format.
HTML. Tables and text output can be written out in HTML format.
Text. Tables and text output can be written out as tab-delimited or space-separated
text.
Output management is currently only available with command syntax using the OMS
command. For a detailed discussion of the OMS command, see the Command Syntax
Reference (Help menu, Command Syntax Reference).
OMS Identifiers
The OMS Identifiers dialog box is designed to assist you in writing OMS command
syntax. You can use it to paste selected command and subtype identifiers into a
command syntax window.
643
644
Chapter 47
Figure 47-1
OMS Identifiers dialog box
With the OMS command, you can use the IF subcommand to specify output from
specific commands and/or table types that you want to route to various output
destinations (including the Viewer)—and you can use EXCEPTIF to exclude specific
output. For example:
OMS
/SELECT TABLES
/IF COMMANDS=['Crosstabs' 'Descriptives']
SUBTYPES=['Crosstabulation' 'Descriptive Statistics']
/DESTINATION FORMAT=OXML OUTFILE='C:\temp\temp.xml'.
This command will select crosstabulation and descriptive statistics tables from
subsequent CROSSTABS and DESCRIPTIVES commands and generate an XML file
that contains the contents of those tables.
Subtype Identifiers. Subtypes are the different types of pivot tables that can be
produced. Some subtypes are only produced by one command; other subtypes can be
produced by multiple commands (although tables with the same subtype names in
different procedures may have different structures and contents). Both of the subtypes
specified in the above example can be produced by multiple commands, but since
we also specify the commands, output from any other commands that produce those
subtypes will not be selected.
E Select one or more command or subtype identifiers. Use ctrl-click to select multiple
identifiers in each list.
Chapter 47
E Right-click the outline entry for the item in the outline pane.
E From the pop-up context menu, select Copy OMS Command Identifier or Copy OMS
Table Subtype.
This method differs from the OMS Identifiers dialog in one respect: The copied
identifier is not automatically pasted to a command syntax window. It is simply
copied to the clipboard, and you can then paste it anywhere you want. Since
command and subtype identifier values are identical to the corresponding command
and subtype attribute values in XML-format output (OXML), you might find this
copy/paste method useful if you write XSLT transformations.
Instead of identifiers, you can copy labels for use with the LABELS keyword. Labels
can be used to differentiate between multiple graphs or multiple tables of the same
type in which the outline text reflects some attribute of the particular output object
such as the variable names or labels. There are, however, a number of factors that
can affect the label text:
If split file processing is on, split file group identification may be appended
to the label.
Labels that include information about variables or values are affected by the
settings for display of variable names/labels and values/value labels in the outline
pane (Edit menu, Options, Output Labels tab).
Labels are affected by the current output language setting (Edit menu, Options,
General tab).
E Right-click the outline entry for the item in the outline pane.
As with command and subtype identifiers, the labels must be in quotes and the entire
list enclosed in square brackets, as in:
A
Database Access Administrator
Each file contains level-specific information about any number of data sources. For
example, your dba03.inf file could contain personal view information for a corporate
accounts database, your company's hourlog database, and a database that you use to
keep track of your CD collection.
When you open the Database Access Administrator, it will search your system's
path for these files and automatically display information for all three views of any
data source you have configured.
Inheritance and Priorities. Whenever you use the Database Wizard, it presents the
lowest-level view of your data source that it can find on your system's path, where the
levels are, from highest to lowest, Enterprise, Department, and Personal. Each level's
649
650
Appendix A
file holds information about all of your data sources for that level. For example,
your marketing department will have one file, dba02.inf, that contains the aliasing
information for all of the database views established for the marketing department.
Each person in the marketing department will have a file, dba03.inf, that contains
customized views of all of the databases that he or she uses.
In the Database Access Administrator, Aliases, Variable Names, and Hide Orders
are inherited from the top down.
Example. If the Regions table is hidden at the Enterprise level, it is invisible at
both the Department and Personal levels. This table would not be displayed in the
Database Wizard.
Example. The field JOBCAT in the Employee Sales table is not aliased at the
Enterprise level, but it is aliased as Job Categories at the Department level. It
appears as Job Categories at the Personal level. Additionally, if the Employee Sales
table is aliased as Employee Information at the Personal level, the original field
(EmployeeSales.JOBCAT) would appear in the Database Wizard as 'Employee
Information'.'Job Categories'.
To start the Database Access Administrator, run the file spssdbca.exe, which is
installed in your SPSS directory. For more information about the Database Access
Administrator, refer to its online Help.
Appendix
B
Customizing HTML Documents
You can automatically add customized HTML code to documents exported in HTML
format, including:
HTML document titles
Document type specification
Meta tags and script code (for example, JavaScript)
Text displayed before and after exported output
E Replace the comments in the “fields” on the lines between the double open brackets
(<<) with the text or HTML code you want to insert in your exported HTML
documents.
Note: If you change the name or location of the text file, you have to modify the
system registry to use the file to customize your exported HTML output.
651
652
Appendix B
E From the Windows Start menu choose Run, type regedit, and click OK.
653
E For Value data, enter the full path and name of the text file containing the custom
HTML specifications (for example, c:\myfiles\htmlstuf.txt).
<<
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<<
NVI, Inc.
<<
<META NAME="keywords" CONTENT="gizmos, gadgets, gimcracks">
<<
bgcolor="#FFFFFF"
<<
<H4 align=center>This page made possible by...
<br><br>
<IMG SRC="spss2.gif" align=center></H4>
<<
<h2 align=center>NVI Sales</h2>
<h3 align=center>Regional Data</h3>
Appendix B
[Exported output]
655
656
Index
Index
cell foreground, 267 confidence intervals, 301, 341, 356, 365, 373, 373,
font, 261 399, 402, 560
column format, 264 in Explore, 301
changing in pivot tables, 264 in GLM, 365, 373
column percentages, 313 in Independent-Samples T Test, 341
in Crosstabs, 313 in Linear Regression, 402
columns, 262, 269 in One-Way ANOVA, 356
changing width in pivot tables, 262 in ROC Curve, 560
selecting in pivot tables, 269 saving in Linear Regression, 399
column summary reports, 519 context-sensitive help, 244
column width, 84, 255, 262, 581 finding label definitions in pivot tables, 244
controlling default width, 581 contingency coefficient, 309
controlling maximum width, 255 in Crosstabs, 309
controlling width for wrapped text, 255 contingency tables, 305
in Data Editor, 84 continuation text, 260
pivot tables, 262 for pivot tables, 260
comma format, 78, 80 contrasts, 352, 365, 366
command language, 273 in GLM, 365, 366
command line switches, 606 in One-Way ANOVA, 352
Production Facility, 606 control variables, 308, 384
command syntax, 13, 273, 274, 275, 276, 278, 279, in Crosstabs, 308
280, 568, 570, 571, 587, 591, 596 in Partial Correlations, 384
adding to menus, 587 convergence, 431, 433, 462
installing command syntax reference, 13 in Factor Analysis, 431, 433
journal file, 278, 280, 568 in K-Means Cluster Analysis, 462
log, 570, 571 Cook's distance, 371, 399
output log, 276 in GLM, 371
pasting, 275 in Linear Regression, 399
Production Facility formatting, 605 copying, 201, 206
Production Facility rules, 596 charts, 206
running, 279 output, 201
running with toolbar buttons, 591 pivot tables, 206
syntax rules, 274 correlation matrix, 418, 423
comparing groups, 335 in Discriminant Analysis, 418
in OLAP Cubes, 335 in Factor Analysis, 423, 430
comparing variables, 335 correlations, 309, 377, 377, 383, 383, 386
in OLAP Cubes, 335 bivariate, 377
compound model, 411 in Bivariate Correlations, 377
in Curve Estimation, 411 in Crosstabs, 309
computing variables, 127, 129 in Partial Correlations, 383
computing new string variables, 129 partial, 383
concentration index, 543 zero-order, 386
in Ratio Statistics, 543 counting occurrences, 132
conditional transformations, 129
658
Index
covariance matrix, 371, 402, 418, 421 Data Editor, 73, 75, 84, 84, 86, 87, 87, 88, 88, 89,
in Discriminant Analysis, 418, 421 89, 90, 91, 91, 92, 92, 92, 93, 93, 93, 587
in GLM, 371 alignment, 84
in Linear Regression, 402 changing data type, 92
covariance ratio, 399 column width, 84
in Linear Regression, 399 data value restrictions, 88
Cramér's V, 309 Data view, 73
in Crosstabs, 309 defining variables, 75
Cronbach's alpha, 527 display options, 93
in Reliability Analysis, 527, 530 editing data, 88, 89, 89
Crosstabs, 171, 305, 306, 307, 308, 308, 309, 309, entering data, 86
309, 309, 309, 313, 314, 314 entering non-numeric data, 87
assumptions, 306 entering numeric data, 87
cell display, 313 filtered cases, 93
clustered bar charts, 309 finding cases, 92, 92
control variables, 308 inserting new cases, 90
formats, 314 inserting new variables, 91
fractional weights, 171 moving variables, 91
layers, 308 printing, 93
statistics, 309 sending data to other applications, 587
suppressing tables, 305 data entry, 86
crosstabulation, 305 data files, 19, 20, 48, 48, 48, 52, 52, 54, 66, 67, 68,
in Crosstabs, 305 154
cubic model, 411 adding comments, 562
in Curve Estimation, 411 dictionary information, 48, 48
cumulative sum function, 149 file information, 48, 48
currency formats, 583 flipping, 154
Curve Estimation, 407, 407, 407, 409, 411, 412 opening, 19, 20
analysis of variance, 407 protecting, 55
assumptions, 407 remote servers, 66, 67, 68
forecast, 412 saving, 48, 52, 52
including constant, 407 saving output as SPSS-format data files, 643
models, 411 saving subsets of variables, 54
saving predicted values, 412 transposing, 154
saving prediction intervals, 412 data transformations, 127, 129, 129, 130, 134, 135,
saving residuals, 412 137, 138, 140, 144, 145, 147, 582
time series analysis, 407 computing variables, 127
custom currency formats, 78, 583 conditional transformations, 129
custom models, 363 delaying execution, 582
in GLM, 363 functions, 130
ranking cases, 140
d, 309 recoding values, 134, 135, 137, 138, 144
in Crosstabs, 309 string variables, 129
data analysis, 11 time series, 145, 147
basic steps, 11
659
Index
data types, 78, 78, 80, 92, 583 in GLM Univariate, 373
changing, 92 in Ratio Statistics, 543
custom currency, 78, 583 in Summarize, 319
defining, 78 in TwoStep Cluster Analysis, 447
display formats, 80 designated window, 5
input formats, 80 detrended normal plots, 302
Data view, 73 in Explore, 302
date formats, 78, 80, 582 deviation contrasts, 365, 366
two-digit years, 582 in GLM, 365, 366
date variables, 145 DfBeta, 399
defining for time series data, 145 in Linear Regression, 399
dBASE files, 19, 22, 52, 52 DfFit, 399
opening, 19, 22 in Linear Regression, 399
saving, 52, 52 dialog boxes, 7, 7, 8, 9, 9, 9, 10, 563, 564, 568, 568,
debugging scripts, 636, 638 632, 634
break points, 636 controls, 8
debugging pane, 638 defining variable sets, 563
stepping through scripts, 636 displaying variable labels, 7, 568
Define Multiple Response Sets, 500, 501 displaying variable names, 7, 568
categories, 500 getting Help, 10
dichotomies, 500 optional specifications, 9
set labels, 500 reordering target lists, 565
set names, 500 scripting, 632, 634
defining variables, 75, 78, 81, 81, 83, 84, 84, 86, 86 selecting variables, 9
copying and pasting attributes, 84, 86 subdialog boxes, 9
data types, 78 using variable sets, 564
missing values, 83 variable display order, 568
templates, 84, 86 variable information, 9
value labels, 81 variables, 7
variable labels, 81 dictionary, 48, 48
deleted residuals, 371, 399 difference contrasts, 365, 366
in GLM, 371 in GLM, 365, 366
in Linear Regression, 399 difference function, 149
deleting multiple EXECUTES in syntax files, 280 differences between groups, 335
deleting output, 200 in OLAP Cubes, 335
dendrograms, 455 differences between variables, 335
in Hierarchical Cluster Analysis, 455 in OLAP Cubes, 335
Descriptives, 291, 291, 292 direct oblimin rotation, 433
assumptions, 291 in Factor Analysis, 433
display order, 294 Discriminant Analysis, 413, 557
saving z scores, 291 analyzing held-out cases, 610
statistics, 294 assumptions, 414
descriptive statistics, 286, 291, 301, 319, 373, 543 covariance matrix, 421
in Descriptives, 291 criteria, 419
in Explore, 301 data considerations, 414
in Frequencies, 286 defining ranges, 417
660
Index
Index
Index
fonts, 93, 204, 236, 261, 261 geometric mean, 319, 326, 332
colors, 261 in Means, 326
in cells, 261 in OLAP Cubes, 332
in Data Editor, 93 in Summarize, 319
in Draft Viewer, 236 GLM Univariate, 359, 360, 362, 363, 364, 365, 366,
in the outline pane, 204 367, 368, 371, 373, 373, 374
footers, 223, 224 assumptions, 360
footnotes, 256, 267, 268, 270 build terms, 364
adding to a table, 270 contrasts, 365, 366
in charts, 551 diagnostics, 373
markers, 256, 267 display, 373
renumbering, 268 estimated marginal means, 373
forecast, 412 interaction terms, 364
in Curve Estimation, 412 model, 363, 363
formatting, 231, 514 options, 373
columns in reports, 514 post hoc tests, 368
draft output, 231 profile plots, 367
forward selection, 396 saving matrices, 371
in Linear Regression, 396 saving variables, 371
Frequencies, 283, 283, 285, 286, 288, 288 sum of squares, 363
assumptions, 283 global procedures, 585, 630
charts, 288 global scripts, 630
display order, 288 Goodman and Kruskal's gamma, 309
formats, 288 in Crosstabs, 309
statistics, 286 Goodman and Kruskal's lambda, 309
suppressing tables, 288 in Crosstabs, 309
frequency tables, 283, 301 Goodman and Kruskal's tau, 309
in Explore, 301 in Crosstabs, 309
in Frequencies, 283 grand totals, 524
full factorial models, 363 in column summary reports, 524
in GLM, 363 grid lines, 260
function procedures, 629 pivot tables, 260
functions, 130, 130, 131 grouped median, 319, 326, 332
missing value treatment, 131 in Means, 326
in OLAP Cubes, 332
Gabriel test, 353, 368 in Summarize, 319
in GLM, 368 grouping rows or columns, 242
in One-Way ANOVA, 353 group labels, 242
Games-Howell test, 353, 368 group means, 323, 329
in GLM, 368 growth model, 411
in One-Way ANOVA, 353 in Curve Estimation, 411
gamma, 309 Guttman model, 527
in Crosstabs, 309 in Reliability Analysis, 527, 530
generalized least squares, 431
in Factor Analysis, 431 Hampel's redescending M-estimator, 301
in Explore, 301
663
Index
Index
Index
Index
Index
Newman-Keuls, 368 One-Way ANOVA, 349, 349, 350, 351, 352, 353,
in GLM, 368 356
noise handling assumptions, 350
in TwoStep Cluster Analysis, 443 contrasts, 352
nominal, 77 factor variables, 349
measurement level, 77 missing values, 356
nonparametric tests, 466 multiple comparisons, 353
Chi-Square Test, 466 options, 356
normality tests, 302 polynomial contrasts, 352
in Explore, 302 post hoc tests, 353
normal probability plots, 302, 398 statistics, 356
in Explore, 302 online Help, 12, 13
in Linear Regression, 398 Statistics Coach, 12
normal scores, 142 opening files, 19, 19, 19, 19, 19, 19, 19, 20, 22, 22
in Rank Cases, 142 data files, 19, 20
number of cases, 319, 326, 332 dBASE files, 19, 22
in Means, 326 Excel files, 19
in OLAP Cubes, 332 Lotus 1-2-3 files, 19
in Summarize, 319 spreadsheet files, 19, 22
numeric format, 78, 80 SYSTAT files, 19
tab-delimited files, 19
object browser, 628 options, 568, 568, 570, 571, 573, 575, 579, 581,
objects, 622, 624, 625, 628 582, 582, 583, 585
overview, 622, 624 charts, 575
using in scripts, 622, 625, 628 currency, 583
variable-naming conventions, 624 data, 582
observed count, 313 Draft Viewer, 571
in Crosstabs, 313 general, 568
observed means, 373 interactive charts, 579
in GLM Univariate, 373 output labels, 573
OK button, 8 pivot table look, 581
OLAP Cubes, 329, 329, 330, 332, 336 scripts, 585
assumptions, 329 temporary directory, 568
statistics, 332, 332 two-digit years, 582
titles, 336 Viewer, 570
OLE automation, 609, 622, 624, 625, 627, 628 ordinal, 77
methods, 627 measurement level, 77
overview, 622, 624, 625, 628 outliers, 301, 398
properties, 627 in Explore, 301
scripting with, 609 in Linear Regression, 398
using objects, 622, 625, 628 in TwoStep Cluster Analysis, 443
variable-naming conventions, 624 outline, 202, 203, 203
OMS, 643, 643 changing levels, 203
using XSLT with OXML, 646 collapsing, 203
expanding, 203
in Viewer, 202
668
Index
Index
Index
Production Facility, 568, 570, 571, 595, 595, 596, in OLAP Cubes, 332
597, 600, 602, 602, 602, 603, 606, 607 in Ratio Statistics, 543
command line switches, 606 in Summarize, 319
exporting charts, 595, 597 rank correlation coefficient, 377
exporting output, 597 in Bivariate Correlations, 377
format control for pivot tables, 603 ranking cases, 140, 142, 142, 143
format control with command syntax, 605 fractional ranks, 142
macro prompting, 602 percentiles, 142
options, 602 Savage scores, 142
output files, 595 tied values, 143
publishing output, 607 Rankit estimates, 142
publishing to Web, 607 Rao's V, 419
scheduling production jobs, 606 in Discriminant Analysis, 419
specifying a remote server, 602 Ratio Statistics, 541, 541, 542, 543
substituting values in syntax files, 600 assumptions, 541
syntax rules, 596 statistics, 543
using command syntax from journal file, 568 r correlation coefficient, 309, 377
using command syntax from log, 570, 571 in Bivariate Correlations, 377
profile plots, 367 in Crosstabs, 309
in GLM, 367 recoding variables, 134, 135, 137, 138, 144
programming with command language, 273 reference category, 365, 366
properties, 254, 255, 627 in GLM, 365, 366
OLE automation objects, 627 regression, 391, 398
pivot tables, 254 Linear Regression, 391
table, 255 multiple regression, 391
proportion estimates, 142 plots, 398
in Rank Cases, 142 regression coefficients, 402
Proximities, 449 in Linear Regression, 402
in Hierarchical Cluster Analysis, 449 R-E-G-W F, 353, 368
publishing output, 608 in GLM, 368
with Production Facility, 607 in One-Way ANOVA, 353
R-E-G-W Q, 353, 368
quadratic model, 411 in GLM, 368
in Curve Estimation, 411 in One-Way ANOVA, 353
quartiles, 286 relative risk ratio, 309
in Frequencies, 286 in Crosstabs, 309
quartimax rotation, 433 Reliability Analysis, 527
in Factor Analysis, 433 ANOVA table, 530
random number seed, 131 assumptions, 528
random sample, 131, 169 command additional features, 532
random number seed, 131 data considerations, 528
selecting, 169 descriptives, 530
range statistic, 286, 294, 319, 326, 332, 543 example, 527
in Descriptives, 294 Hotelling's T-square, 530
in Frequencies, 286 inter-item correlations and covariances, 530
in Means, 326 intraclass correlation coefficient , 530
671
Index
Kuder-Richardson 20, 530 Report Summaries in Rows, 511, 511, 514, 515,
related procedures, 528 516, 516, 516, 518, 519, 519, 524
statistics, 527, 530 break columns, 511
Tukey's test of additivity, 530 break spacing, 515
remote servers, 61, 61, 62, 63, 66, 67, 68, 70, 71, column format, 514
602 command syntax, 524
adding, 63 data columns, 511
available procedures, 70 footers, 518
data file access, 66, 68 missing values, 516
editing, 63 page control, 515
logging in, 62 page layout, 516
Production Facility, 602 page numbering, 516
saving data files, 67 sorting sequences, 511
UNC paths, 71 titles, 518
removing group labels, 242 variables in titles, 518
reordering rows and columns, 241 Reset button, 8
repeated contrasts residual plots, 373
in GLM, 365, 366 in GLM Univariate, 373
replacing missing values, 151 residuals, 313, 399, 412
linear interpolation, 151 in Crosstabs, 313
linear trend, 151 saving in Curve Estimation, 412
mean of nearby points, 151 saving in Linear Regression, 399
median of nearby points, 151 rho, 309, 377
series mean, 151 in Bivariate Correlations, 377
reports, 511, 519, 522, 522 in Crosstabs, 309
column summary reports, 519 right mouse button Help, 10
comparing columns, 522 in dialog boxes, 10
composite totals, 522 risk, 309
dividing column values, 522 in Crosstabs, 309
multiplying column values, 522 ROC Curve, 557, 557, 560
row summary reports, 511 data considerations, 557
total columns, 522 statistics and plots, 560
Report Summaries in Columns, 514, 516, 522, 523, rotating labels, 243
524, 524 row percentages, 313
column format, 514 in Crosstabs, 313
command syntax, 524 rows, 269
grand total, 524 selecting in pivot tables, 269
missing values, 524 R-square, 326, 402, 402
page control, 523 in Linear Regression, 402
page layout, 516 in Means, 326
page numbering, 524 R-square change, 402
subtotals, 523 R statistic, 326, 402
total columns, 522 in Linear Regression, 402
in Means, 326
running median function, 149
672
Index
Index
Index
standard deviation, 286, 294, 301, 319, 326, 332, stress, 533
373, 515, 521, 543 in Multidimensional Scaling, 533
in Descriptives, 294 strictly parallel model, 527
in Explore, 301 in Reliability Analysis, 527, 530
in Frequencies, 286 string data, 87
in GLM Univariate, 373 entering data, 87
in Means, 326 string format, 78
in OLAP Cubes, 332 string variables, 7, 83, 129, 144
in Ratio Statistics, 543 computing new string variables, 129
in Report Summaries in Columns, 521 in dialog boxes, 7
in Report Summaries in Rows, 515 missing values, 83
in Summarize, 319 recoding into consecutive integers, 144
standard error, 286, 294, 301, 371, 373, 560 Student's t test, 337
in Descriptives, 294 Studentized residuals, 399
in Explore, 301 in Linear Regression, 399
in Frequencies, 286 Student-Newman-Keuls, 353, 368
in GLM, 371, 373 in GLM, 368
in ROC Curve, 560 in One-Way ANOVA, 353
standard error of kurtosis, 319, 326, 332 subgroup means, 323, 329
in Means, 326 subroutine procedures, 629
in OLAP Cubes, 332 subsets of cases, 166, 168, 169, 170
in Summarize, 319 random sample, 169
standard error of skewness, 319, 326, 332 selecting, 166, 168, 170
in Means, 326 subtitles
in OLAP Cubes, 332 in charts, 551
in Summarize, 319 subtotals, 523
standard error of the mean, 319, 326, 332 in column summary reports, 523
in Means, 326 sum, 286, 294, 319, 326, 332
in OLAP Cubes, 332 in Descriptives, 294
in Summarize, 319 in Frequencies, 286
standardization in Means, 326
in TwoStep Cluster Analysis, 443 in OLAP Cubes, 332
standardized residuals, 371, 399 in Summarize, 319
in GLM, 371 Summarize, 315, 315, 316, 318, 319
in Linear Regression, 399 assumptions, 315
standardized values, 291 options, 318
in Descriptives, 291 statistics, 319
starter scripts, 617 sum of squares, 363, 364
Statistics Coach, 12 in GLM, 363, 364
status bar, 6, 7 syntax, 13, 273, 274, 275, 276, 278, 279, 280, 568,
hiding, 7 570, 571, 591, 596, 639, 641
showing, 7 installing command syntax reference, 13
stem-and-leaf plots, 302 journal file, 278, 280, 568
in Explore, 302 log, 570, 571
stepwise selection, 396 output log, 276
in Linear Regression, 396 pasting, 275
675
Index
pasting into scripts, 640 exporting output as text, 210, 214, 597
Production Facility rules, 596 in cells, 269
running, 279 TIFF files, 218
running command syntax with toolbar buttons, exporting charts, 210, 215, 218, 597
591 time series analysis, 407, 412
syntax rules, 274 curve estimation, 407
with scripts, 639, 639, 641 forecast, 412
SYSTAT files, 19 predicting cases, 412
opening, 19 time series data, 145, 145, 147, 149, 150
creating new time series variables, 147
T4253H smoothing, 149 data transformations, 145
tab-delimited files, 19, 21, 52, 52, 55 defining date variables, 145
opening, 19 replacing missing values, 150
reading variable names, 21 transformation functions, 149
saving, 52, 52 titles, 204, 336
writing variable names, 55 adding to Viewer, 204
table breaks, 271 in charts, 551
TableLooks, 252, 252, 253 in OLAP Cubes, 336
applying, 252 tolerance, 402
creating, 253 in Linear Regression, 402
tables, 271 toolbars, 588, 590, 591, 591, 592
controlling table breaks, 271 creating, 588, 591
Tamhane's T2, 353, 368 creating new tools, 591
in GLM, 368 customizing, 588, 591
in One-Way ANOVA, 353 displaying in different windows, 590
target lists, 565 editing bitmap icons, 592
tau-b, 309 showing and hiding, 588
in Crosstabs, 309 total column, 522
tau-c, 309 in reports, 522
in Crosstabs, 309 total percentages, 313
templates, 84, 86, 575 in Crosstabs, 313
in charts, 555, 575 totals, 610
variable definition, 84, 86 automatically bolding in output, 610
temporary directory, 568, 568 transformation matrix, 423
setting location in local mode, 568 in Factor Analysis, 423
SPSSTMPDIR environment variable, 568 transposing rows and columns, 241
tests for independence, 309 transposing variables and cases, 154
chi-square, 309 tree depth
tests for linearity, 326 in TwoStep Cluster Analysis, 443
in Means, 326 trigger events, 620
text, 204, 205, 210, 214, 229, 238, 269, 597 autoscripts, 620
adding a text file to the Viewer, 205 trimmed mean, 301
adding to Viewer, 204 in Explore, 301
creating text output, 229 t tests, 337, 373
exporting draft output as text, 238 in GLM Univariate, 373
in Independent-Samples T Test, 337
676
Index
Index