Comparing values within multiple variables
<p>I have a data set of teachers who are assigned to up to 6 schools in Year 1 and Year 5. I want to see if any of the school codes in Year 1 are the same within the set of school codes for Year 5. Essentially, I am looking to see if teachers changed schools from Year 1 to Year 5, but want to make sure I'm looking across all the school codes, not just the first school listed for each year. Is there a command to compare the values with a set of variables to the values within another set of variables? I imagine vectors and loops might help, but I haven't used them before. In the end, I want to classify teachers are movers (those who moved to a different school in Year 5) and stayers (those who remained at the same school(s) in Year 5 as in Year 1).</p>

<p>The data is structured so that every row is a teacher; there are multiple columns for each school, which are indexed by year (e.g., there are columns for school 1 in 2012, school 2 in 2012, school 1 in 2016, school 2 in 2016 etc.).</p>