STAT 540 Homework 5 -- Fall 2019 1. Write a SAS program to read in the data file baseballroster.txt given on the course web page. Please have SAS read in the data file directly from the web address: http://people.stat.sc.edu/hitchcock/baseballroster.txt and NOT from a file location on your own computer. The variables for each observation, in order, are: Name, height(feet), height(inches), weight(pounds), position, number of years on team, birthdate, and date they joined the starting lineup (if ever). Within the data step, do the following: (a) Create another variable that gives the players' weights in kilograms. (b) Create another variable that gives the players' heights in meters. (c) Suppose that the equipment for catchers weighs 10 pounds, the equipment for pitchers and infielders weighs 2 pounds, and the equipment for outfielders weighs 2.5 pounds. Create (as efficiently as possible) another variable that gives the players' weights (in pounds), including their equipment's weight. (d) Create another variable that gives the players' current ages in years (rounded down, like ages are conventionally stated). [HINT: One of the SAS numeric functions listed in Section 3.4 of the textbook could be useful.] Then: (e) Print the entire data set with the players sorted by position (alphabetically), and by years on the team within each position (list most experienced players first). Have SAS print out the dates in word format including day of the week (e.g., Friday, November 1, 1974). (f) Use PROC MEANS to have SAS show ONLY the mean and standard deviation of the player's weights (in POUNDS, without equipment). [SAS should show only the mean and standard deviation (not other summary statistics), and these statistics only for the weight (not for other variables).] Have SAS print the mean and standard deviation of weights for the entire data set. Then have SAS show the mean and standard deviation of weights (again in POUNDS, without equipment), SEPARATELY for each position. 2. Look at the moviereview.txt file on the course web page. It contains the reviews for 160 movies from 1996 by Gene Siskel and Roger Ebert. (Ebert's reviews are in the right column.) Use PROC FREQ to produce four two-way tables summarizing these categorical data, one table for each quarter of the year (assume the first 40 movies are from the first quarter, the next 40 from the second quarter, the next 40 from the third quarter, and the last 40 from the fourth quarter of 1996). (Data from Agresti and Winner, Chance, 1997). Please have SAS read in the data file directly from the web address: http://people.stat.sc.edu/hitchcock/moviereview.txt and NOT from a file location on your own computer. NOTE: In the data file, the first column is just labeling the movie review number. You can read in these data using a simple list-style INPUT statement. ***************************************************************************** NOTE: You MUST intersperse comments in your SAS program to explain in detail what your SAS statements are supposed to be doing. Please be generous with your comments, since you will be graded not only on the correctness of the code, but the clarity and amount of comments. Remember that SAS comments are typed as: /* comment */ or *comment; DO NOT put R-style comments (with #) in your SAS code!!! You can upload your .txt file with your SAS code and comments into Blackboard as usual. As with the other homeworks, to ensure that the grader will be able to grade your submission: * Please save your document as a plain text (.txt) file before uploading. * Please ensure that EVERY line in your submitted text file EXCEPT your SAS code is placed in "comments". That way, the grader will be able to copy everything in the file into SAS and have the program run without a problem. * Please include detailed comments explaining your code. You will be graded on the quality of your comments, as well as the correctness of your code.