Psychology 815: Introduction.
August 30, 1996


Introduction to SAS

Why SAS?

Given the popularity of SPSS in many psychology departments (including MSU), as well as the availability of other software programs like SYSTAT, some of you might be wondering why SAS was chosen for the statistics courses.

SAS was selected for several reasons. First of all, like SPSS, SAS is widely used by psychologists all over the country. Also like SPSS, SAS (windows) has a very user friendly, windows driven component (called SAS-Assist) that makes even complex analyses easy to perform. However, SAS is also more flexible than SPSS, allowing more experienced users to bypass SAS-Assist and write their own programs.

The first part of this course will familiarize you with SAS-Assist. Within a short time, you will find that you are able to run analyses such as correlations, regressions, T-tests, and ANOVAs with relative ease. As you gain expertise with SAS-Assist, some of the computer assignments will begin to require you to write some simple programs. By the end of the year, you'll find yourself flipping back and forth between SAS-Assist and simple programming, choosing one or the other depending on the task.

Finally, although SAS is more complex and is initially harder to master than SPSS, students have generally found it relatively easy to pick up SPSS once they were familiar with SAS. Going from SPSS to SAS, on the other hand, is usually not so easy.
 
 

SAS Display Windows

When you load SAS, you see a tool bar and pull-down menus at the top of the screen and two windows: Log and Program Editor. Look at all of the options in the pull-down menus. Some of them like "open file" and "save as" will probably seem familiar to you, if you have used a word processor. Other options like "submit" will probably be new to you. Don't worry, for now, if you don't understand what the options do, just look at them and try to figure out how they are organized. Notice, for example, that the "Globals" menu is always the same, but the "Locals" menu changes, depending on which display window your cursor is located.

 The Tool Bar: Everything that is in the tool bar can also be found in the pull-down menus.


The reason that these options are found on the tool bar is that they are all used very frequently, so play around with them, until you have a clear understanding of what each one does.

Log

This is the window that SAS uses to communicate with you. If you did something wrong, you will find error messages telling you what the problem is. Error messages are in red. SAS also tells you when you've successfully done something. For example, if you are trying to create a data set, SAS will tell you that a data set was created as well as how many variables and observations are in the data set. The Log will also show the program that was created by SAS-Assist. This can be a good way to learn how to program. For example, if you run a correlation using SAS-Assist and then look at the log, you will find the statement "PROC CORR" in the Log. This is the SAS term for the correlation procedure. Note that although when you "Submit" your program, you can see it in the Log, you cannot edit your program in the log. To edit a program, you must be in the Program Editor.
 

Program Editor

All programs are written, edited, or looked at in this window. When you open a previously written program, it will appear here automatically. If you want to start writing a program from scratch, you should do so in Program Editor. Note: SAS-Assist takes the place of Program Editor by accessing stored programs. However, these stored programs will appear in the Log only, not in the Program Editor.
 

Output

Although it is not on the screen initially, there is also a display window called "Output." This window automatically appears whenever you run an analysis. You can also access this window by clicking "output" in the "Globals" menu.