|
|
Using SPSS on Sophia SPSS, a powerful all-purpose statistical analysis program, is the primary data analysis program used at Smith. SPSS is available on both the Windows and Macintosh computing platforms. Users interested in sophisticated statistical analysis of large data files will find that Sophia, our UNIX host, is the best place to get the job done. No other platform can offer comparable performance. Users have access to Sophia from all our Novell networks. SPSS can be run in two ways: interactively and batch mode. The latter is more efficient, and this document will discuss it in detail. Interactive mode is useful for data exploration, and will be discussed in brief at the end of this document. Using SPSS in Batch Mode Creating a Batch File At the % prompt, type: pico test.sps. <enter> This will invoke Pico, and you can begin typing SPSS commands.
Figure 1. A sample Pico session. If you want to print your output on a laser printer, you will want to set the width to 80 columns. set width 80. get file "data/test.sav". get file "/home/x1/tshortel/data/soc201/example.sav". set width 80. get file "/home/x1/tshortel/data/soc201/example.sav". display dictionary /vars all. frequencies vars v1 to v10 /format notable /stats mean median stddev min max. correlations v1 to v5 /print sig. Commands should end with a period. If a command wraps onto a second line, indent it. File references should be enclosed in quotations. If you do any data manipulation and want to save the changes, you should include a save command, as in: save outfile "/home/x1/tshortel/data/soc201/example.sav". If this is the same file that was referenced in the get file command, the save file will write over the original version. You can include multiple get file commands in a single batch file, but only one system file is retained at any one time. When you reference a new file, the old one is abandoned -- and any changes made in it are lost unless saved with the save command.
To submit the file, at the system prompt, type: spss test.sps > test.out & <enter> The system will prompt you when the job is finished.
Figure 2. The system notifies the user that the SPSS batch job is completed. You can now view the output. Use Pico to view and/or edit the output file. In the example in Figure 2, the user would type: pico test.out <enter> to examine the results of test.sps. Unless you specify otherwise in the spss command, SPSS will send the output back to the current working directory.
Once you are satisfied that your results are in order, you can send the output file to a printer. Many networked printers have a queue on Sophia. To see the available printers in the Jahnige Center, type: printers jahnige <enter> Printer Name: jahnige_hp Aliases: j_hp Description: HP LaserJet in Jahnige Resource Center (Wright Hall) Printer Name: jahnige_ps Aliases: jahnige_postscript, j_ps Description: Postscript printer in Jahnige Resource Center (Wright Hall) Printer Name: jahnige_epson Aliases: jahnige, j Description: Epson printer in Jahnige Resource Center (Wright Hall) These are the names of all the print queues for Jahnige Center printers. You could specify Bass, Seelye, or faculty (for faculty printers), and so forth. You specify a particular printer with the -P switch; for example, to print to the Jahnige Center postscript printer, you would type: lpr -Pj_ps example.lst <enter>
SPSS uses the following naming conventions. System files - binary files with data and formats combined - have the extension .sav. Syntax files, or batch files, have the extension .sps. Output files have the extension .lst. UNIX is case sensitive, so test.sav and Test.sav are different files. If you receive the following error message, >Error # 31 on line 1 in column 10. Text: data/example.sav ls *.sav <enter> Unlike DOS/Windows, filenames may be longer than 8 characters. The following are valid file names: EliteGroup0.sav EliteGroup3.sav EliteIdeology.sav When running an interactive session of SPSS, commands are executed as they are issued, one at a time, and the results written to the screen. This is useful for data exploration. Often, when running an interactive session, you will want to keep a copy of the results in a file as well as view them on screen. You can specify this when you invoke SPSS, with the following command: spss -t InteractiveSession1.lst <enter>
Figure 3. A sample SPSS interactive session. The prompt will change from the system prompt (%) to the SPSS prompt (SPSS>). You can now enter any valid SPSS commands. When you hit the enter key, SPSS immediately executes the command and writes the output to the screen (and to a file, if you specified that option when you started the session). To start, you will need to reference a SPSS system file, with the get command. As with batch mode, you can keep only one system file at a time in working memory. If you reference a second system file, the first will be discarded and any changes to it lost, unless you have saved them with the save command. When you are finished, type: finish.
A full set of SPSS users guides are available in the Jahnige Center. Users can also consult the Jahnige Center statistician, x3043, for assistance with SPSS on Sophia. |
||
|
|
|
|
Maintained by Information Technology Services // Main Office (413) 585-3770 For user support, call (413) 585-4487 // Send comments to tara@email.smith.edu |