22S:166 Computing in Statistics Fall 2008, Instructor: Cowles Homework 9 Due: Wed. Dec. 10 The following datasets are available under "Datasets" on the course web page. Cars.dat countries.dat Here is a description of the Cars.dat data file: Description: Measurements on 38 1978-79 model automobiles. The gas mileage in miles per gallon as measured by Consumers' Union on a test track. Other values as reported by automobile manufacturer. Number of cases: 38 Variable Names: Country: Nationality of manufacturer (eg. U.S., Japan) Car: Car name (Make and model) MPG: Miles per gallon, a measure of gas mileage Drive_Ratio: Drive ratio of the automobile Horsepower: Horsepower Displacement: Displacement of the car (in cubic inches) Cylinder: Number of cylinders The "countries.dat" data file has only two variables: country: Name of country capital: Name of capital city Hint: Here is part of a data step to read the "countries.dat" data file. You may include this code in your program. You will have to either complete the "infile" statement or put the data into "datalines" yourself. data countries ; infile ; length Country $11. capital $15. ; input Country capital ; run ; ------------------------------------------------------------------------- Produce ONE of the two tables below. Whichever one you choose, list the capital city of the country, the number of cars in the Cars.dat file that were manufactured in the country, and the minimum, median, and maximum values of the MPG variable for the cars manufactured in the country. Countries that appear in the "countries.dat" file but that have no cars in the "Cars.dat" file should not appear in the table. The MEANS Procedure Analysis Variable : MPG N Capital city Obs Minimum Median Maximum ---------------------------------------------------------------------- Berlin 5 20.3 30.5 31.9 Paris 1 16.2 16.2 16.2 Rome 1 37.3 37.3 37.3 Stockholm 2 17.0 19.3 21.6 Tokyo 7 22.0 29.5 35.1 Washington D.C. 22 15.5 20.7 34.2 ---------------------------------------------------------------------- ---------------------------------------------------------------------- | | MPG | | |---------------------------------------------------| | | N | Min | Median | Max | |----------------+------------+------------+------------+------------| |Capital city | | | | | |----------------| | | | | |Berlin | 5.00| 20.30| 30.50| 31.90| |----------------+------------+------------+------------+------------| |Paris | 1.00| 16.20| 16.20| 16.20| |----------------+------------+------------+------------+------------| |Rome | 1.00| 37.30| 37.30| 37.30| |----------------+------------+------------+------------+------------| |Stockholm | 2.00| 17.00| 19.30| 21.60| |----------------+------------+------------+------------+------------| |Tokyo | 7.00| 22.00| 29.50| 35.10| |----------------+------------+------------+------------+------------| |Washington D.C. | 22.00| 15.50| 20.70| 34.20| ---------------------------------------------------------------------- Copy the output (only the table) and your complete SAS program, including all data steps, into a text file, and submit through ICON.