Sample data:
I want to create another column in my data and name it Math_group. In which the variables in the column will be 1) Number of students who took Math 1501, 1505 and 1507 as Group 1. Number of students who took Math 1510 and 1511 as Group 2, Number of students who took only 1510 as Group 3. Number of students who took only 1511 as Group 4. Number of students who took only 1513 as Group 5.Number of students who took 1571 and 1571H as Group 6.Number of students who took only 1585 and 1585H as Group 7 and the rest as Group 8.
Next I want to create another column in the data and name it Math_GPA. In which the variables in the column created will be ranked using the FINAL GRADE column where grade A = 4, grade B = 3 , grade C = 2, grade D = 1 and the rest will be 0. (NOTE) If a student took MATH 1510 and Math 1511 and gets a grade A in 1510 and grade B in 1511 we use find the average which is 3.5 and that will be for students who did combined (1510 and 1511) under the Math_GPA column
DATA should be like this:
Note that there is an error on the column called Math_GPA I could not get the code that will calculate the average of students that took Math 1510 and Math 1511 which was supposed to be 3.5