SPSS Interactive Execution

SPSS allows you to execute your job in interactive mode. SPSS executes the command you enter and displays the result on the screen. We will use the external data file called clas.dat. In this interactive session we will:

  1. List the data for grade, years of computing experience, and total for math attitude scale;
  2. Do a one-way analysis of variance with grade as the independent variable and math attitude as the dependent variable; and
  3. Do a simple regression with years computing experience as the independent variable and the math attitude as the dependent variable.

To begin an interactive SPSS session, at the system prompt, type: (Suppose that we are logged on to the SP.)

     spss -m

Then, SPSS will display the newest features and an interactive SPSS> prompt like the following.

For help with SPSS computing, contact the UITS Stat/Math
Center (phone 855-4724; email statmath@indiana.edu; URL
http://www.indiana.edu/~statmath).

For AIX 3.2.5/4.        Indiana University                      SPSS ID 301965

SPSS>

When SPSS> prompt appears, SPSS is ready for the first line of command. Notice that you must end each command with a period followed by pressing the [ENTER] key. In other words, in interactive mode the SPSS system requires a period (.) at the end of each line unless a subcommand is needed or data entry is continuing. In such cases, the SPSS> prompt will be changed to the CONTINUE> prompt. Note that here only the commands are typed and the display of results is skipped.

SPSS> data list file=clas.dat notable          
CONTINUE> /id 1-2 sex 3 (a) exp 4 school 5 
CONTINUE> c1 to c10 6-15 m1 to m10 16-25 mathscor 26-27 compscor 28-29.
SPSS> missing values mathscor compscor (99).                      
SPSS> recode c3 c5 c8 c10 m3 m7 m8 m9 (1=5) (2=4) (3=3) (4=2) (5=1).
SPSS> compute compopi = sum (c1 to c10).
SPSS> compute mathatti = sum (m1 to m10).                  
SPSS> variable labels id 'student identification' sex 'student gender'
CONTINUE> exp 'yrs of comp experience' school 'school representing'.
SPSS> value labels sex 'm' 'male' 'f' 'female'/                   
CONTINUE> exp 1 'less than 1 yr' 2 '1 year' 3 '2 or more'/            
CONTINUE> school 1 'rural' 2 'city' 3 'suburban'/
CONTINUE> c1 to c10 1 'strongly disagree' 2 'disagree'
CONTINUE> 3 'undecided' 4 'agree' 5 'strongly agree'/
CONTINUE> m1 to m10 1 'strongly disagree' 2 'disagree'
CONTINUE> 3 'undecided' 4 'agree' 5 'strongly agree'.
SPSS> print formats exp mathatti (f2,0).
SPSS> oneway mathatti by school (1,3).
SPSS> regression width=80
CONTINUE> /dependent=compscor
CONTINUE> /method=enter mathscor.
SPSS> finish.

You can write the output to a file in your directory. To do so at the SPSS>, type:

    SET LISTING= 'clas.out'.

Replace 'clas.out' with your own parameter. Once this command is entered results from all the succeeding command will be stored in the file specified. For more information refer to SPSS Reference Guide.