SAS PROGRAMMING HOMEWORK #2 1) Save the following data as: HW21.DAT on a:\ MATHEMATICAL STATISTICS JIM DEDDENS 98 75100 ROBERT DEDDENS 75 53 81 JILL KRAMER 28 34 PING WANG 92 93 94 etc... SAS PROGRAMMING JIM DEDDENS 93 89 88 T WANG 87 93 JILL KRAMER 90 90 90 etc... APPLIED LINEAR ALGEBRA JIM DEDDENS 98 88 PING WANG 83 76 GERTRUDIE WILSON 56 65 etc... which contains the course name, followed by the student names, followed by their scores on tests. a) Write the SAS code for reading the data into SAS. Your data set should contain 1 observation for each student/course combination. b) Write a SAS program to compute the average scores for each student in each course. Make a decision how to treat missing values, and explain what you did. c) Write a SAS program to find the best (highest average) student in each course. d) Write a SAS program that will somehow output something like: PING WANG had the highest average in MATHEMATICAL STATISTICS it was 93% etc......... 2) For this problem you need to use the GNP data set as on handout11. In order to access this data set first in the WPGM window create your library (eg LIBNAME JIM 'A:\'; Next type INSIGHT on the command line. Change the library to SASHELP, click on GNP. Then click on file, save, data, change the library to your library, save it! Your job is to write a SAS program that performs 4 regressions (Y=GNP), one regression for each of the other variables (that is, INVEST, CONSUMP, EXPORTS, GOVT). You need to use the ODS system to create a SAS data set that contains 4 observations (one for each regression), that contains (ONLY) the independent and dependent variable names, the slope estimate together with its standard error and p-value, the model R-square, the error degrees of freedom, and the 95% confidence interval for the slope. Finally your program should pick the variable with the largest R-square and create an HTML file that says something like: The variable INVEST had the highest R-square of 97% TRY TO USE THE FEWEST PIECES OF PAPER AS POSSIBLE USE PROPER SYNTAX, GOOD NAMES, COMMENTS, LABEL, FORMATS ETC BE SURE TO INCLUDE YOUR SAS PROGRAMS AND OUTPUT.