Statistics 220E

Homework 2

Due Wednesday, January 21 , 1998


  1. WW 3-8
  2. WW 3-12
  3. WW 3-18
  4. In both parts of the problem you must prove the result.
    i). A poker player is dealt three spades and two hearts. He discards the two hearts and draws two more cards. What is the probability that he draws two more spades?
    ii). A wine taster claims that she can distinguish four vintages of a particular Cabernet. What is the probability that she can do this by merely guessing? (She is confronted with four unlabeled glasses.)

  5. Computer Assignment.
    This is going to take the better part of your time, so plan ahead. Don't dispair, computer frustration is the major cause of sleep loss among Stat 220 students. And remember: if the guy next to you acts as if he made that computer, he must have taken Stat 220 in the meanwhile..
    A. Enter stata. Run the introductory tutorial:
    tutorial intro
    Try to understand as much as possible of the data, and of the stata commands (you may ignore the fine points of the regression tables). Repeat this tutorial until the elements up to the regress command are fairly clear. Answer the following questions:
    1. How many types of automobiles are included in the dataset?
    2. Of the 69 automobile models that were ranked for repair record, how many had the best record? How many of these are American?
    3. How was the row #4 calculated in the "tabulate rep78 foreign, column" command:
      18.75 42.86 26.09
    4. What proportion of the foreign models have a repair rating of 3?
    5. Describe the essential differences between the American and foreign cars in terms of weight and price.
    B. Run the graphics tutorial, until you are pretty confortable with the contents:
    tutorial graphics
    Save the rest of the session on the file hw1.log:
    log using hw1.log
    Do one of the following:
    use c:\Numbers\stata4\auto
    use /usr/local/stata/auto

    to use the auto.dta file.
    (if you get an error message at this point, talk to the computer tutor, and ask him for the path to stata; put that path in the use command)
    graph mpg, hist xlabel
    (print the plot using the "Print" line on the "File" menu. If you work in Unix, read the note from the bottom of the page to understand how to print a graph)
    graph mpg, box ylabel ti(Boxplot of Mileage)
    (print the plot)
    tabulate mpg
    summarize mpg
    Do the same as above with the variable price instead of mpg, then
    log off
    exit, clear
    Now all your stata session is in the file called hw1.log, in the current directory (if you have problems finding the file on the PC, use the Find feature of the Start box in Windows95). Edit the file (delete all errors, etc) using a text processor (such as Word, or Works on the PC) and include it in your homework solution, together with the plots.
    C. From the computer file at (B), answer the following:
    1. From the boxplot of mpg, what is the approximate value for the minimum, maximum, 1st quartile, 3rd quartile and median mileage?
    2. From the tabulate table, what are the exact values of the numbers above?
    3. Are the values of the mean and median mileage similar? What does that indicate? Which of them is a better one-number summary of the mileage?
    4. Same questions as 1-3 regarding the variable price.

    Note: This is how to draw a graph, for example a boxplot, using Stata in UNIX.
  1. type in Unix:
    ln -s /usr/local/stata/gphpen gphpen
  2. start Stata
  3. save the graph as a postcript file :
    graph x , box saving(filename)
    gphpen -dps filename

    (where x is your data and "filename" is a name you choose for the file).
  4. After you exit Stata, print the graph using the lpr command, the name of the postscript file is filename.ps