I would like to reallocate individuals (e.g 10 000) to different neighborhoods (e.g 200).
1/ I can do it uniformly, i.e. individuals are allocated without preferences into neighborhoods, by doing this
2/ But I also would like to randomly allocate the individuals according to a variable such as share of white population to account for preferences. Therefore, the allocation is not uniform anymore and the individuals would prefer to live in only white neighborhoods.
How can I reallocate individuals into different neighborhoods taking into account a preference variable putting more weight in the allocation process ?
3/ If I can take into account preferences during the allocation process, is it possible to restrict the amount allocated to a certain threshold specific to each neighborhoods? This would take into account the limit capacity of housing.
1/ I can do it uniformly, i.e. individuals are allocated without preferences into neighborhoods, by doing this
Code:
*number of individuals to allocate gen x = 10 000 *number of neighborhoods (with n = one neighborhood) egen N = sum(n) *allocate new population gen new_pop = x/N
How can I reallocate individuals into different neighborhoods taking into account a preference variable putting more weight in the allocation process ?
3/ If I can take into account preferences during the allocation process, is it possible to restrict the amount allocated to a certain threshold specific to each neighborhoods? This would take into account the limit capacity of housing.