|
Hi Enis,
DE> StudentID TeacherID teacher_gender
DE> 1 1 1
DE> 2 1 1
DE> 3 1 1
DE> 4 2 2
DE> 5 2 2
DE> 6 2 2
DE> I want to know the frequencies of teacher gender. However each teacher
DE> repeats himself as many times as he has students. So if run frq without
DE> any manipulation it will look like I have 3 male and 3 female teachers
DE> whereas I actually I have 1 male and 1 female teacher. How do I
DE> "unweight" the teacher cases.
DATA LIST LIST/StudentID TeacherID teacher_gender (3 F8).
BEGIN DATA
1 1 1
2 1 1
3 1 1
4 2 2
5 2 2
6 2 2
END DATA.
* Select only first ocurrence of each TeacherID *.
COMPUTE select=1.
IF TeacherID=LAG(TeacherID) select=0.
FILTER BY select .
FREQUENCIES VARIABLES=teacher_gender.
Best regards,
Marta
|