View source: R/friendshipParadox.R
friendshipParadox | R Documentation |
A function to calculate parameters related to the friendship paradox.
friendshipParadox(A)
A |
An adjacency |
This function calculates the following friendship paradox metrics: mean degree (kmean
),
mean degree of friends (kff
), ratio between kff
and kmean
(ratio
), variance of the degree distribution (variance
) and difference
between the mean degree of friends and the mean degree (difference
).
A list of
degree |
the type of degree calculated: indegree ( |
kmean |
the mean number of friends (degree). |
kff |
the mean number of friends of friends (degree of friends). |
ratio |
the ratio between |
variance |
the variance of degree distribution. |
difference |
the difference between |
[1] Feld SL (1991). "Why Your Friends Have More Friends than You Do." American Journal of Sociology, 96, 1464-1477.
[2] Amaku M, Cipullo RI, Grisi-Filho JHH, Marques FS, Ossada R (2014). "The Friendship Paradox in Scale-Free Networks." Applied Mathematical Sciences, 8 (37), 1837-1845. doi: 10.12988/ams.2014.4288
[3] Amaku M, Grisi-Filho JHH, Negreiros RL, Dias RA, Ferreira F, Ferreira Neto JS, Cipullo RI, Marques FS, Ossada R (2015). "Infectious Disease Surveillance in Animal Movement Networks: An Approach Based on the Friendship Paradox." Preventive Veterinary Medicine, 121, 306-313. doi: 10.1016/j.prevetmed.2015.08.002
[4] Amaku M, Grisi-Filho JHH (2015). "The Friendship Paradox as a Strategy for Scenarios with Incomplete Network Data." Physics of Life Reviews, 15, 39-40. doi: 10.1016/j.plrev.2015.07.006
# Generate an arbitrary 10 by 10 adjacency matrix with zeros and ones # Remove loops A <- matrix(rbinom(10 * 10, 1, 0.2), ncol = 10, nrow = 10) diag(A) <- 0 # Call function friendshipParadox(A)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.