Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Merge Files one to many
From
<[email protected]>
To
<[email protected]>
Subject
st: Merge Files one to many
Date
Sat, 31 Mar 2012 20:00:24 -0400
Have two data sets with common variable. The teacher data set has several
teachers per school. The school variable is a nominal variable that is
unique to each school. So if there are 20 teachers in a school the school
variable is repeated 20 times. The principal data file has one principal per
school and I want to merge/match on school. There is one principal to each
school and this file uses the same school variable to identify the school
the principal is in. What I need to do is to match the principal data to
every teacher in that school.
So the file would look like:
School teacher_var1 teacher_var2 principal_var1
123 23 45 56
123 25 44 56
123 21 43 56
123 56 55 56
331 21 22 51
331 21 29 51
331 26 21 51
Help please
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/