Dear All,
I have a data in a long format (students data with their grades in each semester). I would like to be able to check if the student has the same grades throughout the semesters, or does s/he moves up/down in terms of his grades (for example from 50 in semester 1 to 60 in semester2, .. )
I have tried to use the following code, to check if the grades are same in all the semesters
But I am sure its not correct, and not sure how work around it,
- I was also thinking of reshaping my data into wide format, is the way to go?
Here is how my data looks:
Thank in advance for your help.
I have a data in a long format (students data with their grades in each semester). I would like to be able to check if the student has the same grades throughout the semesters, or does s/he moves up/down in terms of his grades (for example from 50 in semester 1 to 60 in semester2, .. )
I have tried to use the following code, to check if the grades are same in all the semesters
Code:
by id semester, sort: gen scores = 1 if semester[_n] = semester[_n-1]
- I was also thinking of reshaping my data into wide format, is the way to go?
Here is how my data looks:
Code:
id semester grade 1 1 90 1 2 90 1 3 90 1 4 90 2 1 85 2 2 . 2 3 80 3 1 50 3 2 60 3 3 70 3 4 70 4 1 95 4 2 90 4 3 85 4 4 80
Comment