Hello, I'm new to Stata and please help. I have a question about merging two data sets.
In data set A, I have a variable Students with 5 observations and some other variables.
In data set B, I have a variable Groups with 3 observations and some other variables.
One feature of those two data sets is that the 5 students can fall into the 3 groups.
Now I want to merge data sets A and B with a common variable, what I get from the result is now I have a combined data set with 5 observations for both students and groups. What Stata did for me is generating 2 more duplicated groups for me.
The question is I want to make Group the unique observations because I want to do a regression with variable Group not Students.In other words, I want to generate another variable NumberofStudentsWithinEachClass.
Can anyone help me with the merge and generating the variable? Thank you very much guys.
Alex
In data set A, I have a variable Students with 5 observations and some other variables.
In data set B, I have a variable Groups with 3 observations and some other variables.
One feature of those two data sets is that the 5 students can fall into the 3 groups.
Now I want to merge data sets A and B with a common variable, what I get from the result is now I have a combined data set with 5 observations for both students and groups. What Stata did for me is generating 2 more duplicated groups for me.
The question is I want to make Group the unique observations because I want to do a regression with variable Group not Students.In other words, I want to generate another variable NumberofStudentsWithinEachClass.
Can anyone help me with the merge and generating the variable? Thank you very much guys.
Alex
Comment