You may wish to work from a "personal subdirectory", which means you would routinely "cd" to a subdirectory other than your home directory. SPSS, however, can be invoked from any subdirectory. The examples below will assume that files are stored and/or written to the current subdirectory (i.e., the directory from which you invoked SPSS). (Files that are not stored in the current subdirectory may be used, but must be specified with the complete home directory pathname. At present, the ~/, or tilde-slash, convention does not work in SPSS, but in most situations you can use the alternative $HOME to stand for your home directory. See below for more information and examples.)
SPSS under UNIX offers a tutorial, which was printed in a previous version of the UNIX Operations Guide (a manual which is now obsolete). The tutorial makes use of files which we have stored in /usr/usc/spss/tutorial. USC users can get a copy of the tutorial pages from the Statistics Consultant through the User Services office in LVL Lower Commons (213/740-5555).
In the SCF, users of this (or any) statistics software need to add the following lines to their .login file:
if (-e /usr/usc/stats/setup.csh) then
source /usr/usc/stats/setup.csh
endif
SCF and RCF users whose .login or .cshrc files are non-standard or who once had setup files for one or more specific statistics packages sourced in .login or .cshrc may need to fix their .login or .cshrc files to eliminate redundancy and/or to allow the system's automatic setup to take effect. For example, users on the RCF may have modified their .login or .cshrc to such an extent that the system's automatic setup is bypassed. These users can either restore the system's automatic setups (recommended) or add the lines shown above (which are usually only necessary for SCF users). Please call UNIX consulting (see last page) for help with these files.
set term=vt100
and SPSS will be able to function normally.
Under X-Windows, you have the choice of the character-based manager
(the command is spss +m) or the full (and rather slow)
X version (the command is spss).
If you choose the character-based manager running in an Xterm (or Terminal)
window, you should choose vt100 or xterm
as your terminal type.
The ITS consultants can help you set your terminal type if you don't know how. If you need to set a different UNIX terminal type, go ahead and try it, and if SPSS works then you're OK. If it doesn't, just call the consultants, and we will set up the necessary system files to make your terminal type work properly. (This may require an appointment with a member of the full-time consulting staff.)
spss +m at your UNIX prompt.
SPSS will load in its full-
screen interactive processor called Manager (the Input, or
editor, and Output Windows), and will put your cursor in the
Editor (the bottom screen) in Edit mode. Here, you may enter the
Menu System (ESC-m) and build your programs from the menus,
remain in Edit mode and type your programs yourself, or bring in
programs stored in external UNIX files. The available online
help is described below.
There are many "switches" you can use to do various things with your SPSS session, and these are documented in "man spss" and in the User's Guides (see "Help Documentation" below), but one deserves mention here. SPSS sets up its session with a default amount of working memory (512K bytes) but this can be raised by the user if necessary. (Usually this becomes necessary when you see a message during a session that a command or procedure needs more memory.) This is done with the "-s" switch (-s for "space"), followed by a designation in bytes or Megabytes of the amount of memory desired. Example:
spss -s 7m
requests that an SPSS session begin with 7 Megabytes of working memory.
To invoke the SPSS Batch Facility (Version 11.x), first source the setup file:
source /usr/usc/spss/11.5.1/setup.csh
Then use the spssb command followed by the name of your
syntax file:
spssb myprogram.sps
In order to run the X version of SPSS, you must have an X window manager running on your computer. For MS Windows, you can run XWin32 or Micro-X, and on a Macintosh you can use Mac-X. XWin32 and Mac-X are available on the computers in the Public User Areas XWin32 also is available for download from the ITS Software Download site. The Consultants can help you obtain and use XWin32, and the ITS Web site has XWin32 documentation. Mac-X is not available for download, and must be purchased by the user.
On UNIX workstations, the X window software can be CDE,
Sun OpenWindows, or MIT X Windows, among others.
In this environment (X Windows on a UNIX workstation),
to run the X version of SPSS, you need to open a window
and make sure the DISPLAY variable is set to your local machine.
At USC, the best way to get to the host where SPSS will run is to
use the ssh (secure shell) command.
This command opens a new window, encrypts the transmission between
your machine and the host that will run SPSS,
and sets the DISPLAY variable to
the same setting as the window (or console) from which the
ssh command was typed.
In general, the following steps will prepare the way for your SPSS
X Windows session (the example uses almaak, but you may
substitute the name of any machine that can access SPSS):
First, make sure the DISPLAY variable is set to your local machine in
the window where you'll type the ssh command.
Type echo $DISPLAY, and if you do not see 'undefined
variable', then you should be able to proceed successfully.
If you do see 'undefined variable', then define the DISPLAY
with some form of the following command:
where "machinename" is the name or IP address of the workstation you
are using. Here are two examples of how this command might look:
setenv DISPLAY <machinename>:0
(Of course, cabernet or 128.125.999.999 in the above examples
would be replaced with the
actual name or IP address of your machine.)
setenv DISPLAY cabernet:0
setenv DISPLAY 128.125.999.999:0
To learn the IP address on a UNIX workstation, go to the console window and type:
sysinfo | grep AddressTo learn the IP address of a Windows PC running NT, click on Start>Programs>Command Prompt and type:
IPCONFIGTo learn the IP address of a Windows PC running Windows 95 or 98, click on Start>Programs>Command Prompt and type:
WINIPCFGTo learn the IP address of a Macintosh, click Apple Menu>Control Panel>TCP/IP, and the IP address will be shown in the middle of the box.
Now, to open the window in which SPSS will be invoked, at your local machine (e.g., the console window), type:
ssh almaak
This opens a window on remote almaak with the DISPLAY set to
your local machine.
Of course, if your account is in the SCF, you would substitute
aludra in the above command.
The following command
spsswill then launch the X-window version of SPSS.
SPSS Under X-Windows is documented in the Base System User's Guide (UNIX portion) (see documentation list below).
The X-Windows (motif) version of SPSS is the default at ITS. If you are not capable of X-Windows, or prefer not to run it, you can run the character-based SPSS session by typing
spss +m
(In the X-Windows version there is no command-building Menu system; instead, you make point-and-click choices and, if desired, you click 'Paste' to ask SPSS to write the program for you in the Syntax Window.)
The functions necessary to use the Editor, including moving and deleting text, moving to the upper (Log) window and back, bringing external DOS files into the editor, writing the contents of the editor out to DOS files, and running the programs you write (or build) in the editor, are listed in the Manager Help screen, which is accessed (in most terminal types) by typing ESC-1 or its equivalent (such as F1, PF1, and so forth). ESC-1 brings up a mini-menu at the bottom of the screen in which the first of several choices -- Manager Help -- is highlighted. Hitting return chooses this highlighted item, and you get the Manager Help screen, which also inclnudes the keys that will help you to use the Menus. If you want to choose any of the other choices in the mini-menu, move the cursor to the right with CTRL-F or to the left with CTRL-B until your choice is highlighted, then hit RETurn. To see a screen listing the cursor motion key sequences and certain miscellaneous functions, once you are in Manager Help, type ESC-R. To leave any screen, hit ESC (or, in Manager Help, ESC ESC).
By default, you are placed in Edit mode, which allows you to type in your program yourself without the help of the menus. To enter Menu mode, type ESC-M. Menus will appear in the top half of the screen, with Menu items to the left and more detailed explanation of each item to the right. You can scroll down the Menu items using CTRL-N (to scroll back up, use CTRL-P), and as you do so each item is highlighted in turn. As each new item is highlighted on the left, the explanation field on the right changes accordingly.
Menu items in lower case are usually the name of another menu at the next level, and you will notice a right angle bracket to the right of most of these. Choosing such a lower-case item with the RETurn key moves you to that next- level menu. Menu items in upper case are actual SPSS commands, and choosing such an upper-case item with the RETurn key pastes the item in the editor below. If you are at any level of the Menu system and you wish to go back to the top level, ESC will take you back. Moving "down" and back "up" in the menu structure also can be accomplished by using the right cursor (CTRL-F) to go "down" a level, or the left cursor (CTRL-B) to go "up". Note the difference between using RETurn to go to a lower menu, and using the right cursor: if the Menu item highlighted is also a command (i.e., is in capital letters), RET would paste that item into the editor, while right cursor (CTRL-F) would not. To leave Menu mode, and return to Edit mode, type ESC-E.
Of course, UNIX is a case-sensitive system. When file names are specified in an SPSS program, the names must match exactly with respect to spelling as well as upper-lower case.
If you type or modify programs in the editor, you may save them to external files by typing ESC-9 (or sometimes F9) (which will bring up a mini- menu on the bottom of the screen) and choosing "Write File" by moving the cursor to the right (CTRL-F) and hitting Return when the "Write File" choice is highlighted. This will bring up a small window at the bottom where you may type the name of the file in which you wish to save your program.
In the X-windows version of SPSS, to perform these operations you click the File menu, then choose the appropriate operation from the list that appears.
There are two main classes of SPSS commands: Data reading/manipulation commands, and Analysis commands. The data reading and manipulation commands are used to convert raw data, or data entered in other types of software (e.g., dBase, Excel) into an SPSS Active File. The Analysis commands are used to analyze the data that has been prepared in the Active File.
It is crucial to understand that Analysis commands can only access (analyze) data that have been converted into an Active File, and that there can be only one Active File at any given point in an SPSS program (or SPSS interactive session). Another key point is that all data needed for an Analysis command must be in the active file at the same time. SPSS Analysis commands cannot access data in two different places. If necessary, system files (or combinations of system files and the Active File) must be merged into one Active File prior to running an Analysis command.
DATA LIST [FILE='<file name>'] [FREE]
/ <list of variables>.
When this command is successfully run, SPSS creates the Active File -- which is a system version of your original data -- and unless replaced or modified by later commands this is the version of your data which all later commands use and analyze. In Windowing environments, the Active File appears as a spreadsheet in the Data Window.
Raw data may be entered in a separate (external) file or in- stream. If data are entered in an external file and a program (syntax) is being used to read them in, the FILE= keyword is necessary on the data list command to tell SPSS where to look for the data. If a point-and-click method is used to read in data, the process is guided by a Data Entry Wizard invoked by clicking File>Read Text (or ASCII) Data.
Example of DATA LIST using raw data in an external file:
data list free file='my.data' / idnum height weight iq.
If the data are entered in-stream (i.e.,
in the program itself along with the commands and subcommands),
there is no FILE= keyword and the commands BEGIN DATA and END
DATA are placed before and after the actual raw data as it
appears in the program just after the DATA LIST command.Example of DATA LIST using in-stream entry of raw data:
data list free / idnum height weight iq.
begin data.
1 52 105 98
2 61 184 102
3 47 89 110
4 53 112 87
end data.
Occasionally people will create (or otherwise obtain) data files
with records longer than the default LRECL (Logical RECord
Length) of 1024 bytes. When this is the case, SPSS must have
instructions to read a longer record, and such instructions are
given in a FILE HANDLE statement. The FILE HANDLE is a
"nickname" that is used in place of an actual file name when raw
data are being read into a DATA LIST command.
In the following example, the file "lrecl1500.data" (which has a logical record length of 1500) is assigned to the FILE HANDLE "toolong", which is then used in the DATA LIST command in place of the actual file name.
file handle toolong / name='lrecl1500.data' lrecl=1500.
data list file=toolong / var1 1-5 var2 456-458
var3 1362-1365.
Sometimes a raw data file will have data on more than one record
(line) for each observation.
In some such cases it is necessary to use FIXED (the default) format,
and enter a RECORDS keyword in the DATA LIST command, then put a
slash ("/") between the variable names for each line.
The following example has data on three records for each observation,
showing how to construct the DATA LIST command.
10001 785
42 55 38
2854
10002 775
98 54 26
3864
10003 685
73 18 43
2754
<etc.>
data list file="d:\threelines.txt" records=3 /
var1 1-5 var2 7-9 / var3 1-2 var4 4-5 var5 7-8 / var6 1-4.
SAMPLE: data in the file "D:\threelines.txt":
Another method of writing out raw (ASCII) data from SPSS is through the use of the WRITE command in a Syntax window. Those variables listed in the WRITE command are those which are written to the output raw file. Of course, SPSS needs to know what file to put the raw data into, and this is specified by the OUTFILE= subcommand.
Suppose you have an Active File (or an SPSS Save File which you have brought in to an Active File in an SPSS session) that has 100 observations, and ten variables called:
ID SEX AGE RACE TEST1 TEST2 HEIGHT WEIGHT IQ INCOME
Now, you want to create an ASCII (raw) file containing only three of those variables. This is how your program might look (the OUTFILE subcommand example is for the Windows environment; modify accordingly for use on UNIX or Macintosh files):
write outfile='c:\user\rawvals.dat' / id ' ' test1 ' ' income.
execute.
The example above includes a blank column (' ') between each value that is written out. This is not necessary, but if these blank columns are not specified, some values may be written next to other values without spaces in between. Most software can read ASCII data either with or without spaces between values, but usually it is easier to read ASCII files with spaces between values, commonly called "Space Delimited Data". The example above will create (or overwrite) a file called rawvals.dat in the specified directory (folder), and the file will contain all the values for ID, TEST1 and INCOME, separated from the other values by a single space.
If you have a large number of variables and you want all of them output to the raw file, you can use the WRITE command with the word ALL after the slash, as in:
write outfile='c:\user\rawvals.dat' / all.
execute.
For more details on the WRITE command, please consult the appropriate manual listed at the end of this document.
An example of an analysis command is DESCRIPTIVES.
One keyword of the command is VARIABLES=, and one
of the subcommands is STATISTICS=.
A program that asks for VARIANCE and SKEWNESS statistics
might look like:
descriptives variables=height weight /
statistics=variance skewness.
SAVE OUTFILE='SAVEfile name'.
This creates a permanent file containing the System version of your data (called an SPSS Save File), which can be used to re- create the Active File in later SPSS sessions by clicking File>Open, or by using the following command:
GET FILE='SAVEfile name'.
When an SPSS Save file exists on disk and is called into an SPSS session with File>Open or the GET command, there is no need to run a DATA LIST command or to read raw data, unless your original data have changed in some way and need to be updated.
In character-based (i.e., non-X-Windows) versions of SPSS, you can save the Output window to a file when you go to that window, hit ESC-3 (or F3 in some versions), choose 'Write File' from the mini-menu at the bottom of the screen, and then specify the file name where you'd like to store the contents of that window.
To see a list of printers known to UNIX, type printers
at your UNIX prompt. The printer "code" will be shown
in the leftmost column.
To print a file on one of the UNIX printers, use the lpr
command with the -P switch, as in the following
example, which prints "my.file" to the printer
in UCC 101 (the UCC Distribution Area):
lpr -Pps_ucc101 my.file
NOTE: ps_ucc101 is used only as an example; this probably is
not the most convenient printer for most users.
Some printers are configured for PostScript only, and
will not accept text-file input from the
lpr command.
In this case the enscript
command (which converts text to PostScript)
should be used instead, as shown here:
enscript -Pps_ucc101 my.file
To print output that is more than 80 characters wide, many
printers will require that you rotate the orientation of the page
to "landscape" (the default usually
is "portrait") and often you
will also need to reduce the font size to get all 132 columns on
the page without wrapping. This can be accomplished with the
enscript command followed by the
-r (rotate) option and the -f
(font specification) option.
One font that has been tested for wide output is Courier9,
though others may work as well. The following will print
wide output (132 characters per line) without any wrapping or
truncation:
enscript -Pps_ucc101 -r -fCourier9 file.nameYou can also download your output (or any file) to a PC or Mac, and print on a local printer, if you prefer. The consultants have documentation on how to download files.
If your program resulted in errors or warnings, or if you wish to continue building or writing your program, you will need to return to the Editor either to revise your program or to add more commands. To do this, hit ESC-2 (or, in some systems or emulations, F2), which brings up a mini-menu at the bottom of the screen in which "Switch" is highlighted. Hitting RETurn chooses "Switch", and your cursor returns to the bottom screen where you can continue working with your program.
/tmp Space/tmp space, similar to
their own disk file quotas, so this may not solve SCF users' problems
completely. RCF users also have /tmp space quotas, and can request
increases from ITS as necessary.
The space is in a subdirectory called /tmp (and, on some
systems, /tmp1, and so forth;
enter ls -ld /tm* to see them all).
For descriptions and policies related to shared /tmp
space, scroll to Section 7 in the following page:
http://www.usc.edu/its/policies/procedures/
Anyone can write in the shared /tmp spaces, create subdirectories in
them, and in general manipulate files as you would in your home
directory.
You should be aware that files stored in /tmp are not
permanent, and will be deleted by the system on the regular
/tmp cleanup schedule. This schedule is different for different machines
and /tmp areas, but the bottom line is that your files will
go away.
/tmp) if they are used.
Users are urged to compress any files larger than 20 Mb if they
are not being used for long periods of time. The amount of time
it takes to compress or uncompress files is minuscule, and much
space will be saved by this operation.
To compress a file in UNIX, use 'compress'; to uncompress a
compressed file, use 'uncompress' or 'zcat'.
In the following examples we compress a file
called test1.bigfile, which results in a
compressed file called test1.bigfile.Z:
compress test1.bigfile
Either of these commands results in an uncompressed file:
uncompress test1.bigfile.Z
zcat test1.bigfile.Z > test1.bigfile
The 'zcat' command, shown above, normally is used for viewing files, but with the use of the redirect, can re-create files from their compressed versions. While the 'compress' and 'uncompress' commands use the previous names (with the addition or deletion of the .Z extension), 'zcat' can redirect the compressed file into an uncompressed file of any name.
data list file='/tmp/mydir/raw.data'
/ <variable list and specifications> .
save outfile='/home/almaak/thisuser/spsssave/saved.file' .
This would leave the space available within your quota free of the large raw data set while SPSS is creating and saving the permanent SPSS save file.
By default, SPSS allocates 512K of main memory for your session and its tasks. You can increase this working memory by invoking SPSS with the -s switch followed by a number with K (kilobytes) or a number with M (megabytes). For example, if you wanted to invoke SPSS in a 5 megabyte workspace, you would type
spss -s 5m
at the UNIX prompt.
There are several useful techniques for dealing with large jobs that take a lot of time. You can run your jobs in batch mode, rather than interactive. This avoids using any memory that would be necessary for interactive mode. You can run your batch job in the background (by placing an ampersand [&] at the end of the command-line invocation), which allows you to logout while the job finishes, if you wish. (Running a job in the background also allows you to avoid timeout problems associated with long periods of terminal inactivity when you are connected via a micom line or modem.) And you can queue your job to run at a later time, when the system is likely not to be so busy.
spss) followed by the name of that file:
spss -m < my.prog1
To run this batch program in the background, simply put an ampersand (&) after the file specification:
spss -m < my.prog1 &
When you have done this, you can perform other tasks in the foreground, and if you wish, you can logout and your job will continue to completion.
To run SPSS (Version 11.x) in batch mode, you first need to source the setup files for Version 11:
source /usr/usc/spss/11.5.1/setup.csh
then run the invocation command (spssb) followed
by the name of your syntax file:
spssb my.prog1
To run this batch program in the background, simply put an ampersand (&) after the file specification:
spssb my.prog1 &
at
and qsub Commands
www.usc.edu/hpcc/systems/use-l-4.php
To queue your job to run at a later time, you can use the at
UNIX command. This requires that you place your invocation command and
all other specifications (such as the filename of the program and
any options or switches) into an executable shellscript file, and
then specify the executable in an at
command, such as
at 2:30a < execthis
where execthis is an executable shellscript you have created.
(Of course, the name execthis is arbitrary, and can be any
filename you choose.)
Let's say you have a statistics package called THYSTAT
(for those who take documentation literally, note that this
is a mythical package name, for illustration only), and
your THYSTAT program is contained in myprog.thystat1
which you keep in your home directory (~/) in a subdirectory
called programs.
Part of the peculiar syntax of THYSTAT is that before the
batch file name, you use a switch spelled -in.
For whatever reason, you wish to run your program late at night.
To make an executable shellscript to run your batch program, enter the
following into a file called execthis :
#!/bin/sh -f
thystat -in ~/programs/myprog.thystat1
chmod u+x execthis
You can then run the at command, as shown above, and specify
any time you feel would be best to run your job. For more
details on the at and chmod commands, see the man pages or
call the consultants.
qsub Command and the PBS System qsub command,
which sends a request to the Portable Batch System (PBS).
RCF users normally can use the qsub command
automatically.
If it is not immediately available, run
source /usr/usc/pbs/default/setup.csh man pbs and
man qsub for complete online help
information.
Another helpful man page is man pbs_resources_linux
which details the resource options (e.g., walltime, cput [cpu time],
etc.) available for the qsub command.
The qsub command itself runs a script file, and
inside the script file is the batch invocation of the software
you wish to run (along with any other appropriate UNIX commands.
qsub also writes to a LOG file that you specify,
so you can see the STDIN and STDOUT messages associated with the
running of your queued job. The general form of the qsub
command is
qsub <flags> SCRIPTFILE
Once again, as in the example above,
let's say you have a statistics package called THYSTAT
(this is just a mythical example, to be substituted with
whatever real command name and syntax you want to queue)
and your THYSTAT program is contained
in myprog.thystat1
which you keep in your home directory (~/) in a subdirectory
called programs.
Part of the peculiar syntax of THYSTAT, let's say, is that before the
batch file name, you use a switch spelled -in.
Normally, you would run it in batch as follows:
thystat -in ~/programs/myprog.thystat1
In order to queue it with qsub and have the system
run it later, you would create a qsub-appropriate SCRIPTFILE
containing at least one line with a pound symbol ( # )
followed by the invocation of your software program, as shown
above. Let's say you decide to put this into a file called
my.qsub.script.
The contents of that file would be
#!/bin/csh -- a line beginning with # must begin the script file
thystat -in ~/programs/myprog.thystat1
(Once again, remember that thystat is a bogus
name, for example purposes only, and needs to be substituted
with a real command name and syntax of your choice.)
The following command would queue your THYSTAT program for execution at a later time chosen by the system.
qsub -m be -k eo my.qsub.script
where -m be asks NQS to broadcast a message (i.e., to tell you)
when the request ends execution; -k eo
tells qsub to keep the STDERR and STDOUT output.
A number of other flags are available, as listed in man qsub
(remember to source the pbs setup file as shown above).
Many flags can be incorporated into the script file itself.
For example, if you want your program always to report the
results to your home directory, the -k eo flag may be
entered into the file.
Also, directions as to how much time to allow (walltime),
how many nodes to use (nodes), and how many processors
to use (ppn).
If you want your job to run on the main rcf-01 processors,
you can specify that in a separate nodes instruction
(as shown in the example).
Following is a sample (and simple!)
script file that includes these requests. (The ls
command is used as an example of a simple program that returns
a detailed listing of the files in your home directory.)
#!/bin/csh -- any text here
#PBS -k eo
#PBS -l walltime=2:00:00
#PBS -l nodes=rcf-01
#PBS -l nodes=1:ppn=1
# run the program
ls -la ~/
exit
IMPORTANT NOTES:
nodes= must always be 1 when submitting
jobs to rcf-01, as the facility is configured as a single node.
/export and /auto
must not be used.
Instead, use the form /home/rcf-nn/username, where
nn is the number of the file system partition where
the files are stored, and username is
the username of the home directory where the files are stored.
qsub
command will execute within a few minutes,
though in some cases it could be delayed until the system is relatively
unbusy at night.
setenv SPSSTMPDIR ~/
and invoke SPSS as usual.
ls /tmp*). This way SPSS can use the large space of /tmp
or /tmp1 for its sort scratch files. To do this, type
cd /tmp (or cd /tmp1)
then invoke SPSS as usual. Note that whenever you use external program or data files in this situation, you will have to specify them in your SPSS program with the full path name beginning with /home unless they have been copied to /tmp or /tmp1 before you invoke SPSS. Remember to delete files from /tmp or /tmp1 when you are finished, to free this public space for other users.
Other help documents may be read online (and/or printed) by issuing the INFO LOCAL command in SPSS (type it in the Editor followed by a period, and Run it, like any other command) or by typing "man spss" at any UNIX prompt.
The primary documentation for SPSS on UNIX are the standard SPSS V4.0 and V5.0 user manuals (which discuss the aspects of SPSS which are the same across systems, such as the language syntax for data reading and statistical analysis), plus the small, spiral-bound SPSS for UNIX: Operations Guide, which details the information that is UNIX-specific. These are listed at the end of this document.
To EXPORT your system data for use elsewhere, make an Active File (either by reading raw data with a DATA LIST command or by using a GET command to bring in a previously saved SPSS system file), then issue the following:
EXPORT OUTFILE='<UNIX file name>' .
This creates an ASCII file which you can ftp to another system, or write to tape for transport to another location and/or system. To IMPORT a file that has been EXPORTED previously, issue the following (anywhere, even at the very beginning of a session):
IMPORT FILE='<UNIX file name>' .
You will then have an Active File for use during your current session, and you can SAVE it to an SPSS system file or issue analysis commands on it.
HOST.
in the Editor, and run this command as you would any other (ESC- 0, then RETurn). You will be placed at your UNIX prompt. When you are finished doing what you need to do, type CTRL-D and you will see a prompt to hit RETurn to go back to SPSS.
While you are in SPSS, if you want to issue a UNIX command but don't necessarily need to exit SPSS to do it, you can pull up a special window which will accept and execute UNIX commands without leaving SPSS. To activate the special window, type ESC-! (that's the ESCape key and the exclamation point, which is SHIFT-1). Depending on what command you have issued, you can resume SPSS processing by hitting return or, in some instances, by typing CTRL-D.
To test the Chart facility, begin an SPSS session under X-windows, then run the following program to create an active file (you can also use the GET command, if you have a save file from a previous SPSS session):
DATA LIST FREE / VAR1 VAR2.
BEGIN DATA.
234 1
432 1
325 2
543 2
437 2
874 2
375 3
934 3
225 3
END DATA.
Now, ask SPSS to graph the data in a pie chart:
GRAPH PIE=MEAN(VAR1) BY VAR2.
This will create a graph on your terminal screen.
Printing an SPSS graph to paper is done through the File>Print menus. To send a graph directly to the printer, click File>Print, then click the Setup button, make sure the Print to File Only button is not selected, enter the printer name in the Printer field, then click Continue, then (on the original Print window), click OK.
To send the graph to a PostScript file for later printing
(e.g., with the UNIX lpr command), go to the
Chart Carousel, then click File>Print.
In the Print:SPSS window, click the Setup button, then in
the Chart Printer Setup window, choose Postscript (either
Landscape or Portrait), click on Print to File Only, and
fill in the desired file name.
When you click on Continue, the Print:SPSS window will reappear,
with the chosen filename referenced at the top.
Finally, when you click OK, the file will be created.
To print the file to a PostScript printer, you can use the
UNIX lpr
command as in the following example which prints a PostScript
file called grafile.ps to the printer in UCC:
lpr -Pps_ucc101 grafile.psThe use of the Chart facility and the GRAPH command within SPSS are documented in the References listed below.
Since graphical representation is an important part of this package, it is recommended that you use the X-Windows version of SPSS under UNIX if at all possible when using Trends procedures.
To run a demonstration program of the Trends package,
start SPSS release 6.1 or higher and 'include' (ESC-3)
the file /usr/usc/spss/default/demo/demotrd.sps
into the SPSS Manager, or run it as follows:
spss -m /usr/usc/spss/default/demo/demotrd.sps > trends.out
/usr/usc/spss/default/demo/demotrd.refto see if everything operated correctly.
1 2 3
+---+---+---+
f | 6 | 8 | 1 |
+---|---|---+
m | 4 | 5 | 6 |
+---+---+---+
Simple or complex tables
can be constructed using nesting and stacking techniques,
and values represented can be data points or calculated summaries.
To run a demonstration program of the Tables package,
start SPSS release 6.1 or higher and 'include' (ESC-3)
the file /usr/usc/spss/default/demo/demotab.sps
into the SPSS Manager, or run it in batch mode
Note that when running demotab.sps in the Manager, you will need
to delete all lines that begin with /****
before you run the program.
These are comment lines, and the interactive Manager doesn't
process them correctly.
To run the program in batch mode, do the following:
spss -m /usr/usc/spss/default/demo/demotab.sps > tables.out
/usr/usc/spss/default/demo/demotab.refto see if everything operated correctly.
Categories
/usr/usc/spss/default/demo/democat.sps
into the SPSS Manager, or run it as follows:
spss -m /usr/usc/spss/default/demo/democat.sps > categories.out
/usr/usc/spss/default/demo/democat.refto see if everything operated correctly.
/usr/usc/spss/default/demo/
designed to works in works in
programs demonstrate batch? interactive Manager?
---------------------------------------------------------------
demoadv.sps Advanced Stats OK OK
demobase.sps Base OK may crash your session
democat.sps Categories OK OK
demoprof.sps Professional Stats OK OK
demotab.sps Tables OK needs minor editing
demotrd.sps Trends OK OK
To run a demonstration program in the interactive SPSS Manager,
start SPSS release 6.1 or higher and 'include' (ESC-3)
the file /usr/usc/spss/default/demo/<demoprogram>.sps
into the SPSS Manager.
The <demoprograms> available are listed above.
For example, to run the Professional Statistics demo, use the
demoprof.sps file.To run a demonstration program in batch mode, use the following command syntax:
spss -m /usr/usc/spss/default/demo/<demoprogram>.sps > results.out
spss -m /usr/usc/spss/default/demo/demoadv.sps > results.out
/usr/usc/spss/default/demo/<demoprogram>.refto see if everything operated correctly. Again, the list of <demoprograms> available is shown above.
ps -ugx
(The
ps command on various systems may need options
different from -ugx to get the desired results;
check with the consultants if you have questions.)
This shows a list of your processes, like the one below (some
columns have been left out to save space):
USER PID %CPU STAT START TIME COMMAND
janedoe 6393 7.9 R 18:05 0:00 ps -ugx
janedoe 6256 0.0 IW Sep 2 0:02 -csh (csh)
janedoe 4659 0.4 S Jan 3 210:00 /usr/usc/spss-4.1/spss
If you see something under COMMAND that has SPSS in it, this means a process involving SPSS has been running for the amount of time under TIME. If you don't want any SPSS processes to be running, you should kill the process by issuing the following command:
kill -9 4659
which "kills" process number 4659. Please check your processes daily to guard against overuse of the machine by unintended processes. This is a courtesy to other users, besides being in your best interests.
Current schedules for User Services Classes (also called "Hands-On Workshops") are listed on the Web at:
http://www.usc.edu/libraries/adventures/Any Statistics Software class can be taught when groups of five or more users request them. Other ITS Classes by special arrangement may require a minimum of 10 attendees. Classrooms must be arranged by those requesting the class. Contact the User Services office for details, or visit
www.usc.edu/its/doc/statistics/help/classes/requests.shtml
Consulting. The ITS Consultants may be familiar with the language and general operations of this software, but it may be necessary to make an appointment with a member of the full time staff in order to receive detailed help. Support of statistics software is the responsibility of the ITS Statistics Consultant with the participation of other full-time ITS staff. These people may be contacted through the ITS Customer Support Center as shown here.
Customer Support. USC students, staff or faculty who would like information about ITS Workshops or about obtaining site-licensed software or other computing-related questions should visit the Customer Support Center in Leavey Library Lower Commons, or call 213.740.5555, or send eMail to <consult@usc.edu>
Documentation. This document, and many others on a variety of topics, are available in the ITS Customer Support Help System, available on the World Wide Web at:
http://www.usc.edu/its/
You can find Statistics Software Help Documents through the search engine at this same URL, or go directly to them at:
http://www.usc.edu/its/doc/statistics/help/
Newsgroups. Another source of information, this one providing the opportunity to exchange thoughts with other users, is the newsgroup 'usc.comp.all.stat.users'. For more information about reading news, subscribing to newsgroups, and related topics, visit
http://www.usc.edu/its/doc/internet/news/