Problem 1. Download the following three files homework.xls, quiz.xls and
exams.xls on blackboard. These files contain scores of homework, quizzes, and exams from
one of my STAT 5xx classes taught a few years ago. There is a common variable Name in
all these three files. The ultimate goal is to come up with the final grades for all students in
that class based on their performance on the homework, quizzes and exams.


a. First write SAS programs to read data from these three files into SAS. Pay attention
to the missing values in the original files and replace the missing values with 0 in
each created SAS data set. Name the created SAS data sets as hwscores, qzscores,
and examscores. The following contains specific requirements on the variables in the
created SAS data sets.

-In hwscores, create 5 new variables named perc1-perc5 denoting the percent-
age of their homework scores. Note that the full credits for the five homework
assignments are 20,100,100,100, and 120 respectively. Calculate the average of
perc1-perc5 and store it in new variable aveperc in hwscores.

-In qzscores, create a new variables count to count the total score of the quizzes
for each student in the class and then create a variable quizadj with the following
rules: quizadj =1 if count >=10; quizadj = count/10 otherwise.

-There are 4 exam scores in exams.xls, with the first three for three mid-term ex-
ams (exam1-exam3) and the last one for the cumulative final exam (examfinal).
To encourage student work hard for the second half of semester, I promised stu-
dents that I would use the final exam score to replace the lowest mid-term score
if the final exam score is higher (only one could be replaced). Create three new
variables (newexam1-newexam3) to record the adjusted mid-term scores.

Print the first 10 observations in hwscores, qzscores, and examscores separately
and show your output.

b. Merge the three data sets hwscores, qzscores, and examscores by the common
variable Name (the observations in each three data, sets should be already sorted by
variable Name). Name the merged data set records, which only contains the Name, aveperc, quizadj, newexam1-newexam3, examfinal from the three previously created SAS data sets. Also, create a new variable performance to record the overall scores for students in that class using following formula

0.15** aveperc +5** quizadj+0.2**(newexam 1+ newexam 2+ newexam 3+ examfinal)

First and then rounding it up (This means that performance only takes integer values). The final grade (named grade) is determined in the following criteria.

A >=90
B+ 87<=, <=89
B 80<= , <= 86
C+ 77<=, <=79
C 70<= , <=76
D 60<= , <=69
F < 60

Print out the data in records.

C. Write a SAS Program to create a short notice for each student in the class. Each notice takes a separate page. Take student Z1 for an example and suppose his first three midterm exams are 91,95,88 his final exam score is a 90 and his final grade is an “A”. Note that the lowest midterm score should be replaced by the final in the notice.
Dear Z1,
Your final exam score is a 90 and the adjusted mid-term exam scores are 91, 95, and 90. Your final grade for Stat 5xx is A.
Show your SAS program and also print out the notices for the first 5 students.

D. Use SAS to construct a table showing how many students in that get A, B+, B, etc. Display your table.

E. Suppose that one is interested in how the quiz, homework, and the three midterm exam scores affect the final exam score. To address this, fit a linear regression model with examfinal as the dependent variable and quizadj, aveperc, exam1, exam2, and exam3 as independent predictors. Report your regression output and comment on whether each of these predictors has a significant effect on the examfinal at 0.05 level of significance.