We will use as sample data set a portion of the data collected according to the explanation below:
At the UNIX prompt (generally this prompt is a %), type
mkdir sta110bThe command mkdir stands for "make directory" and creates a directory called sta110b one level down from your home directory (which is where you are immediately after you log in).
sas &The SAS program will generate about 4 different windows (toolbox, program editor, log, output). You will probably want to "iconify" the output window, which we won't need in this exercise. To do this, click on the dot in the upper right hand corner the window's title bar. The window will be reduced to small pictorial representation on the right-hand side of the screen. To get it back, double-click on it.
libname sta110b '~/sta110b';This tells SAS that it can store/read datasets from the directory we have just created. After entering this in the program editor, you need to submit this line to SAS. Either choose the running man icon in the toolbox window or choose submit under Locals in the program editor. The log window should contain a message to the effect that the "libref" (the library reference - "sta110b") was assigned successfully. If you don't see this message, an error has been made, and the following steps won't work correctly.
To read the data set into SAS, submit the following code. As you can see from the first line, the data set will be named ex1 and will be stored in the directory refered to by the libref sta110b (which is your newly created sta110b directory).
data sta110b.ex1; infile '~jls11/public/lab1.dat'; input when_buy $ minutes; run;So, the dataset is called ex1 and is stored in the library sta110b (which we have set to the directory sta110b). It has two variables called when_buy and minutes. The log window should tell us that there are 77 observations and 2 variables.
Go the command line in the toolbox window, type insight, followed by return. In the next window, choose the dataset you created; the data window containing your data set should appear.
Under the Analyze menu, choose the option Histogram. Click on MINUTES, then click on the button labelled Y. This means that the variable MINUTES will be treated as the response variable. Another window will appear with the histogram. Experiment with the gray arrow button at the bottom left of the histogram to see what you aspects of the plot you can change. You can close the histogram window by selecting End under the File menu.
Click on the arrow at the top left of your spreadsheet. Choose Define Variables, then the variable WHEN_BUY, and then click GROUP. The data will be grouped according to this variable's values when graphs are drawn. To see this, repeat the histogram-drawing procedure above. Now, you should obtain two histograms for the two groups, placed side by side. Notice the strange x-axis for the one of the histograms (negative tick marks). Fix this by using the relevant options with the histogram.
Click on the number to the left of a particular observation's number in the dataset window (the one that looks like a spreadsheet). Take a look at the histograms, and notice that the highlighted observation's position in the histogram is marked.
Under Edit, look on the cascading menu corresponding to Observations. Click on Find. Select the expression that represents "minutes greater than or equal to 98.2". The observations that meet this criterion will be highlighted in the data window. Go to any of highlighted observation number, and click on the black square to its left. From the popup menu, select Show in Graphs. Notice that the black squares have disappeared from the highlighted rows. Now, redraw the histogram and note that these observations are no longer there. While these rows are highlighted, you can use the option Show in Graphs on the same path as the Find option to re-include these observations.
Through the new Course Info system, a new course page has been set up at http://cinfo.aas.duke.edu/courses/STA110B.01-04-S2000. We'll try this software out this semester by posting assignments, lecture notes, etc. there. (We will not use all the features, so don't be surprised if some pages are empty.) Depending on student feedback and administrative ease, we may make a complete transition to Course Info as the semester goes on. Until then, all pertinent information will be on both web pages.
Every student registered for this course has his/her own username and password to log in to the Course Info system. You will need to follow these instructions (from Arts & Sciences Computing):
Make sure that you know how to find assignments, lecture notes, and general course info on these pages. Also, explore the Student Tools section, which contains some cool resources for students. You can make your own page (viewable by all of us associated with STA110B), set up your own calendar, and more.
To avoid comprimising your security, you must logout of the Course Info pages and exit from your browser (i.e. Netscape, Internet Explorer, etc.) completely when you are done!
While the cursor is on the background (not in the xterm windows, netscape, or the windows corresponding to any other program), click the left button. From the menu that appears, select Logout.
To preserve the security of your account (including your files and password), you must logout!