Dear all
I'm trying to compute the mode socio-economic background (SES) in each high school (egen schoolses= mode (ses), minmode by (highschool), but leaving the individual student out (ie. the mode SES of the individual’s peers). I worked with the "leave-one-out" mean before but I struggle to apply something similar for the mode SES. The SES is a categorical variable from 0 to 4 and I basically want to assign to each school a value from 0 to 4 according to the SES of most of the other students (ie. excluding the individual). Any help on that will be very much appreciated. Thank you very much in advance.
I'm trying to compute the mode socio-economic background (SES) in each high school (egen schoolses= mode (ses), minmode by (highschool), but leaving the individual student out (ie. the mode SES of the individual’s peers). I worked with the "leave-one-out" mean before but I struggle to apply something similar for the mode SES. The SES is a categorical variable from 0 to 4 and I basically want to assign to each school a value from 0 to 4 according to the SES of most of the other students (ie. excluding the individual). Any help on that will be very much appreciated. Thank you very much in advance.
Comment