# NOT RUN {
# which racial groups are most segregated?
(localseg = mutual_local(schools00, "school", "race", weight="n"))
# native americans are most segregated, whites are least segregated.
sum(localseg[localseg["stat"]=="p", "est"]) # => 1
# the sum of the weighted local segregation scores equals
# total segregation
mutual_total(schools00, "school", "race", weight="n") # => .425
sum(localseg[localseg["stat"]=="M_group", "est"]) # => .425
# }
Run the code above in your browser using DataLab