Sample Data Sets

So far we have looked at the SAS System to develop a basic idea of how SAS for Windows works. The next step is to examine a few other data analysis techniques that you might employ for your own data analysis. All the statistical procedures available from the SAS System under other operating systems are also available from SAS for Windows. Refer to the SAS documentation for further information.

The CLAS Data Set

The data set we discussed in our earlier example was designed to get you started. A more sophisticated data set and command file with statistical examples is available on the World Wide Web for you to download, peruse, and execute. The program file has many examples of the various procedures and commands discussed previously and you should probably read through this file closely to make sure you understand the syntax. Comments are provided throughout the program file which includes some statistical examples to demonstrate how these procedures work.

In this sample program file, you will read an ASCII data file, clas.dat, created with a word processor and saved as a text file, into the SAS session. The data collected from 40 middle school students contains 28 variables. The first four variables (id, sex, exp, school) are background variables. The variable sex has two levels (M=male, F=female). Exp (prior computer experience) has three levels (1=less than one year, 2=1-2 years, 3=more than 2 years), school (type of school system) has three levels (1=rural school, 2=suburban school, 3=urban school). The next 20 variables (C1...C10, M1...M10) are Likert type responses to a computer opinion survey, and a mathematics anxiety survey. The last four variables (mathscor, compscor, mattati, compopi) are scores on the math test, computer test, math anxiety score, and computer opinion survey score.

If you are interested in obtaining a copy of this data file you may copy it from the Stat/Math website (http://www.indiana.edu/~statmath).

To obtain a copy of the sample files:

  1. Launch a Web browser (e.g. Internet Explorer or Netscape)
  2. Go to the URL: http://www.indiana.edu/~statmath/stat/sas/CLAS.SAS.
  3. Save this as a text file (e.g. in Netscape go to File /Save as... and change Save File as Type to text) to a floppy disk on drive A.
  4. Repeat for http://www.indiana.edu/~statmath/stat/sas/CLAS.DAT.

To run the sample program file:

  1. Launch SAS for Windows
  2. Retrieve the program file by selecting File/Open
  3. Check to make sure the INFILE command corresponds to the location and name of your data file. For example, if the data file is called clas.dat and it is saved on a floppy disk in the a: drive, the INFILE command should be:
INFILE 'a:\clas.dat';
  1. Submit the command file by selecting Run/Submit.

Once you submit the commands, SAS takes you to the output window where you can review your results. You can scroll through the output by either using the PageUp or PageDown keys or the scroll bar. To print the results, click the printer icon on the toolbar.

Other Sample Files

A number of sample files are available for each of the SAS add-on modules. If you are working in a UITS Student Technology Centers, you may access the sample files during a SAS session by specifying the path R:\sas82network\SAS\base\sample (replace "base" with "stats" if you want to access SAS/STAT samples). You can also copy the files to your disk.


Next: SAS Data Sets
Up: Table of Contents
Prev: Writing and Executing a SAS Program