Statistical Consulting Center - UMass AMherst
 

Home
Site Licenses
Computer Labs
OITUNIX
Direct Purchase

Statistical Software
Instructional Materials

What's New
Current Releases
Patches


Resources

BCCUMA

Datasets

Workshops

Online Docs
SAS 8.2
SAS 9.1.3
SIR 2002

Statistical Software > SPSS on OITUNIX > Using the SPSS Manager

Introduction to SPSS on OITUNIX - Using the SPSS Manager

SPSS 6.1 has a text-based user interface (called Manager) which enables the you to write, edit and submit SPSS commands, and view results interactively. If you are looking for an interactive interface to SPSS, the Xterminal (Motif) interface is preferable to the SPSS Manager. The only advantage of the Manager is that it doesn't require Xterminal emulation.

In order to use the manager, you must make sure your terminal is correctly set up. See Section I.

A. Starting SPSS

    When you start SPSS, the manager interface is automatically invoked:

    
    spss [Enter]
    
    

    You will get a screen with two windows:

    
    
    ------------------------------------------------------------------
    
    SPSS for OSF/1 Release 6.1
    
    University of Massachusetts/AM DEC Alpha OSF/1
    
    For OSF/1 University of Massachusetts SPSS ID 297825
    
    -----------------------------------------------------------------
    
     
    
     
    
    ---------------------------------------Ins------<ready> --
    
    Input Window
    
    

    The bottom half of the screen is the Input Window. It is blank, ready for you to type in your SPSS commands. The top of the screen is the Output window, where you will see the results of your analysis (or error messages).

    Begin by typing in the commands to read the minidat.dat data set and run Frequencies and Descriptives. The commands are the same as shown on pages 5-6. You must end each command with a period.

    
    
    
    DATA LIST FILE=minidat.dat FIXED/puls1 1-3 puls2 6-8
    
        run 11 smoke 14 sex 17 ht 20-24 wt 27-29 activity 32.
    
    MISSING VALUES puls1,puls2(0)/smoke sex(9)/.
    
    FREQUENCIES VARIABLES=run,smoke, sex, activity.
    
    DESCRIPTIVES VARIABLES=puls1 puls2 ht wt.
    
    
    
    
    Again, we are using UPPER case to show SPSS commands and keywords, and lower case for variable names and other items specific to this example. However, SPSS does not distinguish upper and lower case, so you do not need to be concerned about what case you use, except that filenames must be typed in the correct case. Continuation lines should be indented one or more spaces.

B. Editing

    1. Escape and control key combinations

      Most of the editing and control features of the SPSS Manager are accessed by using the Escape or Control Keys combined with various other keys. These combinations are abbreviated; examples:

      [CTRL]-A

      which means press the Control key and hold it down while you press the letter A at the same time.

      [ESC]A

      which means press the Escape key, release it, then press A.
      The escape key is [CTRL]-[
      The F11 key, which can be used as the escape in some other applications, may not work in the SPSS display manager, due to terminal set-up problems.

    2. Mini-menus

      Some key combination (usually [ESC] and a number) will get you a 'mini-menu' - a line at the bottom of the screen with several choices. You can always choose an item from the mini-menu either by highlighting your choice (using the arrow keys) and then pressing Return, OR by pressing the letter that is capitalized in your choice. If you want to get out of a mini-menu without making any choice (i.e. cancel the menu), press [ESC][ESC].

    3. Editing in the input window

      As you are typing your commands, you may need to make corrections in what you've already done. Here are the most frequently used editing sequences.

      Insert text

        The terminal is already in Insert mode (The Ins in the lower right corner of the screen shows this.) Using the arrow keys, move the cursor to the place where you need to insert text, and type the insertion.

      Replace text

        To switch to overwrite (replace) mode, press [CTRL]-G. (The Ins in the lower right corner disappears.) Move the cursor to the text you want to replace, and type over it. If you press [CTRL]-G again, you will be back in Insert mode.

      Delete Text

        Place the cursor immediately to the right of the text you want to delete, and press the <X| key on the VT320. (On other keyboards, this key may be labeled Del.)

        - or -

        Place the cursor on the first character of the text to be deleted, and press [CTRL]-D as many times as necessary.

      Insert Line(s)

        To make room for typing entire lines that you left out, move the cursor to the beginning of the line after which you want to insert lines. Make sure you are in Insert mode. Press [Enter], and a blank line will be added. Then you can type what you need into the blank line.

      Delete Line(s)

        Put the cursor on the line you need to delete. Press [ESC]4 to get the Lines Menu at the bottom of the screen. Press D to choose Delete; or use the arrows to highlight the word Delete,
        and press [Enter].

      Cursor Movement

        Use the arrow keys to move the cursor around the part of the input window that is on screen. For longer inputs, you can use:

        [CTRL]-O page up
        [CTRL]-L page down
        [ESC]< go to beginning of window
        [ESC]> go to end of window

      Moving or Copying Blocks

        Before moving (or copying) lines, you must mark the block you wish to move (or copy). To mark one or more lines, put the cursor on the first line you want to mark, and press [ESC]7.
        Choose Lines from the mini-menu. Now move the cursor to the last line to be marked, and press [ESC]7 again. All the lines in the block should now be highlighted, so the block is ready for you to move (or copy) it. Put the cursor on the line before where you want the block moved (or copied), and press [ESC]8 to open the Move/Copy mini-menu. Choose Move (or Copy) from the menu.

    4. Online manager help

      To get a complete list of the editing key combinations, press

      [ESC]1

      and choose Manager Help from the mini-menu.

C. Running the SPSS commands in the input window

    After you have typed and edited the four commands shown above, you are ready to run Frequencies and Descriptives. Place the cursor on the first command line, then press [ESC]0 to open the Run mini-menu. Choose Run from cursor.

    Note that 'Run from cursor' means just that; SPSS will only run the commands beginning with the current cursor position. That is why you had to first move the cursor to the first command line.

    As the commands are executed, messages will appear in the Output window. If you typed the commands correctly, the Frequencies and Descriptives results will also be in the Output window. If not, you will see some error messages.

    1. Switching and zooming windows to look at the output

      After the commands run in the Input window, the cursor automatically switches to the Output window. When the Output window is active, you can use the cursor movement keys ([CTRL]-O, [CTRL]-L, [ESC]< and [ESC]>) to page around in the output. Press [ESC]S whenever you want to switch between windows.

      If you want the window to take up the entire screen, rather than just half, press [ESC]2 to get the Windows mini-menu, and choose Zoom. You cannot switch to a different window when the active window is Zoomed. Press
      [ESC][ESC] to unzoom the current window.

      Two additional editing commands are useful for looking at lengthy outputs:

      • [CTRL]-U puts the current line at the top of the screen
      • [ESC]5 allows you to search (forward or backward) for a specified text

    2. Correcting errors

      If there are error messages in the Output window, you must switch back to the Input window ([ESC]S) and make the necessary corrections there. Then put the cursor on the first command line, and re-run the job ([ESC]0 and Run from Cursor).

    3. Additional statistics

      When the data definition and initial descriptive statistics have run successfully, you can add further statistical requests. For example, to run the Crosstabs and Means procedures, go to the end of the Input window, and add the following commands:

      
      
      
      COMPUTE pulsdiff=puls2-puls1.
      
      CROSSTABS TABLES=smoke,activity by run/CELLS=COUNT,ROW.
      
      MEANS TABLES=pulsdiff BY run BY activity.
      
      
      
      

      Since we have already run the commands in the beginning of the Input window, we do not need to re-run those; therefore, put the cursor on the COMPUTE command, then press [ESC]0 and choose Run from Cursor. This will run just the last three commands. The results of the Crosstabs and Means will be appended to the previous results in the Output window.

D. Saving the contents of a window

    You can save the contents of either the Input or Output windows to a file. To do this, make the window you want to save the active window ([ESC]S if you need to switch windows). Then press [ESC]9 to save the window to a file. You will be prompted for the filename you want to use.

    You should save the Input window whenever you expect to need the same or similar commands again. Otherwise, you will need to re-type the commands next time you need them.

    If you want to get a printed copy of your output, you must save the Output window to a file.

E. Ending your SPSS session

    When you are ready to quit SPSS, press [ESC]0, and choose Exit from the mini-menu. If you did not save your Input and Output windows, you will be warned, and will get another opportunity to save the contents of the windows.

F. Printing your output

    If you saved the contents of your output window to a file, you can now print it:

    lpr ofile [Enter]

      where ofile is the name of your output file. The printed output will be in LGRC room A106, in about half an hour.

G. Using an existing command file

    If you have a file which contains the SPSS commands you want to use, you can bring it into the Input window. If you give the name of the command file when you start SPSS, that file
    will be put into the Input window immediately. e.g.

    spss infile [Enter]

    will start the SPSS manager, with the file infile in the Input window. Or, if you want to bring a file into the Input window after you've already started SPSS, press [ESC]3.
    You will be prompted for the name of the file to get. You can then proceed to edit and run the commands in the file.

H. Summary of escape and control key sequences

    Menu Name KEYS Functions
    Information [ESC]1 Manager Help and Menus
    Windows [ESC]2 Switch, Change Size, Zoom
    Input Files [ESC]3 Insert File, Edit Different File
    Lines [ESC]4 Insert, Delete, Undelete
    Find&Replace [ESC]5 Find Text, Replace Text
    Go To [ESC]6 Area, Output Page, After Last Line Executed
    Define Area [ESC]7 Mark/Unmark Lines, Rectangle, or Command
    Area Actions [ESC]8 Copy, Move, Delete, Round Number
    Output File [ESC]9 Write Area or File, Delete File
    Run [ESC]0 Run Commands from Cursor, Exit SPSS

    Editing keys

      [ESC]< top of window
      [ESC]> end of window
      [CTRL]-O page up
      [CTRL]-L page down
      [CTRL]-U make current line the top line of screen
      [ESC], top of page
      [ESC]. bottom of page
      [CTRL]-G toggle Insert/Overwrite Modes
      [CTRL]-D delete character or join lines
      [return] Split line (Ins) or go to next line (Overstrike)
      [ESC]O Redraw Screen
      [ESC]! execute Unix command

      You can get this list of keystrokes on screen by pressing [ESC]1 and choosing Manager Help.


the previous section of this handout
the next section of this handout


© 2004 University of Massachusetts Amherst. Site Policies.