Generating segregation variable

Hey guys.

I know this is really simple, I just can't figure it out and it's bugging me!

So I have two variables: one is school ID (arbitrary number that functions as ID variable) and a dummy variable that shows if the children has 0 both parents native or 1 one or both parents imigrants. Now I want to make a new variable that indicates how the classes are mixed from very segregated to moderatly to mixed. I basically need to set limits to how the distribution of the students needs to be to indicate if the school is one of the three categories but I simply can't figure this one out and it's annoying me way too much!


schoolID = X1, seg = 21 native, 14 non-native. This needs to be moderat. Do I need to do something with the seg-variable first? I get the feeling that's the direction I need to go.