Path: Janda's Class Home Page > Research Paper Menu > Using DOIT


Using doit* to run SPSS

doit is a special menuing script written by Bruce Foster and named after the famous Nike slogan, "Do It!"

This section assumes that you have been assigned your own account and know how to log into hardin, a unix computer running the SPSS program.

You now have access to the Dalton data on 7,700+ respondents interviewed in the U.S., U.K., France,and Germany in 1990-91--which is stored in my master account.

Using the proper "syntax" in writing SPSS commands under an editing program called qedit, you can call up variables from these data and cross-tabulate the variables to learn what factors affect public opinion and political behavior.

Type doit at the unix prompt[%]:

hardin(kjanda)43% doit

You'll be asked to provide a name for the "syntax" file, which is a text file that contains data or commands for the SPSS program. You can name this file what you want, but let's call it citizen.

Name of SPSS syntax file? citizen

The computer will reply by displaying a screen which begins with the phrase "new file."

Enter your SPSS control commands in this space.
The phrase "new file" will disappear as you begin typing.
Type this information into the editor:

get file = '$CLASS/citizen.sav'.
crosstabs discuss by nation/cells=count col.

[The function of this "crosstabs" command will be explained below.]

Type ^k and then x to leave the editor and return to doit.

All the editing commands in qedit require use of the control key, which is also designated ^. Thus, control-k is equivalent to simultaneously pressing ^ and k.

Immediately on leaving qedit you'll return to control of doit and see the menu again:

File citizen.sps saved.
 
doit - Tuesday 04/10/01 20:17:51
 
1. Edit syntax (qedit citizen.sps)
2. Run SPSS (spss -m < citizen.sps > citizen.lst)
3. Display results (more citizen.lst)
4. Print results
5. Class Bulletin (more $CLASS/bull)
6. Getinfo for Class Datasets (getinfo).
7. Change syntax file
8. Quit this menu.
 
Enter your choice: 2 [and press return]

Process the SPSS commands by choosing option 2:

Running SPSS. Please be patient!
         
End of job:  14 command lines  0 errors  0 warnings  1 CPU seconds

This "End of job" message indicates that your job ran successfully.

To check, choose option 3, "Display results" from the menu:

doit - Tuesday 04/10/01 20:17:51
 
1. Edit syntax (qedit citizen.sps)
2. Run SPSS (spss -m < citizen.sps > citizen.lst)
3. Display results (more citizen.lst)
4. Print results <--this option prints output in Cresap 115; so it's of limited value.
5. Class Bulletin (more $CLASS/bull)
6. Getinfo for Class Datasets (getinfo).
7. Change syntax file
8. Quit this menu.
 
Enter your choice: 3

The computer will then display the output from your spss run:

^L10 Apr 01 SPSS for Unix, Release 6.14 (HP-UX)                             Page 1
20:15:11  Northwestern University DCE    HP 9000          HP-UX 10.20
         
For HP-UX 10.20         Northwestern University DCE             SPSS ID 193786
         
   1  get file=citizen.sav.
         
         File citizen.sav
   Created:  19 MAY 98 11:14:42 - 71 variables and 7,762 cases
Cases are weighted by WEIGHT
         
   2  crosstabs discuss by nation/cells=count col.
         
         Memory allows for 11,915 cells with 2 dimensions for general CROSSTABS.
^L10 Apr 01 SPSS for Unix, Release 6.14 (HP-UX)                             Page 2
20:15:12  Northwestern University DCE    HP 9000          HP-UX 10.20
         
        
         DISCUSS  v03 Do you DISCUSS POLITICS often?  by  NATION  v01 NATION
   
          [Only the lines in boldface have much meaning; the other stuff is SPSS overhead reporting.]

Press the space bar to see more; the above is only a partial listing that fits on one screen.

                             NATION                                  Page 1 of 1
            Count  |
           Col Pct |United S Great Br West Ger France   East Ger
                   |tates    itain    many              many       Row
                   |     1  |     2  |     3  |     4  |     5  | Total
DISCUSS    --------+--------+--------+--------+--------+--------+
                1  |   271  |   216  |   510  |   117  |   671  |  1785
  Frequently       |  14.8  |  14.5  |  24.6  |  11.8  |  50.8  |  23.2
                   +--------+--------+--------+--------+--------+
                2  |  1054  |   766  |  1229  |   532  |   571  |  4152
  Occasionally     |  57.4  |  51.6  |  59.3  |  53.6  |  43.2  |  53.9
                   +--------+--------+--------+--------+--------+
                3  |   511  |   503  |   333  |   343  |    80  |  1769
  Never            |  27.8  |  33.9  |  16.1  |  34.6  |   6.1  |  23.0
                   +--------+--------+--------+--------+--------+
            Column    1835     1485     2073      992     1322     7706
             Total    23.8     19.3     26.9     12.9     17.2    100.0
         
Number of Missing Observations:  51

Press the space bar again to see more; the above is only a partial listing that fits on one screen.

^L10 Apr 01 SPSS for Unix, Release 6.14 (HP-UX)                             Page 3
20:15:12  Northwestern University DCE    HP 9000          HP-UX 10.20
         
Preceding task required .06 seconds CPU time;  .20 seconds elapsed.
         
   3
         
     2 command lines read.
     0 errors detected.
     0 warnings issued.
     0 seconds CPU time.
     0 seconds elapsed time.
       End of job.
citizen.lst: END

After you reach the end of the listing, you'll return to the doit menu.

doit - Tuesday 04/10/01 20:17:51
 
1. Edit syntax (qedit citizen.sps)
2. Run SPSS (spss -m < citizen.sps > citizen.lst)
3. Display results (more citizen.lst)
4. Print results <--this option prints output in Cresap 115; so it's of limited value.
5. Class Bulletin (more $CLASS/bull)
6. Getinfo for Class Datasets (getinfo).
7. Change syntax file
8. Quit this menu.

If you want to termiinate the job, choose option 8:

Enter your choice: 8

This returns you to the original unix menu. Type logout and press return.

hardin(kjanda) 46% logout

You are finished.


Concerning printing SPSS output:

The doit print option (4) prints nicely formatted SPSS output on a laser printer in Room 115 of the Cresap Laboratory. The output will be labeled with your netid, but you'll have to sort through other output to find it. This location may be convenient for some students, but not for others.

Perhaps the better procedure for most of you is simply to select and copy the SPSS output from your computer screen and dump it into a word processor. BUT NOTE: If you copy SPSS output for entry into a word processor be sure to change the font to a mono-spaced font, such as Courier, to preserve the spacing in the tables. If you view the output in a proportionally spaced font, such as Times, the tables will almost be unreadable.