Question: Ms. Anderson wants to use a SAS program to compute the total score, assign letter grades, and compute summary statistics for her college Stat 101
Ms. Anderson wants to use a SAS program to compute the total score, assign letter grades, and compute summary statistics for her college Stat 101 class. A maximum of 50 points each could be earned for the quizzes, 100 points each for the midterm exams and the labs, and 200 points for the final exam. Data for the entire semester are available in the text file stat101.txt and a subset of the data is shown below:
Id Major Year Quiz Exam1 Exam2 Lab Final 5109 Psych 4 50 93 93 98 162 7391 Econ 4 49 95 98 97 175 4720 Math 4 39 63 84 95 95 4587 Stat 3 46 92 96 88 150
.
.
. .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. .
.
.
3907 C E 4 44 80 99 99 134 4013 Econ 2 48 86 87 96 165 4456 Acct 4 36 83 88 91 154 7324 Psych 3 42 78 98 95 102 0746 Chem 4 48 84 84 97 154 Note: Year = the year in school, Quiz = the total for 5 quizzes, Lab = the total for ten labs Do not run the SAS program until all of the steps described below in parts
(a) to
(e) have been completed.
a. Write SAS statements necessary to create a SAS data set named stat101. Name your variables as Id, Major, Year, Quiz, Exam1, Exam2, Lab, and Final, respectively. Enter the data instream, with at least one blank between data values and use the list input style to read the data in (You may cut and paste the data from the data file into your program). [This is the first data step in your program]
b. Write SAS statement(s) to be added to the above data step to create i. a new numeric variable Score containing the value of the course percentage, based on weighting the points obtained for the quizzes by 10%, each of the two midterms by 20%, the lab total by 10%, and the final by 40% computed for each student.
ii. a new character variable Grade containing letter grades A, B, C, D, and F, using 90, 80, 70, 60 percent cutoffs, respectively. You may use the variable Score you created in part (i), in the SAS statements needed for this part.
[These would modify the first data step.]
c. Add a proc step and provide a SAS listing of the data set stat101.
[This would be the first proc step in your program.]
d. Students who are juniors and seniors and obtained A’s from this class will qualify for applying to a research internship next summer. Create a SAS data set named intern containing only those juniors and seniors earning a letter grade A, using the observations from the data set stat101. Provide a SAS listing of the new data set that show only the variables Id, Major, Year, and Score. Include a statement to suppress the observation number from this listing, instead identifying the students in the output by their ID number. [It would require adding a second data step and a second proc step to your program.]
e. Obtain exactly the same listing as in part (d), without creating a new SAS data set to do it. Instead use the SAS statement where within a proc print procedure step to select the subset of observations to be processed. [This would require adding a third proc step.]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
