I have a dataset of dyads (an edgelist) representing friendship nominations between egos and their nominated alters. The network is undirected so if ego is connected to alter, then there is a separate observation in the dataset for the reverse. I would like to randomly permute the friendships so that 1.) the total degree for each individual remains the same, i.e. each individual ends up with the same number of friendships they had in the original undirected dataset and 2.) there are no self loops, so individuals are not connected to themselves. Any suggestions on this would be greatly appreciated.
Example Observed data: Ego Alter Alicia James Beth Kim James John James Rachel James Alicia John Kerry John Rachel John James Kerry Rachel Kerry John Kim Rachel Kim Beth Rachel Kim Rachel James Rachel Kerry Rachel John Permuted data: Ego Alter Alicia Rachel Beth James James Beth James John James Kim John Rachel John Kerry John James Kerry Rachel Kerry John Kim Rachel Kim James Rachel Kim Rachel John Rachel Alicia Rachel Kerry Thank you in advance, Holly hollym...@gmail.com [[alternative HTML version deleted]] ______________________________________________ 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.