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

### Free Time in the Computer Lab

• M-F 5-7pm, Sat 2-5pm, Sun 4-7pm

### First Homework Assignment

• Due Monday 1/29/96.
• For all but the first 3 problems you must hand in annotated computer printouts.
• You only need to do parts a-c of problem 119.

### Getting Disks for Home Computer

• Starting after lab today, see Eston in the Stat Department office (447 Blocker) to get disks containing updated executable as well as Moore and McCabe data sets and concept labs.
• You must bring 2 blank formatted disks and your original StataQuest disk.

### Clarification of Chebychev and Empirical Rules

• Chebychev's Rule states that at least 75%, 89%, and 94% of the elements of a population are within 2, 3, and 4 standard deviations of the mean.
• The Empirical Rule states that for normal (bell-shaped) populations, approximately 68%, 95%, and 99.7% of the elements of the population are within 1, 2, and 3 standard deviations of the mean.

• The box has lines at the median and the first and third quartiles, while the vertical lines extend to the largest and smallest data points within 1.5xIQR (IQR=Q3-Q1 is called the interquartile range) of the quartiles. For price, ```Q1=4195, Q3=6342, IQR=6342-4195=2147.```
• Mild outliers are points between 1.5xIQR and 3xIQR of the quartiles.
• Extreme outliers are points more than 3xIQR away from quartiles.

### Some More StataQuest 4 for Windows

1. Printing graphs and text for homework: Eventually we will copy graphs and texts from StataQuest to the word processor Microsoft Word, and then print from Word, but for now you need to know how to print graphs and text:
• See Item 7 in the Lecture 1 Outline for printing graphs. Be sure the dialog box is closed before printing the graph on the screen.
• To print text you will have to use a log file. To open a log file, click on `log`, then enter (for example) `a:log1.log`, and then everything that goes in the results window will also go in the log file. To print an open log file, click on `file`, and then on `print log file`, then `OK` on the print box, then fill in information in the output settings box, and finally click on `OK` in that box.

2. To get a stem and leaf plot (for the auto price data for example):
• `Graphs -> One variable -> Stem-and-leaf -> price -> OK`
```Stem-and-leaf plot for price (Price)

3*** | 291,299
3*** | 667,748,798,799,829,895,955,984,995
4*** | 010,060,082,099,172,181,187,195,296,389,424,425,453,482,499
4*** | 504,516,589,647,697,723,733,749,816,890,934
5*** | 079,104,172,189,222,379,397
5*** | 705,719,788,798,799,886,899
6*** | 165,229,295,303,342,486
6*** | 850
7*** | 140
7*** | 827
8*** | 129
8*** | 814
9*** |
9*** | 690,735
10*** | 371,372
10*** |
11*** | 385,497
11*** | 995
12*** |
12*** | 990
13*** | 466
13*** | 594
14*** |
14*** | 500
15*** |
15*** | 906
```

3. To get a box plot (for the price data for example):
• `Graphs -> One variable -> Box plot -> price -> OK`

4. To get a normal quantile (percentile) plot (for the price data for example):
• `Graphs -> One variable -> Normal quantile plot -> price -> OK`
• If sample comes from a normal population, the points should fall close to the line on the graph.

5. To get five number summary (min, max, median, Q1, Q3) (for the price data for example):
• `Summaries -> Median/Percentiles -> price -> OK`

6. To compare a variable for two or more groups (prices for foreign versus domestic, for example):
• Summaries: ```Summaries -> Means and SDs by group -> One-Way of means -> price ```(for data variable)``` -> foreign``` (for group variable)` -> OK`
• Histograms: ```Graphs -> One variable by group -> Histograms by group -> Continuous variable -> price ```(for data variable) `-> foreign ` (for group variable)` -> OK `
• Box plots: ```Graphs -> One variable by group -> Box plots by group -> price ```(for data variable) `-> foreign ` (for group variable)` -> OK `

### Examples of Using StataQuest to Analyze Data

• Calories and amount of sodium example in Table 1.4 on page 36 (problem 66 on page 57).
• Problem 118, pg 91.