Assignments for Lesson 5

1. Refer to the CATS datasets. Write a SAS program that creates three separate SAS datasets from CATS1, CATS2, and CATS3 data. Make two new variables which represent the GFR at week 0 for the treated kidney and the GFR at week 0 for the untreated kidney. Print only the cats' names and the two new variables, identified as "treated" or "untreated" (not "left" or "right").

2. Refer to the SOCCER dataset. Suppose that the team plans to go to Europe for some exhibition matches, and you need to send their hosts some information about the players. Use a SAS program to convert the players' heights to meters, then print the players' first and last names, jersey numbers, and heights in meters. For this printout, list only 3 significant digits for the heights (example: 5 feet, 8 inches is equivalent to 1.73 meters).

3. Refer to the USEDCARS dataset. Write a SAS program which reads the full dataset. Then, create a dataset which contains only the least expensive car offered by each dealer. Print the new dataset, showing the year, manufacturer, model, price, and name of the dealer. This dataset should have 15 observations, and each dealer should appear exactly once.

4. There is a mistake in the HOCKEY dataset. The Buckeyes lost to Boston College by a score of 5-2 in their last game. Write a SAS program which reads the data from your diskette and corrects the error with programming statements. Read the month, day, and year as three separate numeric variables, and create a new variable for the date by using the MDY command. Print the revised dataset and use an appropriate format for the date.

5. Refer to the HANKS and RYAN datasets. Tom Hanks and Meg Ryan have starring roles in the movie You've Got Mail, which will be released within the next few weeks. Write a SAS program which first creates two datasets (one for Hanks, one for Ryan). Then, use programming statements to print a listing of only the movies in which both Hanks and Ryan have appeared.

6. Refer to the BREAD dataset. Suppose that you need to create a reference list of bread recipes that do not use eggs (for dietary requirements or preferences, or perhaps you forgot to buy eggs). Create and print a permanent SAS dataset, using LIBNAME and associated commands, which contains only the recipes which use no eggs.

7. Refer to the CLINTON dataset. Since the beginning of the semester, Gallup has conducted more polls to assess President Clinton's job approval rating. The data are shown below.

Date     Approve Disapprove No opinion
8-18-98  66      29         5
8-20-98  61      34         5
8-21-98  62      35         3
9-1-98   62      33         5
9-10-98  60      37         3
9-11-98  63      34         3  

Create two datasets in SAS. One dataset should consist of the numbers in the file on your diskette; the second dataset should contain the numbers listed above. Combine the two datasets into a larger dataset with the appropriate commands, sort the observations in that dataset in descending order by date (so that September 11, 1998 appears first), and print the larger dataset. Use an appropriate format to print the date variable.

8. Suppose that a computer systems analyst has been assigned to check whether the computers in his department are Year 2000-compliant. Suppose that the following counts of compliant computers are obtained:

Brand    Compliant Total 
Dull     38        54
Getaway  19        22
Winesap  15        35
HAL      10        42

(For example, of the 54 Dull computers tested, 38 were found to be compliant, or 38/54 = 70% compliant). Create a SAS dataset with these four observations. One way of analyzing the data requires the use of the angular transformation for proportions. Calculate the transformed variable by finding the arcsine of (square root of the fraction of computers which were compliant). Print the data, including the transformed variable. You may need to use the SAS help menu to find the SAS command for the arcsine function; it helps to know that it is a trigonometric function.


Return to STA 5106 home page