Hello! I have a data set where I have multiple observations for each student, where the personal information is repeated, but the courses information is different in each observation.
Example:
student_id name age course teacher_gender
1 Mike 20 Eco1 F
1 Mike 20 Mat1 M
2 Sara 21 Eco1 M
2 Sara 21 Mat1 F
3 Sofia 19 Eco1 M
3 Sofia 19 Arts1 F
Next, I created 2 dummies,
gen_eco1=1 if teacher_gender=F and gen_eco1=0 y teacher_gender=M
mat=0 , replace mat=1 if course=Mat1
With this, I want to know the students that had a female teacher in Eco1, and the students that later took the course of Mat1 (not all the students have an observation with the course Mat1).
I don't know how to collapse this information, because both of my dummies are not talking... I think I could use the collapse function but I'm not sure. If anyone could help me I would be very thankful.
Thanks!
Example:
student_id name age course teacher_gender
1 Mike 20 Eco1 F
1 Mike 20 Mat1 M
2 Sara 21 Eco1 M
2 Sara 21 Mat1 F
3 Sofia 19 Eco1 M
3 Sofia 19 Arts1 F
Next, I created 2 dummies,
gen_eco1=1 if teacher_gender=F and gen_eco1=0 y teacher_gender=M
mat=0 , replace mat=1 if course=Mat1
With this, I want to know the students that had a female teacher in Eco1, and the students that later took the course of Mat1 (not all the students have an observation with the course Mat1).
I don't know how to collapse this information, because both of my dummies are not talking... I think I could use the collapse function but I'm not sure. If anyone could help me I would be very thankful.
Thanks!
Comment