For more information about SPSS® software products, please visit our Web site at
http://www.spss.com or contact
SPSS Inc.
233 South Wacker Drive, 11th Floor
Chicago, IL 60606-6412
Tel: (312) 651-3000
Fax: (312) 651-3668
SPSS is a registered trademark and the other product names are the trademarks of SPSS Inc. for its
proprietary computer software. No material describing such software may be pr oduced or distributed
without the written permission of the owners of the trademark and license rights in the software and
the copyrights in the published materials.
The SOFTWARE and documentation are provided with RESTRICTED R IGHTS. Use, duplication,
or disclosure by the Government is subject to restrictions as set forth in subdivision (c)(1)(ii) of The
Rights in T echnical Data and Computer Sof tware clause at 52.227 -7013. Contractor/manuf acturer is
SPSS Inc., 233 South Wacker Drive, 11th Floor, Chicago, IL 60606-6412.
General notice: Other product names mentioned herein are used for identif ication purposes only and
may be trademarks of their respective companies.
TableLook is a trademark of SPSS Inc.
Windows is a registered trademark of Microsoft Corporation.
DataDirect, DataDirect Connect, INTERSOLV, and SequeLink are registered trademarks of
MERANT Solutions Inc.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any
form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the
prior written permission of the publisher.
SPSS® 11.5 is a comprehensive system for analyzing data. SPSS can take data from
almost any type of fi le and use them to g enerate tab ulate d reports , charts, and plots of
distributions and trends, descriptive statistics, and complex statistical analyses.
SPSS makes statisti cal analy sis ac cessi ble for the cas ua l user and conve nient for the
experienced user. The Data Editor offers a simple and efficient spreadsheet-like facility
for entering data and browsing the working data file. High-resolution, presentationquality charts and plots are integral parts of the Base system. Much of the output from the
Base system and Tables option takes the form of flexible pivot tables that you can modify
quickly and copy directly into other applications. The Viewer makes it easy to organize
and manage your tables and charts using a familiar tree structure. When you have
questions about an item in a dialog box, a statistic in your output, or the steps needed to
accomplish a task, help is only a click or two away. With the Draft Viewer, you can create
simple text output instead of interactive pivot tables. See the overview (Chapter 1) for a
list of new features and an introduction to the Base system.
This manual, th e SPSS Base 11.5 User’s Guid e, do cumen ts th e grap hi cal use r
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 11.5
of SPSS. Examples using the statistical procedures found in SPSS Base 11.5 are
provided in the Help system, installed with the software. Algorithms used in the
statistical procedures are available on the product CD-ROM.
Beneath the menus and dial og boxes, SPSS uses a command language that can be
used to create and run p r oduc ti on j obs. Dial o g boxes can “paste” commands into a
syntax window, where they can be modif ied and sav ed; a fe w featu res of the system ca n
be accessed only via command syntax. Compl ete command syntax is documente d in the
SPSS 11.5 Syntax Reference Guide, whi ch is incl uded on the prod uct CD-ROM and is
available for purchase separat el y in pr int . T he Help system contains brief syntax
diagrams in addition to full help on the graphical user interface.
iii
Page 4
SPSS Options
The SPSS family o f products i ncludes add-on enh ancements to t he SPSS Base system,
which are availabl e on several computer platforms. Contact your local SPSS office or
sales representative about availability of the following options:
n SPSS Regression Models
traditional linear statistical models. It includes procedures for probit analysis,
logistic regression, weight estimatio n, two-stage least-squares regression, and
general nonlinear regression.
n SPSS Advanced Models
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.
n SPSS Tables
complex stub-and-banner tables and displays of multiple-response data.
n SPSS Trends
multiple curve-fitting models, smoothing m odels, and methods for estim ating
autoregressive functions.
n SPSS Categories
analysis.
n SPSS Conjoint
n SPSS Exact Tests
unevenly distributed samples could make the usual tests inaccurate.
n SPSS Missing Value Analysis
and other statistics, and imputes values for missing observations.
n SPSS Maps
symbols, colors, bar charts, pie charts, and comb i n ations of themes to present not
only what is happening but where it is happening.
™
provides techniques for analyzing da ta that do not fit
™
focuses on techniques often used in sophisticated
™
creates a variety of presentation-quality tabular reports, including
™
performs comprehensive forecasting and time series analyses with
®
performs optimal scaling procedures, including correspondence
™
performs conjoint analysis.
™
calculates exact p values for statistical tests when small or very
™
describes patterns of missing data, estimates means
™
turns your geographically distributed data into high-quality maps with
iv
Page 5
Compatibility
The SPSS Base 11.5 system is designed to operate on computer systems running
Windows 98, Windows 2000, Windows Me, or Windows NT 4.0.
Serial Numbers
Your serial number is your identification number with SPSS Inc. You will need this
serial number when you contact SPSS I nc. for information regardi ng support, payment,
or an upgraded system. The serial number was provided with your Base system. Before
using the system, please copy this number to the registration card.
Registration Card
Don’t put it off: fill out and send us your registration card. Until we receive your
registration card, you ha v e an un regi ster ed system. Ev en if you have previously sent a
card to us, please fill out and return the card enclosed in your Base system package.
Registering your system entitles you to:
n Technical support services
n New product announcements and upgrade announcements
Customer Service
If you have any questions concerning your shipment or accoun t, contact your local office,
listed on page vii. Please hav e your serial n umber ready for i dentification when calling.
Training Seminars
SPSS Inc. provides both public and onsite training seminars for SPSS. All seminars
feature hands-on workshops. SPSS seminars will be offered in major U.S. and
European cities on a regular basis. For more information on these seminars, call your
local office, l i sted on pa ge vii .
v
Page 6
Technical Support
The services of SPSS T ech nical Support a re av ailable to registered cust omers of SPSS.
Customers may contact T echn ical Support for assistance in using SPSS products or for
installation help for one of the supported h ard ware environments. To reach Te chnical
Support, see the SPSS W e b site at http://www.spss.com, or call your local office, listed
on page vii. Be prepared to identify yourself, your organization, and the serial number
of your system.
Additional Publications
Except for academic course adoption s, additional copies of SPSS product manual s may
be purchased directly from SPSS Inc. Vi sit our W eb site at http://www.spss.com/estore,
or contact your local SPSS office, listed on page vii.
SPSS product manuals may also be purchased from Prentice Hall, the exclusive
distributor of SPSS pu blications. To or der, fill out and mail the Publications orde r form
included with your system, or call 800- 947-7700. I f you repres ent a booksto re or have
an account with Prentice Hall, call 800-382-3419. In Canada, call 800-567-3800.
Outside of North America, contact your local Prentice Hall office.
Statistical introductions to procedures in the Base, Regress io n Models, and
Advanced Models written by Marija Norusis a re planned to be available from
v
Prentice Hall. Check with the publisher or visit the SPSS Web site for announcements
regarding availability.
Tell Us Your Thoughts
Your comments are important. Please let us know about your experiences with SPSS
products. W e especially like to hear about new and interesting applications using the
SPSS system. Pl ease send e-mail to [email protected], or write to SPSS Inc., Attn:
Director of Product Planning , 233 South Wacker Drive, 11th Floor, Chicago, IL
60606-6412.
Contacting SPSS
If you would like to b e on our mailing list, con tact one of our of fic es, lis ted on p age vii,
or visit our W eb site at http://www.spss.com. We will send you a copy of our newsletter
and let you know about SPSS Inc. activities in your area.
vi
Page 7
SPSS Inc.
Chicago, Illinois, U.S.A.
Tel: 1.312.651.3000
or 1.800.543.2185
www.spss.com/corpinfo
Content and Format of the Text File for Customized HTML . . . . 586
To Use a Different File or Location for Custom HTML Code . . . . 586
Index589
xxx
Page 31
Overview
SPSS for Windows provides a powerful statistical analysis and data management
system in a graphical e nvironment, 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.
Chapter
1
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 include d as st andard featu res in
SPSS.
Database access. Retrie v e i nformat ion fr om dat abases b y u sin g the Dat abase Wizard
instead of complicated SQL queries.
1
Page 32
2
Chapter 1
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 wi th the click of a b utton, or exp ort
tables and charts in HTML format for Internet and intranet distribution.
Online Help. Detailed tutorials provide a comprehensive overview; context-sensitive
Help topics in dialog boxes guide you through specific tasks; pop-up definitions in
pivot table results explain statistical terms; the Sta tistics Coach helps you find the
procedures that you need; and Case Studie s provi de hands-on e xampl es of ho w to use
statistical proced ures and interpret the results.
What’s New in SPSS 11.5?
There are a number of new features in SPSS 11.5.
New data definition tools. Two new features make defining data faster and easier:
n The Copy Data Properti es wizard pr ovides the abi lity to use an externa l SPSS data
file as a template for defini ng f i le an d var iabl e pr oper t ie s in the worki ng data file.
You can also use variables in the working data file as templates for other variables
in the working data fil e. Copy Data Pr operties is av ailable o n the Data menu in the
Data Editor window. For more information, see “Copying Data Properties” in the
chapter Data Preparation.
n Define Variable Propertie s (also available on the Data menu in the Data Editor
window) scans your data and li sts all uniq ue data values for an y selected variables,
identifies unlabeled values , and pr ovides an auto-l abel feature . This i s particul arly
useful for categorical variables that use numeric cod es to represent categories—for
example, 0 = Male, 1 = Female. For more information, see “Defining Variable
Properties” in the chapter Data Preparation.
Expanded support for SAS format data files. You can now sav e data f iles in SAS version 6,
SAS version 7, and SAS Tr ansport f ile format. Fo r more information, see “Sa ving Data:
Data File Types” in the chapter Data Files.
Expanded output export capabilities. You can now export entire Viewer documents or
selected output objects in Word/RTF format and Excel format (charts are not included
in Excel format). For more information, see “Export Output” in the chapter Working with Output.
Page 33
Overview
Multiple output languages. You can now produce pivot table output in different
languages and switch languages during the same session. For more information, see
“General Options” in the chapter Options.
TwoStep Cluster Analysis. This new clustering procedure offers the following features
not available in the other SPSS clustering procedures:
n Automatic s election of th e best number of clusters, in addition to me asures for
choosing between cluster models.
n Ability to create cluster models simultaneously based on categorical and
continuous variables.
n Ability to save the cluster model to an external XML file, then re ad that file and
update the cluster model using newer data.
n Ability to analyze large data files with a single clustering procedure.
For more information, see the chapter TwoStep Cluster Analysis.
New Custom Tables option. If you have used the Tables option in the past, you will
discover that almost everything is new in this release, including:
3
n A simple, drag-and-drop table builder interface that allows you to preview your
table as you select variables and options.
n A single, unified table builder interface instead of multiple menu choices and
dialog boxes for different types of tables.
n Subtotals for subsets of categories of a categorical variable.
n Custom control over category display order and ability to selectively show or hid e
categories.
Note: Custom Tables is not included in the SPSS Base system. It is only available if
you have purchased the Tables add-on option.
Page 34
4
Chapter 1
Windows
There are a number of different types of windows in SPSS:
Data Editor. This windo w displays the cont ents of the data f ile. You can create ne w 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 dat a 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 V ie wer windo w opens automatically the f irst
time you run a procedure that generates output.
Draft Viewer. You can display output as simple text (ins tead of interact iv e pi vot 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
T ext Output Ed itor . You can edit th e output and change font characteristi cs (type, style,
color, size).
Syntax Editor. You can paste your dialog box choi ces into a syntax wi ndow, where your
selections appear in the form of command syntax. You can then edit the command
syntax to use special features of SP SS not av ailable through dialog box es. Y ou can sa ve
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.
Page 35
Figure 1-1
Data Editor and Viewer
5
Overview
Designated versus Active Window
If you have more than one open Viewer window, output is routed to the designated
Viewer window. If you have more than one open Syntax Editor window, command
syntax is pasted into the designated Syntax Editor window. The designated windows
are indicated by an exclamation point (!) in the status bar. You can change the
designated windows at any time.
The designated window should not be confused with the active window, which is
the currently selected window. If you have overlapping windows, the active window
appears in the foreground. If you open a new Syntax Editor or Viewer window, that
window automatically becomes the active window and the designated window.
Page 36
6
Chapter 1
Changing the Designated Window
Make the window that you want to designate th e active window (cl ick anywhere in t he
window).
Click the Designate Window tool on the tool bar (the one with th e exclamati on poin t).
or
From the menus choose:
Utilities
Designate Window
Figure 1-2
Designate Window tool
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.
generate new output without having to switch windows.
Toolbars
Each SPSS window has its own toolbar that provides quick, easy access to common
tasks. Some windows ha v e more than one toolbar. T oolT ips p rovide a br ief description
of each tool when you put the mouse pointer on the tool.
Figure 1-3
Toolbar with ToolTip Help
The Analyze and Graphs menus are available on all windows, making it easy to
Page 37
You can control the display of toolbars in several ways:
n Show or hide toolbars.
n Display toolbars verti cally or horizont ally, attached to t he left, right, t op, or bottom
of the window.
n Display toolbars as floating palettes anywhere inside or outside of the window.
n Customize toolbars to contain the features that you use most often, including
scripts.
Showing and Hiding Toolbars
From the menus choose:
View
Toolbars...
In the Show Toolbars dialog box, select the toolbars that you want to show (or hide).
Moving Toolbars
7
Overview
Click anywhere in the toolbar outside of the toolbar buttons.
Drag the toolbar to where you want it.
n Dragging the toolbar to the left or right side of the window attaches a toolbar
vertically to that side.
n Dragging the toolbar to the top or bottom of the window attaches the toolbar
horizontally.
n Dragging the toolbar an ywher e ot her t han t he wind ow borders creates a detached,
floating toolbar.
Page 38
8
Chapter 1
Figure 1-4
Floating toolbars
Status Bar
The status bar at the bottom of each SPSS window pro vides the following informati on:
Command status. For each procedure or command that you run, a case counter indicat es
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 rand om sample or a subset of cases for analysis, t he
message
all cases in the data file are included in the analysis.
Filter on indicates that some type of case filtering is curren tly in effect and not
Page 39
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.
Showing and Hiding the Status Bar
From the menus choose:
View
Status Bar
Dialog Boxes
Most menu selections open dial og box es. You use d ialog boxes to select variables and
options for analysis.
Each main dialog box for statistical procedures and charts has several basic
components:
9
Overview
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.
Command pushbuttons. Buttons that instruct the program to perform an action, such as
run the procedure, display Help, or open a subdialog box to make additional
specifications.
For informatio n on i ndividual controls in a dialo g box, click the control with the right
mouse button.
Page 40
10
Chapter 1
Figure 1-5
Dialog box controls
Variable Names and Variable Labels in Dialog Box Lists
You can display either variable names or variable labels in dialog box lists. Since
variable names are limited to eight characters, variable labels often provide more
descriptive information.
n To control the display of variable names or labels, choose Options from the Edit
menu in any window.
n To define or modify variable labels, use Variable View in the Data Editor.
n For data imported from database sources, field names are used as variable labels.
n For long labels, position the mouse pointer over the label in the list to view the
entire label.
n If no variable label is defined, the variable name is displayed.
Page 41
Figure 1-6
Variable labels displayed in a dialog box
Dialog Box Pushbuttons
There are five standard command pushbuttons in most dialog boxes:
11
Overview
OK. Runs the procedure. After you select your variables and choose any additional
specifications, click
OK to run the procedure. This also closes the dialog box.
Paste. Generates command syntax from the dialo g box selections and past es the syntax
into a syntax window. You can then customize the commands with addit ional fea tures
not availab le fro m dialo g box es.
Reset. Deselects any variables in the selected variable list(s) and resets all
specifications in the dialog box and any subdialog boxes to the default state.
Cancel. Cancels any changes in the di alog box settings since t he last time it was open ed
and closes the dialog bo x. W ithin a session, dialog box settings are pers istent. A dia log
box retains your last set of specifications until you override them.
Help. Context-sensiti ve Help. This t akes you to a standard Microso ft Help windo w that
contains information about th e current dia log box. You can also get help on indi vidual
dialog box controls by clicking the control with the right mouse button.
Page 42
12
Chapter 1
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 requi red to ru n a procedure. Additional speci f ications ar e made
in subdialog boxes.
In the main dialog box, pushbutt ons with an ellipsis (. ..) after the name indicate t hat
a subdialog box will be displayed.
Selecting Variables
T o select a sin gle v ari able, y ou simpl y high light i t on t he source variable list and click
the right arro w but ton ne xt to the tar get v aria ble list . If there i s only one tar get v ariab le
list, you can double-click ind i vidual v ariables to move t hem from the source li st to the
target list.
You can also select multiple variables:
n To select multiple variables that are grouped together on the variable list, click the
first one and then Shift-click the last one in the group.
n To select multiple varia bles that are not grouped together on the variable list, use
the Ctrl-click method. Click the first variable, then Ctrl-click the next variable, and
so on.
n To select all variables in the list, press Ctrl-A.
Page 43
Getting Information about Variables in Dialog Boxes
Left-click a variable in a list to select it.
Right-click anywhere in the list.
Select Variable Information in the pop-up context menu.
Figure 1-7
Variable information with the right mouse button
13
Overview
Getting Information about Dialog Box Controls
Right-click the control you want to know about.
Select What’s This? on the pop-up context menu.
A pop-up window displays information about the control.
Page 44
14
Chapter 1
Figure 1-8
Right mouse button “What’s This?” pop-up Help for dialog box controls
Basic Steps in Data Analysis
Analyzing data with SPSS is easy. All you have to do is:
Get your data into SPSS. You can open a previously saved SPSS data file; read a
spreadsheet, database, or text data file; or enter your data directly in the Data Editor.
Select a procedure. Se lect a procedure from the menus to calcul ate statistics or to create
a chart.
Select the variables for the analysis. The variables in the data file are displayed in a
dialog box for the procedure.
Run the procedure and look at the results. Results are displayed in the Viewer.
Page 45
Statistics Coach
If you are unfamiliar with S PSS or with the statistical proce dures available in SPSS,
the Statistics Coach can help you get st arte d by pr ompting yo u with simp le questi ons,
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.
Finding Out More about SPSS
For a comprehensiv e ov ervie w of SPSS basics, see t he online tutorial. From an y SPSS
menu choose:
Help
Tutorial
15
Overview
Page 46
Page 47
Getting Help
Online Help is provided in several ways:
Help menu. Every windo w has a Help menu on the menu bar. Topics provides access
to the Contents and I ndex tabs, which you can u se to find specif ic Help topic s.
provides access to the introductory tutorial.
Chapter
2
Tutorial
Dialog box context menu Help. Right-click on any control in a dialog box and select
What’s This? from the context menu to display a description of the control and
directions for its use.
Dialog box Help buttons. Most dial og box es h a v e a Hel p b utt on th at t akes y ou dir ectl y
to a Help topic for that dialog box. The Help topic provides general information and
links to related topics.
Pivot table context menu Help. Right-click on te rm s in an activated pivot table in the
Viewer and select
terms.
Case Studies. The Case Studies item on the Help menu in the Viewer wind ow
provides hands-on e xamples of ho w to cr eate var ious types of sta tistical an alyses and
how to interpret the results. The sample data files used in the examples are also
provided so you can work through the examples to see exactly how the results were
produced.
Tut or ia l. Select Tutorial on the Help menu in any window to access the online
introductory tutoria l.
CD-ROM Syntax Reference Guide. Detailed syntax reference information is available
online with the CD-ROM version. The SPSS Syntax Refer ence Guide is av ailable from
the Help menu. If you did not install the SPSS Syntax Reference Guide when you
What’s This? from the context menu to display definitions of the
17
Page 48
18
Chapter 2
installed this software, you will need the CD-ROM to access it. (It is no t av ailable with
some versions.) To install the SPSS Syntax Reference Guide, in the Setup program
select
Custom for the type of installation and then select Syntax Guide.
Note: The Help system requires Internet Explorer 5 or later, and the SPSS Syntax
Reference Guide requires Adobe Acrobat. I nstal lable ve rsion s of both are pro vided on
the CD.
Using the Help Table of Contents
In any windo w, from the me nus choose:
Help
Topics
Click the Contents tab.
Double-click items with a book icon to expand or collapse the contents.
Click an item to go to that Help topic.
Figure 2-1
Help window with Contents tab displayed
Page 49
Using the Help Index
In any window, from the menus choose:
Help
Topics
Click the Index tab.
Enter a term to search for in the index.
Double-click the topic that you want.
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
19
Getting Help
Page 50
20
Chapter 2
Getting Help on Dialog Box Controls
Right-click on the dialog box control that you want information about.
Choose What’s This? from the pop-up context menu.
A description of the contro l and how to use it is displayed i n a pop-up windo w . General
information about a dialog box is available from the Help button in the dialog box.
Figure 2-3
Dialog box control Help with right mouse button
Getting Help on Output Terms
Double-click the pivot table to activate it.
Right-click on the term that you want to be explained.
Choose What’s This? from the context menu.
A definition of the term is displayed in a pop-up window.
Page 51
Figure 2-4
Activated pivot table glossary Help with right mouse button
21
Getting Help
Using Case Studies
Right-click on a pivot ta ble in the Viewer window.
Choose Case Studies from the pop-up context menu.
Copying Help Text from a Pop-Up Window
Right-click anywhere in the pop-up window.
Choose Copy from the context menu.
The entire text of the pop-up window is copied.
Page 52
Page 53
Data Files
Data files come in a wide variety of formats, and this software is designed to handle
many of them, including:
n Spreadsheets created with Lotus 1-2-3 and Excel
n Database files created with dBASE and various SQL formats
n Tab-delimited and other types of ASCII text files
n Data files in SPSS format created on other operating systems
n SYSTAT data files
n SAS data files
Chapter
3
Opening a Data File
In addition to files saved in SPSS format, you can open Excel, Lotus 1-2-3, dBASE,
and tab-delimited files without converting the files to an intermediate format or
entering data definition information.
To Open Data Files
From the menus choose:
File
Open
Data...
In the Open File dialog box, select the file that you want to open.
Click Open.
23
Page 54
24
Chapter 3
Optionally, you can:
n Read variable names from the first row for spreadsheet and tab-delimited files.
n Specify a range of cells to read for spreadsheet files.
n Specify a sheet within an Excel file to read (Excel 5 or later).
Data File Types
SPSS. Opens data files saved in SPSS format, including SPSS for Windows,
Macintosh, UNIX, and also the DOS product SPSS/PC+.
SPSS/PC+. Opens SPSS/PC+ data files.
SYSTAT. Opens SYSTAT data files.
SPSS Portable. Opens data files saved in SPSS portable format. Saving a file in portable
format takes considerably longer than saving the file in SPSS format.
Excel. Opens Excel files.
Lotus 1-2-3. Opens data files sav ed in 1-2-3 for mat for release 3.0, 2.0, or 1A of Lotus.
SYLK. Opens data fi les saved in SYLK (symbolic link) format, a format used by some
spreadsheet applications.
dBASE. Opens dBASE-format files for either dBASE IV, dBASE III or III PLUS, or
dBASE II. Each case is a record. Variable and value labels and missing-value
specifications are lost when you save a file in this format.
SAS Long File Name. SAS version 7-8 for Windows, long extension.
SAS Short File Name. SAS version 7-8 for Windows, short extension.
SAS v6 for Windows. SAS version 6.08 for Windows and OS2.
SAS v6 for UNIX. SAS version 6 for UNIX (Sun, HP, IBM).
SAS Transport. SAS transport file.
Tex t. ASCII text file.
Page 55
Opening File Options
Read variable names. For sprea dsheets, you can read v ariable names from the f irst ro w
of the file or the first row of the defined range. If the names are longer than eight
characters, they are truncated. If the first eight characters do not create a unique
variable name, the name is modified to create a unique variable name.
Worksheet. Excel 5 or later files can contain multiple worksheets. By default, the Data
Editor reads the first worksheet. To read a different worksheet, select the worksheet
from the drop-down list.
Range. For spreadsheet data files, you can also read a range of cells. Use the same
method for specifying cell ranges as you would with the spreadsheet application.
How the Data Editor Reads Excel 5 or Later Files
The following rules apply to reading Excel 5 or later files:
Data type and width. Each column is a variable. The data type and width for each
variable is determined by the da ta type and width in the Excel file. If the column
contains more than one dat a ty pe ( for example, date and numeric), the data ty pe i s set
to string, and all values are read as valid string values.
25
Data Files
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 read the first row of the Excel file (or the first row of the
specified range) as variable names, names longer than eight characters are truncated,
non-unique names are converted to unique ones, and the original names are used as
variable labe ls. If yo u do n ot 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
Page 56
26
Chapter 3
are conv erted t o the syste m-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, th e software uses the column
number preceded by the letter C for variable names (C1, C2, C3, ...).
How the Data Editor Reads dBASE Files
Database files are logically very similar to SPSS-format data files. The following
general rules apply to dBASE files:
n Field names are automatically translated to variable names.
n Field names should comply with variable naming conventions for SPSS format.
Field names longer than eight charact ers are t runc ate d. If the fi rst ei ght cha racte rs
of the field name do not produce a unique name, the field is dropped.
n Colons used in dBASE field names are translated to underscores.
n Records marked for deletion but not actually purged are included. The software
creates a new string variable, D_R, which contains an asterisk for cases marked for
deletion.
Reading Database Files
You can read data from any database format for which you have a database driver. In
local analysis mode, the necessary driv ers must be installed on your local comput er . In
distributed analysis mode (available with the server version), the drivers must be
installed on the remote server. For more information about distributed analysis, see
Chapter 4.
Page 57
Data Files
To Read Database Files
From the menus choose:
File
Open Database
New Query…
Select the data source.
Depending on the data source, you may need to select the database file and/or enter a
login name, password, and other information.
Select the table(s) and fields.
Specify any relationships between your tables.
Optionally, you can:
n Specify any selection criteria for your data.
n Add a prompt for user input to create a parameter query.
n Define any variable attri butes.
n Save the query you have constructed before running it.
27
To Edit a Saved Database Query
From the menus choose:
File
Open Database
Edit Query…
Select the query file (*.spq) that you want to edit.
Follow the instructions for creating a new query.
Page 58
28
Chapter 3
To Read Database Files with a Saved Query
From the menus choose:
File
Open Database
Run Query…
Select the query file (*.spq) that you want to run.
Depending on the database file, you may need to enter a login name and password.
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).
Selecting a Data Source
Use the first dia log box to select the t ype of data source to r ead into the software. After
you have chosen the file type, the Database Wizard may prompt you for the path to
your data file.
If you do not have any data sources configured, or if you want to add a new data
source, click
version), this button is not avail able. To add data sources in distributed anal ysis mode,
see your system administrator.
Add Data Source. In distributed analysis mode (available with the server
Data sources. A data source consists of two essen tial pi eces of i nformation: the d river
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:
n SPSS Data Access Pack. Installs drivers for a variety of dat abase formats. Available
on the AutoPlay menu.
n Microsoft Data Access Pack. Installs drivers for Microsoft products, including
Microsoft Access. To install the Microsoft Data Access Pack, double-click
Data Access Pack
in the Microsoft Data Access Pack folder on the CD-ROM.
Microsoft
Page 59
Figure 3-1
Database Wizard dialog box
29
Data Files
Example. Let’s say you have a Microsoft Access 7.0 dat abase that con tains dat a abo ut
your employees and about t he regions i n which they w ork, and you w ant to import th at
data. Select the
the Select Database dialog box. Specify the path to your database and click
MS Access 7.0 Database icon, and click Next to proceed. You will see
OK.
Page 60
30
Chapter 3
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
Selecting Data Fields
This dialog box controls which tables and fields are read into the software. Database
fields (columns) are read as variables.
If a table has any field(s) selected, all of its fields will be visible in the following
Database Wizard windows, but only those fields selected in this dialo g box will be
imported as variables. This enables you to create table joins and to specify criteria
using fields that you are not importing.
Page 61
Figure 3-3
Select Data dialog box
31
Data Files
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 o f a table name.
To add a field. Double-click any field in the Available Tables list, or dr ag 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
alphabeti cal order.
Example. Assume that you want to import from a datab ase with t wo tabl es, Emplo yees
and Regions. The Employees table contains information about your company’s
employees, including t he region they work in, their job category , and their annual sales.
Page 62
32
Chapter 3
Employees are each assigned a reg ion code (REGION), while th ose who do no t ha ve a
home region get the special code of 0. The Re gi ons 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 av erage per capita income
for the area, among other things. To relate each employee’s sales to the a verage 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
Creating a Relationship between Tables
This dialog box allo ws you to define the relationships bet ween the tables. If fields from
more than one table are selected, you must define at least one join.
Figure 3-4
Specify Relationships dialog box
Next to proceed.
Page 63
Establishing relationships. To create a relationship, drag a f ield from an y table onto the
field to which you want to join it. The Database Wizard will draw a join line between
the two fields, indicat ing their relationship. These f ields must be of t he same data type.
Auto Join Tables. Attempts to automatically join tables based on pri mary/ f ore ign 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. T o select the type of join, click the join line
between the fields, and the software will display the Relationship Properties dialog box.
Y ou can al so use the icons in the upper right corne r of the dialog box to choose t he 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
33
Data Files
Inner joins. An inner join includes only rows where the related fields are equal.
Example. Continuing with our data, suppo se 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.
Page 64
34
Chapter 3
Completing this would give you a data set t hat contains the vari ables 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 includ e s al l records from the table on the left and only
those records from the table on t he right in whi ch the related fiel ds are equal . In a right
outer join, this relationship is switched, so that the software imports all records from
the table on the righ t and only those records fro m the table on the left in whic h 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 ou ter joi n woul d be appr opriat e. This results i n a data set th at c ontains
the var ia bl es 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.
Page 65
Figure 3-7
Creating a right outer join
35
Data Files
Limiting Retrieved Cases
The Limit Retrieved Cases dialog box allows you to specify the criteria to select
subsets of cases (rows). Limiting cases generally consists of filling the criteria grid
with one or more criteria. Criteria consist of two expressions and some relation
between them. They return a value of true, false, or missing for each case.
n If the result is true, the case is selected.
n If the result is false or missing, the case is not selected.
n Most criteria use one or more of the six relational operators (<, >, <=, >=, =, and <>).
n Expressions can include fie ld names, constants, a rithmet ic ope rators, numeri c and
other functions, and logical variables. You can use fields that you do not plan to
import as variables.
Page 66
36
Chapter 3
Figure 3-8
Limit Retrieved Cases dialog box
T o bu ild your criter ia, you need at least tw o expressio ns and a relation t o connect them.
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.
The two expressions a re usu ally connect ed by a rel ational oper ator, such as = or >. To
choose the relation, put your cursor in the R elati on cell and eit her type t he operat or or
select it from the drop-down menu.
Page 67
37
Data Files
To mod ify our earlier example to ret r ieve 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 v alid SQL function. See your da tabase documentation
for valid SQL functions.
Use Random Sampling. Selects a random sample of cases from the data source. For lar ge
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 proced ures. Native
random sampling, if available for the data so urce, is faster than SPSS random
sampling, since SPSS random sampling must still read the ent ire data source to extr act
a random sample.
Prompt for Value. Y ou c an embed a p rompt in you r query to create a param eter query.
When users run the query , th e y will be ask ed t o enter informati on specified here. You
might want to do this if you need to see dif ferent view s of the same data. For e xample,
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
Creating a Parameter Query
Prompt for Value to create a prompt.
Use the Prompt for Value dialog box to create a dialog box that solicits information
from users each time someone runs your query. It is useful if you want to query the
same data source using different criteria.
Page 68
38
Chapter 3
Figure 3-9
Prompt for Value dialog box
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 giv e hints about
how the input should be formatted. For example, “Enter a Quarte r (Q1, Q2, Q3, …):”.
Allow user to select value from list. If this is selected, you can limit the user to the v alues
you place here, which are separated by carriage returns.
Data type. Specify the data type here, either number, string, or date.
The final result looks like this:
Figure 3-10
User-defined prompt dialog box
Page 69
Defining Variables
Variable names and labels. The complete database field (column) name is used as the
variable label. Unless you modify the variable name, the Database Wizard assigns
variable names to each column from the database in one of two ways:
n If the name of the database field (or the first eight cha racters) forms a valid, unique
variable name, it is used as the variable name.
n If the name of the database field does not form a valid, unique variable name, the
software creates a unique name.
Click any cell to edit the variable nam e.
Converting strings to numeric values. Check the Value Labels box for a string variable if
you want to automatically con v ert it to a numeric v ariable. String values are converted
to consecutive integer values based on alphabetic order of the original values. The
original values are retained as value labels for the new variables.
39
Data Files
Page 70
40
Chapter 3
Figure 3-11
Define Variables dialog box
Results
The Results dialog box displays the SQL Select statement for your query.
n You can edit the SQL Select statement before you run the query, but if you click
Back button to make changes in previous steps, the changes to the Select
the
statement will be lost.
n You can save the query for future use with Save query to a file.
n Select Paste it into the syntax editor for further modification to paste complete GET
DATA syntax into a syntax window. Copying and pa sting the Select statemen t from
the Results window will not paste the necessary command syntax.
Page 71
Figure 3-12
Results dialog box
41
Data Files
Reading Text Data Files
The Text Wizard can read text data files formatted in a variety of ways:
n Tab-delimited files
n Space-delimited files
n Comma-delimited files
n Fixed-field format files
For delimited fi les, you can also specify other characters as delim iters between v alues,
and you can specify multiple delimiters.
Page 72
42
Chapter 3
To Read Text Data Files
From the menus choose:
File
Read Text Data
Select the text file in the Open dialog box.
Follow the steps in the Text Wizard to define how to read the data file.
Text Wizard Step 1
Figure 3-13
Text Wizard Step 1
Page 73
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.
Text Wizard Step 2
Figure 3-14
Text Wizard Step 2
43
Data Files
This step provides information about variables. A variable is similar to a field in a
database. For example, each item in a questionnaire is a variable.
How are your variables arranged? T o read yo ur data p roperl y, the T ext Wizard needs to
know how to determine where the data value for one variable ends and the data value
for the next variable begins. The arrangement of variables defines the method used to
differentiate one variable from the next.
Page 74
44
Chapter 3
Delimited. Spaces, commas, tabs, or other characters are used to sep arate variables.
n
The variables are recorded in the same order for each case but not necessarily in
the same column locations.
n Fixed width. Each variable is recorded in the same column location on the same
record (line) for each case in the data file. No delimiter is required between
variables. In fact, in many text data files generated by computer programs, data
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. If the labels are longer tha n eight characters, they a re truncated. If the f irst eight
characters do not create a unique variable name, the name is modified to create a
unique variable name.
Text Wizard Step 3: Delimited Files
Figure 3-15
Text Wizard Step 3 for delimited files
Page 75
45
Data Files
This step provides informatio n about cases. A case is similar to a record in a database.
For example, each respondent to a 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 val ues. If the top line (s) of the data f ile cont ain descri pti v e lab els or
other text that does not repre s e nt data values, this will not be line 1.
How are your cases represented? Controls how the Text W izard det ermines where eac h
case ends and the next one begins.
n 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 variabl es. If not all lines cont ain 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.
n 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 o n t he numb er of v alues 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? Y ou 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 routin e makes an independent pseu do-random decision for
each case, the percentage of cases selected can only approximate the specified
percentage. The more cases there are in the data f ile, the closer the percentag e of cases
selected is to the specified percentage.
Page 76
46
Chapter 3
Text Wizard Step 3: Fixed-Width Files
Figure 3-16
Text Wizard Step 3 for fixed-width files
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 val ues. If the top line (s) of the data f ile contain descri ptive 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 T ext W izard 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 n eed to speci fy the number of lines for ea ch case
to read the data correctly.
How many cases do you want to import? You can import all cases in the data file, the f irst
n cases (n is a number you specify), or a random sample of a specified percentage.
Since the random sampling routin e makes an independent pseudo-r andom decision for
Page 77
each case, the percentage of cases selected can only approximate the specified
percentage. The more cases there are in the data f ile, the closer the percentag e of cases
selected is to the specified percentage.
Text Wizard Step 4: Delimited Files
Figure 3-17
Text Wizard Step 4 for delimited files
47
Data Files
This step displays the Text Wi zard’s best guess on ho w to read the data f i le and allo ws
you to modify how the Text Wizard will read variables from the data file.
Which delimiters appear between variables? Indicates the characters or symbols that
separate data values. You c an select any combination of spaces, commas, semico lons,
tabs, or other chara ct ers. Multiple, consecutive delimiters without in tervening data
values are treated as missing values.
Page 78
48
Chapter 3
What is the text qualifier? Characters used to enclose values that contain delimiter
characters. For example, if a comma is the del i miter, 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 bet ween values. CSV-format
data files expor ted from Ex cel use a doubl e quo tat i on mark ( ") as a te xt qualifier. The
text qualifier appears at both the beginning and the end of the value, enclosing the
entire value.
Text Wizard Step 4: Fixed-Width Files
Figure 3-18
Text Wizard Step 4 for fixed-width files
This step displays the T e xt W izard’s best guess on how to read the data file and allo ws
you to modify ho w the Text Wi zard will read v ariables from the data f ile. Vertical line s
in the preview window indicate where the Text Wizard currently thinks each variable
begins in the file .
Page 79
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
difficu lt to determine where each variable be gins. Such da ta files usual ly rely on a data
definition file or some other written description that specifies the line and column
location for each variable.
Text Wizard Step 5
Figure 3-19
Text Wizard Step 5
49
Data Files
This steps controls the vari able name and t he data format that the Text W izard will use
to read each variable and which variables will be included in the final data file.
Page 80
50
Chapter 3
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 are longer than eight characters or are not
unique. Select a variable in the preview window and then enter a variable name.
Variable names cannot exceed eight characters, cannot start with a number or the
pound sign (#), and cannot contain spaces.
Data format. Select a variable in the p re vie w wi ndo w and then select a fo rmat from the
drop-down list. Shift- click to select multiple contiguous v ariables or Ctrl-click to select
multiple noncontiguous variables.
Text Wizard Data Formatting Options
Formatting options for reading variables with the Text Wizard include:
Do not import. Omit the sele cted 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 sele cted v ariable(s). F or f ix ed-width f il es, the
number of characters in string values is def ined 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 numeral s, or three-letter abbr evia tions, 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. V ali d values inclu de numbers that use a comma as a decimal indicator and periods
as thousands separators.
Page 81
Note: Values that contain invalid characters for the selected format will be treated as
missing. Values that contain any of t he sp eci f i ed d el imit ers will be t reat ed as mul tipl e
values.
Text Wizard Step 6
Figure 3-20
Text Wizard Step 6
51
Data Files
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 synt ax ge ner ated by
the Text Wizard into a syntax window. You can then customize and/or sa ve the syntax
for use in other sessions or in production jobs.
Page 82
52
Chapter 3
File Information
A data file contains much more than raw data. It also contains any variable definition
information, including:
n Variable names
n Variable formats
n Descriptive variable a nd value labels
This information is stored in the dictionary portion of t he 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.
Obtaining Data File Information
For the working data file, from the menus choose:
Utilities
File Info
For other data files, from the menus choose:
File
Display Data Info...
Select a file from the Display Data Info dialog box.
The data file information is displa yed in the Viewer.
Saving Data Files
Any changes that you make in a data file last only for the duration of the current
session—unless yo u explicitly save the changes.
Make the Data Editor the active window (click anywhere in the window to make
it active).
From the menus choose:
File
Save
The modified data file is saved, overwriting the previous version of the file.
Page 83
Saving Data Files in Excel Format
You can save your data in one of three Microsoft Excel file formats. The choice of
format depends on the version of Excel that will be used to open the data. The Excel
application cannot open an Excel file from a newer version of the application. For
example, Excel 5.0 cannot open an Excel 2000 document. However, Excel 2000 can
easily read an Excel 5.0 document.
There are a few limitations to the Excel file format that don’t exist in SPSS. These
limitations incl ude:
n Variable information, such as missing values and variable labels, is not included in
exported Excel files.
n When exporting to Exc el 97 and lat er, an optio n is provided to include val ue labels
instead of values.
n Because all Excel files are limited to 256 columns of data, only the first 256
variables are included in the exported file.
n Excel 4.0 and Excel 5.0/95 files are limited to 16,384 records, or rows of data.
Excel 97-2000 files allow 65,536 records. If your data exceed these limits, a
warning message is displayed and the data are truncated to the maximum size
allowed by Excel.
53
Data Files
Variable Types
The following table shows the variable type matching between th e original data in
SPSS and the exported data in Excel.
Special handling is given to various aspects of your data when saved as a SAS file.
These cases include:
n Certain characters that are allowed in SPSS variable names are not valid in SAS,
such as @, #, and $. These illegal characters are replaced with an underscore when
the data are exported.
n SPSS variable labels containing more than 40 characters are truncated when
exported to a SAS v6 file.
n Where they exist, SPSS variable labels are mapped to the SAS variable labels. If
no variable label exists in the SPSS data, the variable name is mapped to the SAS
variable label.
n SAS allows only one value for system-missing, whereas SPSS allows numerous
system-missing values. As a result, all system-missing values in SPSS are mapped
to a single system-missing value in the SAS file.
Save Value Labels
Y ou hav e the opti on of savi ng the v alues and v alue lab els associated with your data f ile
to a SAS syntax file. For example, when the value labels for the cars.sav data file are
exported, the generated syntax file contains:
libname library ’d:\spss\’ ;
proc format library = library ;
value ORIGIN /* Country of Origin */
1 = ’American’
2 = ’European’
3 = ’Japanese’ ;
value CYLINDER /* Number of Cylinders */
3 = ’3 Cylinders’
4 = ’4 Cylinders’
5 = ’5 Cylinders’
6 = ’6 Cylinders’
8 = ’8 Cylinders’ ;
Page 85
Data Files
value FILTER__ /* cylrec=1|cylrec = 2 (FILTER) */
0=’Not Selected’
1=’Selected’ ;
proc datasets library = library ;
modify cars;
formatORIGIN ORIGIN.;
format CYLINDER CYLINDER.;
format FILTER__ FILTER__.;
quit;
This feature is not supported for the SAS transport file.
Variable Types
The following table shows the variable type matching between th e original data in
SPSS and the exported data in SAS:
55
SPSS Variable TypeSAS Variable TypeSAS Data Format
NumericNumeric12
CommaNumeric12
DotNumeric12
Scientific NotationNumeric12
DateNumeric(Date) for example, MMDDYY10, ...
Date (Time)NumericTime18
DollarNumeric12
Custom CurrencyNumeric12
StringCharacter$8
Saving Data Files in Other Formats
Make the Data Editor the acti ve window (click anywhere in the window to make it
active).
From the menus choose:
File
Save As...
Page 86
56
Chapter 3
Select a file type from the drop-down list.
Enter a filename for the new data file.
To write variable names to the first row of a spreadsheet or tab-delimit ed data file:
Click Write variable names to spreadsheet in the Save Data As dialog box.
To save value labels instead of data values in Excel 97 format:
Click Save value labels where defined instead of data values in the Save Data As
dialog box.
T o save value labels to a SAS syntax file (act ive only when a SAS f ile type is selected):
Click Save value labels into a .sas file in the Save Data As dialog box.
Saving Data: Data File Types
You can save data in the following formats:
SPSS (*.sav). SPSS format. Data files saved in SPSS format cannot be read by v ersions
of the software prior to version 7.5.
SPSS 7.0 (*.sav). SPSS 7.0 for Windows format. Data f iles saved i n SPSS 7.0 format can
be read by SPSS 7.0 and earlier versions of SPSS for Windows but do not include
defined multiple response sets or Data Entry for Windows information.
SPSS/PC+ (*.sys). SPSS/PC+ format. If the data file contains more than 500 variables,
only the first 500 will be sa ved. F or v ariables with more than on e 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 versions of SPSS on
other operating systems (for example, Macintosh or UNIX).
Tab-delimited (*.dat). ASCII text files with values separated by tabs.
Fixed ASCII (*.dat). ASCII text file in fixed format, using the default wr ite formats for
all variables. There are no tabs or spaces between variable fields.
Page 87
57
Data Files
Excel 2.1–4.0 (*.xls). Microsoft Excel 2.1 spreadsheet file. The maximum number of
variables is 256, and the maximum number of rows is 16,384.
Excel 5.0/95 (*.xls). Microsoft Excel 5.0/95 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 f il e. The maxi mum
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).
SAS v7+ Windows short extension (*.sd7). SAS version 7–8 for Windo ws short f ilena me
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.
Page 88
58
Chapter 3
Saving Subsets of Variables
Figure 3-21
Save Data As Variables dialog box
For data sav ed as an S PSS data f ile, t he Sa v e Dat a As Variabl es dia log box a llo ws 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.
To Save a Subset of Variables
Make the Data Editor the active window (click anywhere in the window to make it
active).
From the menus choose:
File
Save As...
Select SPSS (*.sav) from the list of fi le types.
Click Variables.
Select the variables that you want to save.
Page 89
Saving File Options
For spreadsheet and tab-delimited files, you can write variable names to the first row
of the file.
Virtual Active File
The virtual active file enables you to work with large data files without requiring
equally large (or larger) amounts of temporary disk space. For most analysis and
charting procedures, the original data source is re-read each time you run a different
procedure. Procedures tha t modify the data req uire a certain amount of temporary d isk
space to keep track of the changes, and some act ions alwa ys require enough disk sp ace
for at least one entire copy of the data file.
Figure 3-22
Temporary disk space requirements
Action
Virtual
Active
File
Data
Stored
in
Temporary
Disk
Space
GET FILE = 'v1-5.sav'.REGRESSION…or
FREQUENCIES… /SAVE ZPRED.
Actions that don’t require any temporary disk space include:
n Reading SPSS da ta files
n Merging two or more SPSS data files
n Reading database tab le s with the Database Wizard
n Merging an SPSS data file with a database table
n Running procedures that read data (for example, Frequencies, Crosstabs, Explore)
Page 90
60
Chapter 3
Actions that create one or more columns of data in temporary disk space include:
n Computing new variables
n Recoding existing variables
n Running procedures that create or modify v ariables (for example, saving pred icted
values in Linear Regression)
Actions that create an entire copy of the data file in temporary disk space include:
n Reading Excel files
n Reading text data files with the Text Wizard
n Running procedures that sort data (for example, Sort Cases, Split File, Report
Summaries in Rows/Columns)
n Reading data with GET TRANSLATE or DATA LIST commands
n Using the Cache Data facility or the CACHE command
n Launching other applications from SPSS that read the data file (for example,
AnswerTree, DecisionTime).
Note: The
GET DATA command provides functionality comparable to DATA LIST,
without creating an entire cop y of the data f ile in temporary di sk space. The
and
REPORT commands in command syntax do not sort the data file and therefore do
not create a copy of the data file. Both commands, however, require sorted data for
proper operation, and the dialog box interface for these procedu re s wil l aut omati cal ly
sort the data file, resulting in a complete copy of the data file.
Creating a Data Cache
Although the virtual active file can vastly reduce the amount of temporary disk space
required, the absence of a temporary copy of the “active” file means that the original
data source has to be re-read for each procedure. For data tables read from a database
source, this means the SQL query that reads the information from the database must be
re-executed for any command or procedur e that needs to read th e data. Since virtually
all statistical analysis procedures and charting procedures need to read the data, the
SQL query is re-ex ecute d for each pr ocedure you r un, which ca n result in a signif icant
increase in processing time if you run a large number of procedures.
SPLIT FILE
Page 91
If you have sufficient disk space on the computer performing the analysis (either
your local computer or a remote server), you can eliminate multiple SQL queries and
improve processing time by creating a data cache of the active file. The data cache is
a temporary copy of the complete data table.
To Create a Data Cache
From the menus choose:
File
Cache Data
Click OK or Cache Now.
OK creates a data cache the next time the p rogram reads the data (for examp le, the next
time you run a statistical procedure), which is usually what you want since it doesn’t
require an extra data pass.
shouldn’t be necessary under most circumstances.
Cache Now creates a data cache immediately, which
Cache Now is useful primarily for
two reasons:
61
Data Files
n 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.
n For large data sources, scrolling t hrou gh the con tents of t he Data view i n th e Data
Editor will be much faster if you cache the data.
Page 92
Page 93
Distributed Analysis Mode
Distributed analysis mode allows you to use a computer other than your local (or
desktop) computer to do memory-intensive work for you. 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 involve s :
n Large data files, particularly data read from database sources.
n Memory-intensive tasks. Any task that seems to take a long time i n local analysis
mode might be a good candidate for distributed analysis.
Chapter
4
Distributed analysis af fects only data-related tasks, such as reading da ta, 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 anal ysis is ava ilable only if you ha ve both a lo cal version and access
to a licensed server version of the software installed on a remote server.
Distributed versus Local Analysis
Following ar e some gui del i nes that yo u mi ght find useful for choosing distrib ut ed o r
local analysis mode:
Database access. Jobs that perform database queries may run faster in distributed
mode if the server has supe rior access to the database or if the server is running on the
same machine as the database engine. If the necessary database access software is
63
Page 94
64
Chapter 4
available only on the server, or if your network administrator does not permit you to
download lar ge da ta t abl es, yo u wil l be abl e to access t he dat abase onl y in distr i buted
mode.
Ratio of computation to output. Commands that perform a lot of computation and
produce small output results (for example, fe w and small pivo t tables, brief text results,
few or simple charts) have the most to gain from runn ing in distributed mode. The
degree of impro vement depends lar gel y on the co mputing po wer of the remote server.
Small jobs. Jobs that run quickly in local mode will almost always run slower in
distributed mode because of inherent client/server overhead.
Charts. Case-oriented charts, such as scatterplots, regression residual plots, and
sequence charts, require raw data on your local computer. For large data files or
database tables, this can result i n slower performance in distributed mode because the
data have to be sent from the remote server to your local computer. Other charts are
based on summarized or aggregated data and should perform adequately because the
aggregation is performed on the server.
Interactive graphics. Since it is possible to save raw data with interactive graphics (an
optional setting), thi s can result in large amounts of data bein g transferred from the
remote server to your local computer, significantly increasing the time it takes to save
your results.
Pivot tables. Large pivot tables may take longer to create in distributed mode. This is
particularly true for the OLAP Cubes p rocedure and tabl es that contain i ndividu al case
data, such as those available in the Summarize procedure.
Text output. The more text that is produced, the slower it will be in distributed mode
because this text is produced on the remote server and copied to your local computer
for display. Text results have low overhead, however, and tend to transmit quickly.
Page 95
Server Login
The Server Login dialog box allows you t o select the computer t hat you want to use to
process commands and run procedures. This can be either your local computer or a
remote server.
Figure 4-1
Server Login dialog box
65
Distributed Analysis Mode
You can add, modify, or delete remote servers in the list. Remote servers usually
require a user ID and a password, a nd a domain name may also be necessary. Con ta ct
your system administrator fo r information a bout av ailab le servers, use r ID, passwords,
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 automati cally connected to the defaul t server when
you start a new session.
Page 96
66
Chapter 4
Adding and Editing Server Login Settings
Use the Server Login Settings dialog box to add or edit connection information for
remote servers for use in distributed analysis mode.
Figure 4-2
Add Server dialog box
Contact your system administrator for a list of available servers, port numbers for the
servers, and additional connection information.
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 (example,
202.123.456.78).
Port Number. The port number is the port that the server software uses for
communications.
Description. Enter an optional descrip tion to display in the servers list.
To Select, Switch, or Add Servers
From the menus choose:
File
Switch Server...
To select a default server:
In the server list, check the box next to the server that you want to use.
Enter the user ID, domain name, and password provided by your administrator.
Page 97
Distributed Analysis Mode
Note: You are automatically conne cted to the de fault server when you start a
new session.
To switch to another server:
Select the server from the list.
Enter your user ID, domain name, and password (if necessary).
Note: When you switch server s during a session, all open windows are closed. You will
be prompted to save changes before the windows are closed.
To add a server:
Get the server connection information from your administrator.
Click Add to open the Server Login Settings dialog box.
Enter the connection information and optional settings and click OK.
67
To edit a server:
Get the revised connection information from your administrator.
Click Edit to open the Server Login Settings dialog box.
Enter the changes and click OK.
Page 98
68
Chapter 4
Opening Data Files from a Remote Server
Figure 4-3
Open Remote File dialog box
In distributed analysis mode, the Open Remote File dialog box replaces the standard
Open File dialog box.
n The list of available files, fold er s, and dr iv es is depe ndent on what is avai l abl e on
or from the remote server. The current server name is indicated at the top of the
dialog box.
n 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 containi ng your
data files as shared folders.
n 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 f ile is opened. If y ou want to have multiple dat a files o pen at the same
time, you can start multiple sessions.
Page 99
To Open Data Files from a Remote Server
If you aren’t already connected to the remote server, log in to the remote server.
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
Saving Data Files from a Remote Server
Figure 4-4
Save Remote File dialog box
69
Distributed Analysis Mode
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 lo cal computer unless you specify the drive
Page 100
70
Chapter 4
as a shared device and the folders as shared folders. If the server is run ning a di fferent
operating system (for example, you are running Windows and the server is running
UNIX), you probably won’t have access to local data fil es in distributed analysis mode
even if they are in shared folders. Permissions for shared folders must include the
ability to write to the folder if y ou want to save data files in a local folder.
To Save Data Files from a Remote Server
Make the Data Editor the active window.
From the menus choose:
File
Save (or Save As...)
Data File Access in Local and Distributed Analysis Mode
The view of data f iles, folders (directories), and dri ves for both your loc al computer and
the network is based on the comp uter you are currently using to pr ocess commands and
run procedures—which is not necessarily the computer in front of you—where you
select those commands and procedures and see the results.
Local analysis mode. When you use your local computer as your “server,” the view of
data files, folders, a nd driv es that you see i n the file access dialog box (for opening data
files) is similar to what you see in other appli cations or in the Windows Explorer . You
can see all of the data files and folders on your computer and any files and folders on
mounted network drives that you would normally see.
Distributed analysis mode. When you use another computer as a “remote server” to
run commands and procedures, the view of data files, folders, and drives represents
the view from the perspect ive of the remote se rver comp uter. Although you ma y
see familiar folder names such as Pro gram F iles and dri v es such as C, these are not
the folders and drives on your computer; they are the folders and drives on the
remote server.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.