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.
To obtain a copy of the sample files:
- Launch a Web browser (e.g. Internet Explorer or Mozilla Firefox)
- Go to the URL: http://www.indiana.edu/~statmath/stat/sas/clas_win.sas.
- Save this as a text file (e.g. in Mozilla Firefox, right click on clas.dat and Save Link As... ) to a flash drive or C:\TEMP\ directory.
- Repeat for http://www.indiana.edu/~statmath/stat/sas/clas.dat.
To run the sample program file:
- Launch SAS for Windows
- Retrieve the program file by selecting File/Open
- 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 C:\TEMP directory, the INFILE command should be:
- 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 C:\Program Files\SAS\SAS 9.1\core\sample (replace "core" 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