In terms of command and subcommand syntax, the microcomputer versions are very similar to versions on other operating systems. Most of the syntax differences, of course, relate to the differences between the other operating systems (e.g., UNIX) and the operating system on which the microcomputer version runs. (DOS, Windows running over DOS, or Mac System). There are also some differences between SPSS programs due to successive levels of the SPSS software itself. In other words, if you have an SPSS program written in Version 5, it may need some tweaking (a technical term) before it will work without errors in Version 6 (or higher) of SPSS. Some of these differences are discussed in a Web page in the SPSS section of the ITS Help System:
SPSS on all microcomputer platforms currently is distributed in three modules: BASE, REGRESSION MODELS (Professional Statistics in the Macintosh version) and ADVANCED MODELS (Advanced Statistics in the Macintosh version). The current Windows and Mac versions have complete Graphics capability included in the BASE. There are also add-on packages for Tables, Trends, and so forth, available from SPSS Inc. (See References at the end of this document for the company address.)
Release 6.1 and later of SPSS for Windows and Macintosh have an online Tutorial included in the software, represented by an icon in the SPSS Group.
The BASE package is required for the operation of all of the other add-ons.
SPSS for Windows and SPSS for the Macintosh are currently available on the computers in the Public User Areas in Waite Phillips Hall, King Hall, Salvatori Computer Science Center and Leavey Library Information Commons (ground floor).
Documentation for these packages is listed at the end of this document.
SPSS is a sophisticated data analysis tool which can read raw data from external files, can translate and read data from other database programs (e.g., Lotus 1-2-3, Symphony, dBase and the like), and can read SPSS system files created on other types of systems (e.g., UNIX), through the use of Portable Files.
The Base package performs the usual data manipulations and has the following features: Aggregate, ANOVA, Correlations, Crosstabs, Descriptives, Export and Import, Formats, Frequencies, Join, List, Means, NPAR Tests, Oneway Analysis of Variance, Plot, Rank, Recode (a convenient feature not available in all other PC Statistics Programs), Regression, Report, Sample, Sort, Title/Subtitle, T-Test, Value and Variable Labels and Weight. The Professional Statistics Module (included in the Base package) also provides Cluster Analysis, Factor Analysis, Discriminant Analysis, Reliability, ALSCAL, PROXIMITIES, and Multidimensional Scaling.)
The Advanced Statistics pacakge contains procedures that perform the following statistical operations: MANOVA (including repeated measures), Logistic and NonLinear Regression, Loglinear Modeling, Probit and Logit, and Life Tables/Survival Analysis.
The microcomputer versions of SPSS are interactive packages that include a text editor and menu facilities, among other features. The Windows and Macintosh versions offer extensive point-and-click operations to accomplish most tasks. Optionally, users can enter commands one at a time and see results (or error messages) immediately, or can use the text editor and menu helps to build and edit groups of commands to be submitted together.
This document discusses how the user obtains SPSS software under the site license agreement ITS maintains with SPSS Inc., and offers an overview of the installation procedure. (Detailed installation instructions are provided with the package at the time it is leased from ITS.)
http://www.usc.edu/its/doc/statistics/spss/faq/gradpacks.html
Consulting assistance is available for installation problems as well as for the overall operation of the package. For installation or other consulting assistance, see the end of this document.
Information about obtaining SPSS software, including details about number of diskettes needed, costs, and so forth, is available from the ITS User Services Office (see last page) and from handouts available there.
Hardware requirements for SPSS for the Macintosh include a 68030 or 68040 processor running Sytem 7.0 or higher, and 8 MB of memory minimum, with 16 MB strongly recommended. SPSS for the Power Macintosh requires a Power PC Processor running System 7.1.2 or higher, with 16 MB of memory required. NOTE: SPSS for the Macintosh will not work on a Mac with a 68LC040 chip (e.g., the Powerbook 520).
Details of these requirements are found in the installation manuals for the packages, and in handouts available from ITS User Services (LVL Lower Commons, 213/740-5555).
The REGRESSION MODELS module provides Logistic and Multinomial Logistic Regression, Probit, Nonlinear Regression, Weight Estimation and Two-Stage Least Squares Regression.
The ADVANCED MODELS module contains commands that perform the following statistical operations: Multivariate and Repeated Measures Analysis; Variance Components Analysis; Model Selection, General and Logit Loglinear Analysis; Ordinal Regression; Life Tables' Kaplan-Meier Survival Analysis; Cox Regression; and Time-Dependent Covariates.
Most of the features of the REGRESSION MODELS and ADVANCED MODELS modules are also available in the Macintosh version, though they may be found in different modules. See the SPSS for Macintosh documentation for complete lists.
Other SPSS Modules provide the capability for Data Entry, Trends (Time Series Analysis), and Tables. These are not available from ITS. For information, contact SPSS using the information shown at the end of this document.
The Windows package is accessed by clicking on the Statistics icon that appears in the Productivity Tools window in the Statistics folder.
The Macintosh version is accessed by finding the SPSS icon in the Statistics Software folder.
Tutorials are available for both Windows and Macintosh versions of SPSS They are launched by clicking on Help inside SPSS, or the tutorial icon in the Statistics folder. The tutorial is included in the individual Windows or Macintosh versions that ITS distributes.
You may want to use a diskette when you use SPSS for Windows or Macintosh in the Public User Areas, but none is required.
If you want printed output from your SPSS for Windows or SPSS for Macintosh session, you can click File>Print while you are in the window you wish to print.
There are two main classes of SPSS commands: Data reading/manipulation commands, and Analysis commands. The data reading and manipulation commands are used to convert raw data, or data entered in other types of software (e.g., dBase, Excel) into an SPSS Active File. The Analysis commands are used to analyze the data that has been prepared in the Active File.
It is crucial to understand that Analysis commands can only access (analyze) data that have been converted into an Active File, and that there can be only one Active File at any given point in an SPSS program (or SPSS interactive session). Another key point is that all data needed for an Analysis command must be in the active file at the same time. SPSS Analysis commands cannot access data in two different places. If necessary, system files (or combinations of system files and the Active File) must be merged into one Active File prior to running an Analysis command.
DATA LIST [FILE='<file name>'] [FREE]
/ <list of variables>.
When this command is successfully run, SPSS creates the Active File -- which is a system version of your original data -- and unless replaced or modified by later commands this is the version of your data which all later commands use and analyze. In Windowing environments, the Active File appears as a spreadsheet in the Data Window.
Raw data may be entered in a separate (external) file or in- stream. If data are entered in an external file and a program (syntax) is being used to read them in, the FILE= keyword is necessary on the data list command to tell SPSS where to look for the data. If a point-and-click method is used to read in data, the process is guided by a Data Entry Wizard invoked by clicking File>Read Text (or ASCII) Data.
Example of DATA LIST using raw data in an external file:
data list free file='my.data' / idnum height weight iq.
If the data are entered in-stream (i.e.,
in the program itself along with the commands and subcommands),
there is no FILE= keyword and the commands BEGIN DATA and END
DATA are placed before and after the actual raw data as it
appears in the program just after the DATA LIST command.Example of DATA LIST using in-stream entry of raw data:
data list free / idnum height weight iq.
begin data.
1 52 105 98
2 61 184 102
3 47 89 110
4 53 112 87
end data.
Occasionally people will create (or otherwise obtain) data files
with records longer than the default LRECL (Logical RECord
Length) of 1024 bytes. When this is the case, SPSS must have
instructions to read a longer record, and such instructions are
given in a FILE HANDLE statement. The FILE HANDLE is a
"nickname" that is used in place of an actual file name when raw
data are being read into a DATA LIST command.
In the following example, the file "lrecl1500.data" (which has a logical record length of 1500) is assigned to the FILE HANDLE "toolong", which is then used in the DATA LIST command in place of the actual file name.
file handle toolong / name='lrecl1500.data' lrecl=1500.
data list file=toolong / var1 1-5 var2 456-458
var3 1362-1365.
Sometimes a raw data file will have data on more than one record
(line) for each observation.
In some such cases it is necessary to use FIXED (the default) format,
and enter a RECORDS keyword in the DATA LIST command, then put a
slash ("/") between the variable names for each line.
The following example has data on three records for each observation,
showing how to construct the DATA LIST command.
10001 785
42 55 38
2854
10002 775
98 54 26
3864
10003 685
73 18 43
2754
<etc.>
data list file="d:\threelines.txt" records=3 /
var1 1-5 var2 7-9 / var3 1-2 var4 4-5 var5 7-8 / var6 1-4.
SAMPLE: data in the file "D:\threelines.txt":
Another method of writing out raw (ASCII) data from SPSS is through the use of the WRITE command in a Syntax window. Those variables listed in the WRITE command are those which are written to the output raw file. Of course, SPSS needs to know what file to put the raw data into, and this is specified by the OUTFILE= subcommand.
Suppose you have an Active File (or an SPSS Save File which you have brought in to an Active File in an SPSS session) that has 100 observations, and ten variables called:
ID SEX AGE RACE TEST1 TEST2 HEIGHT WEIGHT IQ INCOME
Now, you want to create an ASCII (raw) file containing only three of those variables. This is how your program might look (the OUTFILE subcommand example is for the Windows environment; modify accordingly for use on UNIX or Macintosh files):
write outfile='c:\user\rawvals.dat' / id ' ' test1 ' ' income.
execute.
The example above includes a blank column (' ') between each value that is written out. This is not necessary, but if these blank columns are not specified, some values may be written next to other values without spaces in between. Most software can read ASCII data either with or without spaces between values, but usually it is easier to read ASCII files with spaces between values, commonly called "Space Delimited Data". The example above will create (or overwrite) a file called rawvals.dat in the specified directory (folder), and the file will contain all the values for ID, TEST1 and INCOME, separated from the other values by a single space.
If you have a large number of variables and you want all of them output to the raw file, you can use the WRITE command with the word ALL after the slash, as in:
write outfile='c:\user\rawvals.dat' / all.
execute.
For more details on the WRITE command, please consult the appropriate manual listed at the end of this document.
Those who are using SPSS for Windows
from the ITS BMR server or in the
Public User Areas
will find the sample data files on the server which is mapped
to the L:\ drive, in the programs\stat
directory.
To access the files from inside of SPSS, click File>Open>Data,
then find the L:\ drive in the "Look In:"
field, then click on the
"programs" folder, then the "stat" folder,
then the folder called "spss<version-number> (e.g.,
spss10_0_5), where the "version-number" matches the
version of SPSS you are using.
The same directory (folder) contains some sample SPSS programs.
To access these, click File>Open>Syntax, then locate the
directory (folder) as shown above. SPSS sample program files end with
a .sps extension.
An example of an analysis command is DESCRIPTIVES.
One keyword of the command is VARIABLES=, and one
of the subcommands is STATISTICS=.
A program that asks for VARIANCE and SKEWNESS statistics
might look like:
descriptives variables=height weight /
statistics=variance skewness.
SAVE OUTFILE='SAVEfile name'.
This creates a permanent file containing the System version of your data (called an SPSS Save File), which can be used to re- create the Active File in later SPSS sessions by clicking File>Open, or by using the following command:
GET FILE='SAVEfile name'.
When an SPSS Save file exists on disk and is called into an SPSS session with File>Open or the GET command, there is no need to run a DATA LIST command or to read raw data, unless your original data have changed in some way and need to be updated.
In character-based (i.e., non-X-Windows) versions of SPSS, you can save the Output window to a file when you go to that window, hit ESC-3 (or F3 in some versions), choose 'Write File' from the mini-menu at the bottom of the screen, and then specify the file name where you'd like to store the contents of that window.
For example, in DOS (i.e., SPSS for Windows) if your current directory is C:\MYSPSS, but you wish to read raw data from a file called HEMATO73.BLD located in your C:\MYSPSS\PROGS directory, the following command would be necessary:
data list file='c:\myspss\progs\hemato73.bld' / <etc.> .
Notice the use of single quotes, which is statutory. It is not absolutely necessary to include the "C:" drive specification (assuming the current directory is on the C: drive), so the same command could read:
data list file='\myspss\progs\hemato73.bld' / <etc.> .
It is up to the user whether to keep in the habit of specifying the drive designation for those instances when files on diskette (i.e., the A: or B: drives) are being used.
In the Macintosh, path designations consist of the name of Folders in which files or other folders are kept, separated by colons (:). If you have a file called My.Data in a folder called Rawdata on a diskette labeled MyDisk, you would specify this to SPSS as:
MyDisk:Rawdata:My.Data
Folders or files on the "Desktop" are a special case, as
SPSS only recognizes "Desktop Folder" as the name for this
location, and it must be considered part of the Hard_Disk (or whatever
your Mac's hard drive is named). For example, if
you have a folder myfolder1 on the Desktop, and
you wanted to ask SPSS to make that the current directory,
you must issue the following command:
set directory "Hard_Disk:Desktop Folder:myfolder1:"Note the double quotes, and the colon at the end of the path.
TRANSLATE FROM='<filename.ext>' / TYPE=<type> .
TRANSLATE TO='<filename.ext>' / TYPE=<type> .
where
If a file created by SPSS on a microcomputer
is to be read by SPSS on a
different type of system (e.g., UNIX), or a
file created on another system is to be read on a microcomputer,
first it must be
transformed into EXPORT format and then IMPORTed at the target
system. Export files are ASCII versions of SPSS System Files,
including all the dictionary information as well as the data.
They are necessary because true System Files typically are
corrupted when sent from one operating system to another (e.g.,
from DOS to UNIX, or vice versa).
If point-and-click is your
preferred mode of operation, you can create transport files from the
data in the Active File (data spreadsheet window) by clicking on
File>Save As, then choosing
EXPORT OUTFILE='<filename>' .
IMPORT FILE='<filename>' .
The IMPORT command is like the GET command, in that it results in
a System File which is immediately available for analysis by a
statistical or other procedure command. One difference, of
course, is that an IMPORTed file is temporary. It can be made
permanent by a standard SAVE OUTFILE='
SPSS Portable files must be transferred from system to system in
ASCII (not Binary) mode.
In most Windows and Macintosh file transfer software,
this choice is represented
by a button in the FTP or Fetch dialog box.
.por as the File Type (lower left
of the Save As dialog box).
Likewise, you can read in EXPORT format files by clicking on
File, then Open, then Data, then choosing .por
as the File Type.
If you are writing your own
program, the format for these commands
is:
Current schedules for User Services Classes (also called "Hands-On Workshops") are listed on the Web at:
http://www.usc.edu/libraries/adventures/Any Statistics Software class can be taught when groups of five or more users request them. Other ITS Classes by special arrangement may require a minimum of 10 attendees. Classrooms must be arranged by those requesting the class. Contact the User Services office for details, or visit
www.usc.edu/its/doc/statistics/help/classes/requests.shtml
(available at
www.usc.edu/its/doc/statistics/spss/manuals/
in PDF format):
Consulting. The ITS Consultants may be familiar with the language and general operations of this software, but it may be necessary to make an appointment with a member of the full time staff in order to receive detailed help. Support of statistics software is the responsibility of the ITS Statistics Consultant with the participation of other full-time ITS staff. These people may be contacted through the ITS Customer Support Center as shown here.
Customer Support. USC students, staff or faculty who would like information about ITS Workshops or about obtaining site-licensed software or other computing-related questions should visit the Customer Support Center in Leavey Library Lower Commons, or call 213.740.5555, or send eMail to <consult@usc.edu>
Documentation. This document, and many others on a variety of topics, are available in the ITS Customer Support Help System, available on the World Wide Web at:
http://www.usc.edu/its/
You can find Statistics Software Help Documents through the search engine at this same URL, or go directly to them at:
http://www.usc.edu/its/doc/statistics/help/
Newsgroups. Another source of information, this one providing the opportunity to exchange thoughts with other users, is the newsgroup 'usc.comp.all.stat.users'. For more information about reading news, subscribing to newsgroups, and related topics, visit
http://www.usc.edu/its/doc/internet/news/