I have a list of (unique) Student ID's in one SPSS data file. In another file I have a list of student test scores over time, along with the dates of test administration. For each student record in the first file, I'd like to append the values representing the N most recent test dates and the corresponding N test scores. Both the dates and scores will be unique to to the student. Missing values need to be indicated as appropriate.
What the best way to perform this kind of data manipulation? Feel free to refer me to a web article or another post if something already exists.
Here's an example using N = 2 most recent scores
Student Date Score 1 1/01/12 85 1 2/02/12 100 1 3/03/12 90 2 4/04/12 65
I'd like the first file to look like the following:
Student Date1 Score1 Date2 Score2 1 1/01/12 85 2/02/12 100 2 4/04/12 65 Missing Missing 3 Missing Missing Missing Missing
(In reality, this first file has lots of other variables in it as well, so I'd like to do an append operation with the variables if I can.)