Special Materials: What do these look like and, how do they work?
Throughout the lesson pages links to special materials are included. The purpose of these special materials is to display examples or 'walk throughs' which will provide you with detailed or additional explanations of the concepts or the procedures that are referred to in the lesson. Some links, if you have your computer configured properly, will launch SAS and open these SAS programs automatically within your SAS application.
Viewlets
Within many of the Applied Statistics courses, the Inspect! button will open up a new window or viewlet. These viewlets contain animations or movie walk-throughs of programming code, output or other procedures.
Simply click on the Inspect! button to view this material. Your browser should already have the necessary Flash plugin necessary to view these materials.
Navigating the Inspect! ViewletsYou may navigate through the tutorial by clicking the Reset, Pause, Play, Back and Next buttons at the bottom of each page of the viewlet.
To pause the viewlet, click the Pause button.
To navigate quickly through the viewlet, click the Navigation Button
To go to the previous or next frame, click the Back |
Launching SAS programs
For efficiency purposes, the 'Launch SAS' button will download the relevant SAS program and open it automatically within the SAS application on your computer.
Configuring your browser so that downloads open your SAS application automatically
|
The process of installing SAS on your computer involves specifying and registering with your Windows operating system all of the file types that SAS will use within the SAS application. As a result, for example, SAS specific icons will appear where SAS files that have the '.sas' file extension are listed. The browser that you are using to display the lesson pages should also be able to distinguish these file types as well. The first time that you click on a link and begins downloading a file type that your computer or browser does not recognize, a dialog box will appear that will ask you whether you want to Open the file with a specific application, Save the file to a location on your computer, or Cancel the download. Be sure to select the option for opening all files that have the file extension '.sas' with your SAS application. This involves finding and selecting the SAS program through this dialog box. Once this configuration is set, any time you click on a link that is a SAS file having a '.sas' extension, it will automatically launch SAS (if it isn't open already) and then open the program within the Program Editor window of your SAS application. If you have you missed doing this the first time around you can still let your system know the prefered application you would like for a specific file type at any time. If the program code shows up in a separate window, use the File >> "Save Page As" option and Save the file to a location on your computer. Now, locate the newly saved file and right-click on it so that a dialog box similar to this appears:
The key selection here is the "Open With" option. If SAS does not appear on the list, then use the "Choose Program..." option. You should get a dialog box that looks like this:
Be sure to check the box that we have circled in red - "Always use the selected program to open this kind of file." You can test this using the 'Launch' button at the bottom of this page. Not to worry! If the configuration has not been specified, your browser will then display the formatted text of program in a new window. All you need to do in this case is to copy and then paste the text of this SAS program file into your SAS Program Editor window. Configuring your computer to do this automatically provides convenience. You always have access to the text of the SAS program of interest. |
Launching R programs
The R application is different computing environment than SAS. In R you can enter each line of code at the prompt in a more step by step approach. The R programs are all saved as simple text files and will be linked to open in a separate window so that you can copy this text or save the entire program to your computer. Here is an example program (soccer.R) that is used later on in this course. Here is a picture of what this program code looks like:

The ### symbols indicate a programmers comment. This text is not read by the R application. This program can either be copy and pasted into the R command line, line by line or as an entire program.
Here are a couple of other handy commands that you can use in R:
### to read the commands from a source file directly and to output it in |
Datasets
Datasets are presented within the context of the lesson, usually found in an example narrative as regular links. The links are to text files where the data is stored.
Data files include the file extension ".txt" and will open in a new window when clicked.
If you want to download and save this file to a specific location on your computer, right-click the link and select the "Save Link As" option (see right). A Save dialog box will be displayed and allow you to save the text file to the location you choose on your computer.
A Typical SAS Program Example
Here is an example from an early lesson of how these special links are incorporated into the lesson pages. Typically you will first find a picture of what the SAS program looks like. Below this graphic you will might also find an Inspect! button which will open a viewlet that will walk you through this program as well as its output. In addition, you will find the Launch SAS button that should automatically open up within SAS so that you can run the program yourself. (In this case the data are included within the SAS program itself and not provided via a link to a text file.)
Give them a try!

A Typical R Program Example
Here is an example to show you how the program above might be incorporated into the lesson pages. Typically you will first find a link to the program and the dataset if required. Below this link you might also find an Inspect! button which will open a viewlet that will walk you through this program and perhaps through the output as well.
Give this one a try!
|
required dataset soccer2002.txt (text file)
|
Remember - if you need help understanding a command or its syntax type either ?command, or help(command) and R will display the help available on this topic. For instance, here is what I got when I typed ?read.table:

Give it a try!
Please note: Certain functions in R may NOT run on all platforms (e.g., Windows, MAC, Linux, etc..) the same way. For example, you may get an error with sink() function on your PC depending how the read/write permissions are set up. It should not be a problem using it on Linux or a MAC, or if you run your R programs in a Terminal. In the Windows version of R, you can delete or comment-out the sink() function, and save your output by clicking on File/Save to file. You can also explore other options/functions such as file(), capture.output(), etc... Remember, you can always copy and paste your output from the console window into a seperate file.

