I'm working with data concerning grades by semester and year. I have been able to calculate the GPA for each individual semester as well as the overall GPA (by revising my group by statement) . Now what i want is a cumulative variable that will show what the current GPA is after any given semester. For example, if someone had this:
semester 1 GPA = 3.7, semester 2 GPA = 3.1, semester 3 GPA = 2.8
then the cumulative variable would be:
semseter 1 CumGPA = 3.7, semester 2 CumGPA = 3.4, semester 3 CumGPA = 3.2.
here is some of my code:
proc sql; /*GPA per semester*/
create table A as
select netid, semester, year, sum(credits*gradepoint)/sum(credits) as gpa
from grades
group by netid, semester, year;
quit;
proc sql; /*overall GPA*/
create table B as
select netid, sum(credits*gradepoint)/sum(credits) as OverallGPA
from grades
group by netid;
quit;
Thanks for your help