Hi, I have some data in which students are tracked between schools and years--observations with the same student ID and same school ID are assumed to be the same person (i.e. person A in school 65 in year 2007 = person A in school 65 in year 2008). But person A in school 65 is not the same as person A in school 64, regardless of year. I need to calculate the average score over years. Some students appear in multiple years, and some only appear in one (in which case their average score would just be their score from last year). Additionally, students can appear Here is what my data currently looks like: data test; infile datalines; input studentID $ schoolID year score; datalines; a 123 2000 78 a 123 2000 78 a 123 2001 80 a 123 2001 80 a 123 2001 80 b 123 2002 95 b 456 2003 91 c 456 2003 90 c 456 2004 98 c 456 2006 92 ; run; Basically i want another column with average score, that should be 79, 79, 79, 79, 79, 95, 91, 93.3, 93.3, 93.3 I feel like I might need a combination of sql and by group processing but I'm getting stuck on calculating the average score vertically. Thanks!
... View more