Hi all, I am using ACS micro data (PUMS) with one of the columns as a factor for the place of birth (POBPF). I would like to create a column (POBR) containing a rank corresponding to the place of the observation in the POBPF rankings. For example, if a person is from Oregon, Oregon is the most popular Place of Birth, so each person who came from Oregon should have a 1 in their POBR. Each row from California would have POBR 2, etc.
This way I can subset on the most populous sending places when doing analyses. For the life of me I can't figure this out. I think some combination of "sort()", "xtabs()" and "merge()" should work, but my brain seems to be fried. Tx ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.