## STAT 303, 503-504, Spring 1996 Prof. H. Joseph Newton Outline of Lecture 1

1. Go Over Syllabus

2. Introduction to StataQuest 4 for Windows

1. To Start the program, double-click on the `stat` icon from the program manager and then double-click on the `StataQuest` icon. To exit the program, double-click on the upper left corner of the StataQuest window or click on `file` and then `exit`. Before leaving the lab, you should always exit Stataquest. You must have a formatted high density, 3.5 inch diskette with you in the lab. You can only save files to the diskette.

2. To read a data set while in the lab (the automotive data for example), click on: `file`, then on `open`, then double-click on `d:`, then double-click on `wstataq`, then double-click on `datagen` (for `general data sets') or `stat303` (for Moore and McCabe data sets), then click on the data set name (`auto.dta` in our example), and then on `OK`. For our example, I will write this in shorthand notation as:
• ```File -> Open -> d: -> wstataq -> datagen -> auto.dta -> OK```

3. To list the observations in a data set (price and mpg for example):
• ` Summaries -> List data -> price -> mpg -> OK `
• If you see `-more-` on the screen, hitting the space bar gets the next set of observations, while hitting `q` stops the display of observations.

4. To get numerical summaries of variables (price and mpg for example):
• ` Summaries -> Means and SDs -> price -> mpg -> OK `
• This will display the names of the variables, and then for each variable the number of observations, the mean and standard deviation, and the min (smallest value) and max (largest value). For the price variable, this shows the min and max are 3291 and 15906.

5. To get a histogram for a variable (price from 3000 to 16000 with 10 bars, for example):
• ``` Graphs -> One variable -> Histogram -> Continuous variable -> price -> 3000 -> 16000 -> 10 -> OK ```

6. To get a scatterplot of one variable versus another (price vs. mpg, for example):
• ```Graphs -> Scatterplots -> Plot Y vs. X, with regression line -> price``` (for Y)` -> mpg` (for X)` -> OK`
• This will draw the scatterplot of price vs mpg and draw a line that best fits the points.

7. To print a graph (to the ACC) that is on the screen:
• `File -> Print Graph -> `Type some text to identify the plot is yours ` -> OK` (in the Graph Name box)` -> OK ` (in the Print box)
• The printout will go to the ACC where you can pick it up. There are a set of boxes for our lab that are numbered by the number of the PC you are using. What you type in the Graph Name box will be at the bottom of the graph so you can be sure it is yours.

8. To run the Random Sampling Concept Lab:
• `Labs -> Random Sampling -> Help -> ` Click on ` Sample` several times `-> Close`

9. To create a data set (to the file a:data1.dta, for example):
• Make sure you don't have a data set in memory already. If you do, enter the command `clear` in the command window.
• `Data -> Edit data -> `Use the spreadsheet editor to enter all your data` -> Close -> File -> Save as -> ` Type the file name (a:data1.dta in our example)` -> OK `
• Using the spreadsheet editor takes practice!

3. Homework (Due 1/25/96):

1. Moore and McCabe: Problems in Chapter 1: 7, 13, 16, 23, 56, 68, 109,119. All but the first three problems require the use of StataQuest. You don't have to type in the data as they are on the computer. See Item 2 above for how to read them into the program.

2. Run the Random Sampling Concept Lab, clicking on `Sample` 20 times. Read the help file while you are in the lab so you can see what it is doing. Print the resulting graph, being sure to enter your name as the optional text (see Item 7 above) so you can be sure to get the correct plot in the ACC.