University of Wyoming
Division of Information Technology
Ask IT Help Documents
![]() |
UW-specific |
NOTE: Functional knowledge and use of this application is the responsibility of the user.
SPSS is a comprehensive tool for managing, analyzing and displaying information. Among the features available with SPSS are:
SPSS 6.1 for UNIX can operate in one of three modes.
Note: Batch Mode/Prompted Mode is assumed for the rest of this How To.
The following two examples illustrate an easy way to use SPSS. Use an editor to create an SPSS command file. It is desirable to include the extension .sps on an SPSS command file name. The words TEST, TEST2, and MYDATA were arbitrarily selected.
Example 1: Create the file test.sps containing the following SPSS commands:
TITLE A Sample Program
DATA LIST / SEX 1 CLOTHES 3-5 RENT 7-9
VALUE LABEL SEX 1 ‘Male’ 2 ‘Female’
BEGIN DATA
2 65 100
1 86 70
1 50 50
2 100 100
2 70 60
END DATA
CROSSTABS SEX BY RENT
FINISH (Continued)
To run the program and generate output to the screen, enter the following command at the shell prompt:
frontier:~> spss -m test.sps.
To generate SPSS output in a file called test.lis, enter,
frontier:~> spss -m test.sps > test.lis.
Results from the SPSS job are viewed on the monitor by either editing the file or typing more test.lis
test.lis can also be printed using a variety of commands:
frontier:~> lp test.lis. (Printout goes to a printer in the student computer lab in the lobby of the Information Technology Center)
Example 2: Use a Data File
The data file name can include the disk, the directory, and the file name. Here are three examples:
NAME='test.dat' (Current directory)
NAME='/tmp/test.dat' (To use a temp file)
NAME=’~doe/test.dat' (Doe's directory)
Use the editor to create test2.sps with these SPSS commands:
TITLE A Sample Using a Data File
DATA LIST FILE='test2.dat' FREE / SEX CLOTHES RENT
VALUE LABELS SEX 1 'MALES' 2 'FEMALES'
SORT CASES BY SEX
REPORT FORMAT = LIST/
VARIABLES = CLOTHES 'CLOTHING COST' (15)
RENT 'RENTAL COST' (15)/
BREAK = SEX(LABELS)/
SUMMARY = MEAN
FINISH
Use the editor to create a data file, test2.dat, with the following data:
2 65 100
1 86 70
1 50 50
2 100 100
2 70 60
The SPSS command file will use data from the file test2.dat when the following command file is executed.
frontier:~> spss -m test2.sps.
Reviewed: 0709 By: GG
Additional help with the installation and configuration of
UW-supported software is available:
Faculty/Staff
Contact your IT user consultant
(www.uwyo.edu/infotech/services/helpdesk/uc/)
Contact the IT Help Desk at 766-HELP (4357), option 1
Email UserHelp@uwyo.edu
Students
Email ASU-IT@uwyo.edu
Contact the IT Help Desk at 766-HELP (4357), option 1
Come to the student computer lab in the lobby of the
Information Technology Center.