STA429/1007 Assignment 3

Quiz on Thursday Oct. 14th


This assignment is based on Chapter 2 of the class notes and associated lecture material. You will do the job described below, and bring your log file and your list file to the quiz. Then you will be asked a few   very simple questions, like what's the mean number of hours of sports programming watched per household, or how many households in the sample do not have a TV. The answers will all be numerical, and they will all be directly from your printout. The quiz will consist of your circling a few numbers and writing a few words on your printouts, and turning them in. It should only take a few minutes.

The file tv1.dat contains data from a 1982 survey conducted in Stevens County in the United States. At the time, Stevens County was divided into 75 districts including rural, small-town and urban areas. For each of 500 households interviewed, the data file contains district number, household number within district, assessed value of home in US dollars (an indirect measure of income, which was not asked), and answers to 9 questions related to the respondents' interest in getting cable TV. The variables are:

  1. District: 1-25 are rural, 26-50 small town, 51-75 city.
  2. Household (numbered within district)
  3. Assessed value of home in US dollars
  4. Number of persons 12 and older in household
  5. Number of persons 11 and younger in household
  6. Number of TV sets in Household
  7. Price willing to pay for cable TV
  8. Total TV hours watched last week (add hours for all persons in household)
  9. Hours Public Affairs watched last week
  10. Hours Sports watched last week
  11. Hours Children's programming watched last week
  12. Hours Movies watched last week

You can get a copy of the data file here, but the file is pretty long, and copy-paste with the mouse might not be the way to go. If you're using Internet Explorer, one thing you might try is this. Go to the data file (click on the link), and then copy the URL from the menu bar. From the File menu, choose Download File. Paste the URL into the "Address" box, and then click on Download. This works with Internet Explorer 4.0 for the Mac, and it might work with the PC version too.

More efficient might be to copy the file directly from my cquest account to yours. I believe I have made this possible. At the cquest unix prompt, type

cp /homes/students/u0/stats/brunner/public_html/429sas/tv1.dat .

The period is important; it refers to your current directory.

Here's what you do for the Assignment

Write a SAS program that reads the data and labels the variables with the label statement. Create a new variable with 3 values: Rural, Small Town and City. Use proc means to obtain n, mean and standard deviation for all the quantitative variables. Use proc freq to obtain frequency distributions of the new variable you created, and also of Number of persons 12 and older, Number of persons 11 and younger, Number of TV sets, and Price willing to pay for cable TV. That's it.

For debugging, your initial runs should include frequency distributions of everything, but once the data are clean and your program is correct, just produce what is requested above.

Bring your log file and your list file to the quiz. You will hand both of them in. Here are a few suggestions and comments: