Using SPSS for Windows and Macintosh

motherlamentationInternet και Εφαρμογές Web

7 Δεκ 2013 (πριν από 3 χρόνια και 9 μήνες)

93 εμφανίσεις




2010


Stanford University

Social Science Data and Software

Using SPSS for Windows

and Macintosh

This document cove
rs the basic features of SPSS

(now known as PASW)

for Windows

and Macintosh
.
SPSS is a comprehensive, easy to learn statistical analysis and data management software program.

SPSS for Windows
and Macintosh
is publicly availabl
e in the Meyer Library cluster.
It is also available
in Green Library Bing Wing on designated computers in the Jonsson Social Science Reading Room and
in the Velma Denning Room.

To use any of the public computers on camp
us, you must have a SUNet
ID (Stanford University Network Identifier).

See the following URL for information on obtaining a SUNet ID:

http://www.stanford.edu/group/itss/services/sunetid/

Table of Contents

Getting Started with SPSS for Windows

................................
................................
....................

1

SPSS Windows

................................
................................
................................
.........................

3

Data and Variable Views

................................
................................
................................
................................
........
3

Working with Data Files

................................
................................
................................
.............

4

Entering Data into SPSS

................................
................................
................................
................................
........
4

Opening Data Files
................................
................................
................................
................................
.................
4

Renaming a Variable/Working in Variable View

................................
................................
................................
....
5

Saving Your Data Files

................................
................................
................................
................................
..........
6

Moving Data Files Across Platforms

................................
................................
................................
......................
6

Analyzing Data

................................
................................
................................
..........................

6

Using the Analyze Pull
-
down Menu

................................
................................
................................
.......................
6

Using the Syntax Window

................................
................................
................................
................................
......
8

Creating Charts and Graphs

................................
................................
................................
................................
..
9

Saving Your Work

................................
................................
................................
....................

10

Printing Files

................................
................................
................................
............................

11

For More Information and Assistance

................................
................................
......................

11

SPSS Help

................................
................................
................................
................................
..........................

11

SPSS Documentation and Books

................................
................................
................................
.......................

11

SSDS Software Services at Stanford

................................
................................
......................

12

Getting Started with SPSS for Windows

and Macintosh

SPSS has a graphical interface consisting of pull
-
down menus, dialog boxes, and windows that display
and organize data, and perform nume
rical and graphical t
asks.
You can perform most tasks in SPSS by
p
ointing and clicking the mouse.
This section describes the basic features of the SPSS pull
-
down menus
and window

displays
.

A basic familiarity with the Windows operating system
or the Macintosh operating system
is all you
need to get started with SPSS
.
To start SPSS on the designated computers in the SSRC Reading Room
cluster, you can simply double
-
click on the SPSS icon (shown below) on the desktop.
On a Macintosh
operating sys
tem, you can start SPSS by clicking on Applications in the Finder menu.


2



Using SPSS for Windows

and Mac
intosh


You can access SPSS
on any

computer

in the Meyer Library cluster from the Start menu

for Windows or
the Applications menu in a Macintosh operating system
.

Wh
en you start SPSS
, a s
creen like the one
below will appear:



Note:

The screen shown above may be partially obscured by a

smaller window asking, “What would

you
like

to do?”
You can move to an empty data screen like the one above by clicking
C
ancel
.

Like
most Windows program
s, SPSS
has a menu bar with pull
-
down menus that you can use to access
many
of the features of the program.
The following is a summary of the main pull
-
down menus and
their functions:

Menu

Functions

File

Open and save data files, syntax files
, and output

files
; print files; e
xit SPSS.

Edit

Modify or copy text; search for data and text; find and replace text; insert
variables or cases.

View

Customize the look of the SPSS window by selecting to view the status bar,
toolbars, grid lines,
value labels, and
variables; c
hange fonts.

Data

Sort, subset, and restructure
data
;

merge

data

files
; identify duplicates;
make
3



Using SPSS for Windows and Macintosh

other global changes to
the

data. Changes made are not permanent until you
save the data file.

Transform

Make new variables or make changes to
selected variables (such as recode).

Changes made are not permanent until you save the data file.

Analyze

Perform statistical procedures to produce descriptive and inferential statistics.

Graphs

Create charts and graphs such as scatterplots, bar charts,
line graphs, and pie
charts. For more information on using Interactive charts and on editing charts,
see “Creating Charts and Graphs” on page 9.

Utilities

Display variable and file information, customize menus, create variable sets
and autoscripts.

Add
-
o
ns

Additional modules for purchase for other statistical analytic tools.

Window

Bring a differen
t SPSS window to the foreground or split window.

Help

Get help on SPSS procedures;
use

the SPSS tutorial and
the statistics coach.

SPSS Window

Displays

There

are a number of diff
erent types of windows in SPSS.
The following is a summary of the functions
and contents of the most commonly used windows.

The
SPSS Statistics
Data Editor
window displays the contents of your dat
a file in a spreadsheet
format.
This
window usuall
y appears when you launch SPSS.
You can create new data files by entering
data directly into the c
ells in the Data Editor window.
You can also open existing data files and modify
them in the D
ata Editor window.
You can only have one data fi
le open at a time in SPSS.

The
SPSS Statistics
Viewer

window opens automatically the first time you run a p
rocedure that
generates output.
All of your statistical results, tables, graphs, and charts are displayed in the View
er
window.
Any errors or warni
ngs generated while run
ning analyses also appear here.
You can edit your
output and save it for later use.

The
Chart Editor

window can be opened by double
-
clicking on any charts or graphs you have created

(displayed in the Viewer window)
.


A
Properties
wi
ndow may also open up with the Chart Editor
window.
Within the Chart Editor window, you can modify your charts and graphs by ch
anging colors,
fonts and sizes.
You can also add and edit chart and axis titles and labels, rotate 3
-
D charts, and even
change
the chart type.

You can paste your dialog box choices into the
SPSS Statistics Syntax Editor

window
.
Procedures
will appear in command syntax form in the Syntax Editor window. You can edit the syntax commands
to utilize special features of SPSS not avail
able through dialog boxes. You can also save your
commands in a syntax file for use in future SPSS sessions. To paste dialog box choices into the Syntax
Editor, click the
Paste

button instead of the
OK

button when you are finished working with the dialog
box. For more information see

“Using the Syntax Window” on page 8.

Data and Variable Views

SPSS has two different views:
Data

View
and
Variable

View
.

You can choose one by clicking on the
tab in the b
ottom left
-
hand corner of the window.

You can use Data View for entering or looking at
data, while you can use Variable View for changing the format and characteristics of variables.


For
more information on these views, please see below.

4



Using SPSS for Windows

and Mac
intosh

Working with Dat
a Files

Entering Data into SPSS

After you launch SPSS, an empty Data Editor window titled
Untitled
1 [DataSet0]



SPSS
Statistics
Data

Editor

will appear.

The Data Editor window consists of a grid of rows and columns.


The rows
correspond to cases, and th
e columns correspond to variables.

There are several ways to enter data into the SPSS Data Editor window.

You can enter data directly into
cells in the Data Editor window.

You can also open an existing SPSS for Windows file, open data files
saved in sel
ected other formats (e.g., SPSS Portable files, SPSS for Macintosh files, and Excel
spreadsheet files), or open ASCII (or text) files.

To enter data directly into SPSS, type values into the empty cells and use the mouse, arrow keys, or tab
key to move from

one cell to another.

For example, if you have data on the ages and heights of 100
children, begin by entering the first child’s name, ag
e, and height in the first row
(
s
ee below for an
example)
.

Then type the information for the second child in the seco
nd row.

When you have entered all
of the data, you will have a dataset with 100 rows and 3 columns.

Your data will look like this:


Opening Data Files

Opening an Existing SPSS for Windows Data File:


To work with an existing SPSS for Windows data
file

(file extension
.sav
)
, launch SPSS and then select
Open

from the
File

menu and
Data

from the
submenu.

In the dialog box that appears,
browse for and select
the data file you want to open and click
on
Open
.

Note:

This
will open SPSS files saved using SPSS for Macintosh as well.

The data file will
appear in the Data Editor window.

To open an SPSS portable file (which can be read by any version of
SPSS
; file extension
.por
), use the same procedure, but select
Portable

f
ile under
Files of type

drop
-
down menu
.

Opening Other Types of Data Files:


SPSS can read data in several formats, including the formats for
Excel, Systat, and Lotus files.

You can usually open all files that SPSS recognizes by selecting
Open

from the Fil
e menu and
Data

from the submenu, choosing the relevant file type under
Files of type
,

selecting the file, and clicking on
Open
.

For more details, see the
SPSS 1
7
.0 Command Syntax
5



Using SPSS for Windows and Macintosh

Reference

which can be found by choosing
Comma
nd Syntax Reference

function
under

H
elp

in the
menu in the Data Editor window
.

Opening text (ASCII) Files:


To open an ASCII (or text) file in SPSS, go into the
File

drop
-
down menu
and select
Read Text Data
.

In the dialog box that appears, select your file and click on
Open

(make
su
re you select the appropriate
Files of type
).
Once you have selected a file, the
Text Import Wizard

will appear to help you with r
eading in the data.
You need to tell SPSS whether your file matches a
predefined format, how variables are delimited or arra
nged, whether you have incl
uded variable names,
and so on.
A preview of your file will be shown to help you remember its characteristics. Once you
have entered the correct information, SPSS for Windows will import your data.

Renaming a Variable/Working in

Variable View

By default, SPSS assigns the name “var00001" to the variable entered

in the first column, "var00002
" to
the variable in the second column, and so on.


It is a good idea to give variables more descriptive names,
such as "age" or "height."

To change SPSS default variables names, click the
Variable View

tab in the
bottom left
-
hand corner of the Data Editor window.

Once you enter the Variable View, each variable fo
rms a row rather than a column.
Variable formatting
informati
on is displayed in each column.
You can click in any cell to ed
it the information it contains.
For example, to c
hange a variable’s type, click in

its
Type

cell and choose the type in the dialog box that
appears.

To change a variable’s width, simply clic
k in its
Width

cell, then use the up and down arrows
to set the width.

To rename a variable, click in its
Name
cell.
To use a cursor, double
-
click in the cell; triple
-
click to
highlight the entire variable name

(on a Macintosh operating system click once
to highlight)
.

You can
then change the name of the variable by deleting the default variable name and typing your preferred
name, such as "age," in the Name cell.

Your variable name may not be longer than eight characters,
begin with a number, include no
n
-
alphanumeric characters (underscores are an exception), or contain
embedded spaces.


While in the Variable View, you may also want to define missing values for your variables (in the
Missing

column).

You can also assign descriptive labels to the values

of your variables using the
Label
column.


Your label can be as long as 120 characters (e.g.,
h
eight in cm, shoes off).

When you are done with editing variable formats, click the
Data View

tab in the bottom left
-
hand corner
to return to your data.

6



Using SPSS for Windows

and Mac
intosh

Saving
Your Data Files

To save data you have entered into the Data Editor window as an SPSS for Windows file, select
Save

from the
File

menu.

In the dialog box that appears, type a name for your data file, select where you
want to save it, and click on
Save
.

N
ote:

Saving your files on the hard drive of a public machine is not
recommended.

It is a good practice to give different types of SPSS files different extensions so they can be easily
distinguished from each other.

The file extension
.sav

(e.g., example.
sav) is usually added to SPSS data
files.

Your saved file contains all of the values you entered, as well as the names of your variables, the
labels you assigned to them, and any other formatting changes you made.

Note:

Be aware that when you save your d
ata, it overwrites the specified data file.

Any variables or
cases that you have deleted or selected out will be lost.

To retain the original file, click
Save As

instead
of
Save

in the
File

menu, and give the altered data a new name.

Moving Data Files Ac
ross Platforms

If you plan to open your SPSS data files on other operating systems such as UNIX, save your data file as
a portable file.

A portable file can be read by any version of SPSS (for example, Macintosh, Windows,
or UNIX).

Note:

If you are simp
ly transferring your data between SPSS for Windows and SPSS for
Macintosh, you do not need to change the file format.

To save data as a portable file, select
Save

from the
File

menu.

In the dialog box that appears, choose
P
ortable

from the
Save as t
ype

box.

Then give the portable data file a name and click on
Save
.

It is a
good idea to give portable files a different extension from regular data files. For example, to save a file
named example.
sav

as a portable file, save it as example.
por
. Since examp
le.por is a portable file, you
can open it in SPSS for Windows or SPSS for UNIX.

To use your SPSS data in another statistical software package such as Stata or SAS, you will need to use
a data transfer program such as StatTransfer or DBMS/Copy.

Informatio
n and software are available in
the Velma Denning Room (Room 120F in the Bing Wing of Green Library).

Analyzing Data

You can perform most statistical procedures in SPSS using the pull
-
down menus or by typing
commands in a Syntax window. Some advanced proce
dures and options can only be executed by typing
commands in a Syntax window. The
SPSS Syntax Reference Guide

is a good source of information in
these situations. See “Using the Syntax Window” on page 8 for more information.

Using the Analyze Pull
-
down Men
u

To perform a statistical procedure, use the
Analyze

pull
-
down menu to select the procedure you want to
perform.


For example, to produce descriptive statistics on a variable in your data (for example, the
variable “age”), go into the
Analyze

menu, selec
t
Descriptive Statistics
, and click on
Descriptives

in
the submenu. A dialog box appears:

7



Using SPSS for Windows and Macintosh


In the
Descriptives

dialog box, click the age variable to highlight it, click on the right
-
pointing arrow to
move it into the box labeled
Variable(s
), then click on

OK
.

The descriptive statistics appear in an
untitled Viewer window:


Above the Descriptives table, you can find SPSS syntax.

We will talk about SPSS syntax
in detail
on
page 8.

You can modify, save, or print the statistics in the Viewer window.

For i
nformation about
saving your output file, see "
Saving Your Work
" on page 10.

To perform a linear regression, go into the
Analyze

menu, select
Regression
, and click on
Linear

in the
submenu.

In the
Linear Regression

dialog box that appears, designate a dependent variable by
selecting a variable from the list of variables and clicking on the right
-
pointing arrow next to the
Dependent

box.

To designate an independent variable, move it into the
Independent(s)

box by
se
lecting it and clicking on the arrow next to the
Independent(s)

box.

Click on
OK
.

8



Using SPSS for Windows

and Mac
intosh


The results of the linear regression will appear in your Viewer window.

You can request additional
regression options by clicking on the
Statistics
,
Plots
,
Save
, or
Optio
ns

buttons
on the right
-
hand side
of

the
Linear Regression

dialog box.

For example, you can request confidence intervals for your linear
regression coefficients by clicking on
Statistics
before you perform your linear regression.

In the dialog
box that a
ppears,
check

the box labeled
Confidence intervals
, then click on
Continue

and then
OK
.

Using the Syntax Window

To perform some less common procedures and options, use the Syntax window.

To open a Syntax
window, select
New

from the File menu and choose
S
yntax

from the dialog box that appears. Click on
OK
, and the
SPSS Statistics Syntax Editor

window will appear in the foreground. Type SPSS
commands and variable names in the window.

For example, to run descriptive statistics on the age
variable in the Syn
tax window, type:

Descriptives variables=age.

Descriptives

is an SPSS command.

It requires the subcommand
variables

and a list of one or more
variables from the data file.

The output will be the same as in the menu
-
based de
scriptives example
shown
above.

Type all commands in the first column of the line and end them with a period. You can find the syntax
commands for statistical procedures in the SPSS manuals or in the SPSS Help window. See "
For More
Information and Assistance
"

on page 1
0
.

You can also insert commands into the Syntax window by selecting the procedure you want to perform
from the
Analyze

pull
-
down menu and pasting it into the Syntax window.

For example, to paste the
commands for the linear regression procedure d
iscussed in the previous section, open the
Linear
Regression

dialog box from the
Analyze

menu, designate your dependent and independent variables,
then click on
Paste

instead of clicking
OK
.

SPSS automatically pastes the command into your open
Syntax wind
ow, but it does not run the analysis.

Here is the pasted syntax:

9



Using SPSS for Windows and Macintosh


To run commands in the Syntax window, highlight the commands you want to run using the mouse and
click on the
Run Syntax

tool located in the tool bar. The run syntax tool looks like a sing
le, right facing
arrow

(in blue)
. Alternatively, you can use the
Run

pull
-
down menu in the Syntax window.

As usual, the output from your procedure will appear in your Viewer window.

To save the information
displayed in your Syntax or Viewer windows, see "
Saving Your Work
" on page
10
.

Using the Syntax
window, you can keep a record of the analyses you have run.

You can save your commands in a syntax
file, then open them again later to duplicate or expand your analysis.

This option
can be very useful for
long
-
term projects.

Creating Charts and Graphs

Use the
Graphs

pull
-
down menu to create graphs and charts.

SPSS can create a wide range of graphs
and charts and has lots of options for customizing them.

For example, to create a sca
tterplot of the two
variables “age” and “height,” go into the
Graphs

menu
, select
Legacy Dialogs
,

and select
Scatter
/Dot…
. In the dialog box that appears, select
Simple

Scatter
and then click on
Define
. Move the
variable “age” into the
X
-
axis

box and “height” into the
Y
-
axis

box by selecting each variable and
clicking on the right
-
pointing arrows next to each box.

Then, click on
OK
. The graph will appear in the
Viewer window

after the SPSS syntax
:

10



Using SPSS for Windows

and Mac
intosh


Double
-
click on the scatterplot in the View
er window, and a
Chart Editor

window will appear.

Using
the Chart Editor menus, you can add features such as a title to your charts and graphs and change the
scale, range, or labels for your graph's axes.

You can click on the axes or data points in your
graph to
select and edit them.

Saving Your Work

Save SPSS output, chart, syntax, and data files using the
Save

command in the
File

pull
-
down menu.
For information about saving data files, see "
Saving Your Data File
s" on page 6.

To save SPSS output files
, including charts and graphs, move the output file to the foreground by
clicking
on the
Output1 [Document1] SPSS Statistics Viewer

box at the very bottom of your screen.
Select
Save
from the
File

menu

in the output window
.

In the

dialog box that appears, type a name for
your output file.

Output files are commonly given the extension
.sp
v

(e.g., example.sp
v
).

Click on
Save

to save the output file.

You could also
export
an
SPSS output file

in other formats to be able to view it
when you do no
t have
access to SPSS program.
To export an output file, go to the
File
menu in the output window and click
on
Export…
. In the dialogue box that appears, you may specify what output to export (
all or selected
),
what
path and file name to us
e for the exported output file, and what file format to use (html,
W
ord, text,
PowerPoint,
or
E
xcel spreadsheet).

To save the information in your Syntax window
, be sure that the S
yntax

Editor

window is in the
foreground and select
Save
from the
File

menu.


Syntax files are usually given the extension
.sps

(e.g.,
example.sps).

Click on
Save

to save your syntax file.

11



Using SPSS for Windows and Macintosh

After you have saved an output, syntax or chart file, you can open it by selecting
Open

from the
File

menu, then choosing the file type from
the submenu.

In the dialog box that appears, locate the file you
want to open, highlight the file name and click on
Open
.

Printing Files

You must purchase print quota to print at the Meyer or Tresidder clusters. More information about this
can be found a
t http://
www
.stanford.edu/
services
/
cluster/printing
.

To print numeric output such as frequencies or regression results, make sure the
SPSS Statistics
Viewer
window is in the foreground and select
Print

from the
File

menu.


If you want to print only a porti
on of
your Viewer window, you can do so if your printer allows you to print selections.


Highlight the desired
section by clicking in the area on the left
-
hand side of the window.

Then, select
Print

from the
File

menu.

Make sure that the
Selected output

button is clicked in the
Print Range

area of the
Print
dialog
box, then click
OK
.

You can also print syntax files.


Choose
Print
from the
File
menu once the Syntax window is in the
foreground.

For More Information and Assistance

SPSS Help

SPSS has an e
xtensive hypertext Help system that provides information about using SPSS and
understanding the results.

To access the SPSS Help system, go to the
Help

menu on the far right side of
the screen and select an option.

The
Topics

command allows you to access

a standard
-
format help system.

You can view a wide variety
of topics using a

table of contents, an index, a search function, or a list of favorites.

Using the
Tutorial

option, you can access a large number of how
-
to descriptions for SPSS procedures.
The
tutorial database is a detailed, useful resource for users with specific questions.

It contains a Table
of Contents for easy searches.

Users can access the
SPSS
Inc.
Home
from the
Help
menu.


This resource contains much up
-
to
-
date
information about SPSS.

The
Comm
a
nd S
yntax
Reference

function lets you download specific sections of the
SPSS 1
7
.0
Command

Syntax Reference
as a PDF file.

Choose the SPSS module you are working with (
Base
is the
most common option), then search the document or use the left
-
hand
navigation bar to locate syntax
commands.

This guide provides the command syntax for statistical and data manipulation procedures,
which you can print or type into your Syntax window.

The
Statistics Coach
is an excellent resource for new SPSS users.

Thi
s interactive guide asks what you
want to do, then leads you through the necessary steps for completing the desired analysis.

For example,
if you want to present descriptive statistics for some variables, you should
click on the blue link in

the
Statistic
s Coach
that says

Summarize, describe, or present data
.

If you want to look at
a

continuous
variable
such as a
ge, select the
Scale
, numeric data

(interval, ratio)
.

Tell the statistics coach that you
want to present
Tables and numbers
, then

choose
Descriptive statistics plus quartiles, quantiles, and
percentiles
. The Statistics coach opens a how
-
to page for obtaining descriptive statistics.

SPSS Documentation and Books

Please see the document “
Resources for Learning SPSS
” on SSDS website.

12



Using SPSS for Windows

and Mac
intosh

You can read and photocopy
SPSS books and manuals
in the Velma Denning Room (Green Library
Bing Wing, room 120F) or purchase them at the Stanford Bookstore. Some SPSS manuals are also
available to be checked out from Green Library Reserves.

SSDS Software
Services at Stanford

Software Services provides technical support for SPSS users at Stanford. Users can ask questions or
make appointments with the consultants via our website. For more information or to contact us, see the
web at:

http://ssds.stanford.edu/

Note: This document is based on
SPSS
1
8
.0 for

Window
.

Copyright
©

2010
, by The Board of Trustees of the Leland Stanford Junior University. Permission granted to copy for non
-
commercial purposes, provided we receive acknowledgment and a copy of the document in which our material appears. No
right is granted to quote from or u
se any material in this document for purposes of promoting any product or service.

Social Science Data and Software

Document revised:
6/30/2010