Network Diffusion of Innovations

Diffusion networks

  • Tries to explain how new ideas and practices (innovations) spread within and between communities.

  • While a lot of factors have been shown to influence diffusion (Spatial, Economic, Cultural, Biological, etc.), Social Networks is a prominent one.

  • More complex than contagion \(\implies\) a single tie is no longer enough for an innovation to spread across a social system.

  • We think of this in terms of adoption thresholds and social exposure.

Thresholds

  • Network thresholds (Valente, 1995), \(\tau\), are defined as the required proportion or number of neighbors that leads you to adopt a particular behavior (innovation), \(a=1\). In (very) general terms

    \[ a_i = \left\{\begin{array}{ll} 1 &\mbox{if } \tau_i\leq E_i \\ 0 & \mbox{Otherwise} \end{array}\right. \qquad E_i \equiv \frac{\sum_{j\neq i}\mathbf{X}_{ij}a_j}{\sum_{j\neq i}\mathbf{X}_{ij}} \]

    Where \(E_i\) is i’s exposure to the innovation and \(\mathbf{X}\) is the adjacency matrix (the network).

  • This can be generalized and extended to include covariates and other weighting schemes (that’s what netdiffuseR is all about).

netdiffuseR

Overview

netdiffuseR is an R package that:

  • Is designed for Visualizing, Analyzing and Simulating network diffusion data (in general).

  • Depends on some pretty popular packages:

    • RcppArmadillo: So it’s fast,
    • Matrix: So it’s big,
    • statnet and igraph: So it’s not from scratch
  • Can handle big graphs, more than 4 billion elements adjacency matrix (PR for RcppArmadillo)

  • Already on CRAN with ~4,000 downloads since its first version, Feb 2016,

  • A lot of features to make it easy to read network (dynamic) data, making it a nice companion of other net packages.

Datasets

  • Among netdiffuseR features, we find three classical Diffusion Network Datasets:

    • brfarmersDiffNet Brazilian farmers and the innovation of Hybrid Corn Seed (1966).
    • medInnovationsDiffNet Doctors and the innovation of Tetracycline (1955).
    • kfamilyDiffNet Korean women and Family Planning methods (1973).
    brfarmersDiffNet
    # Dynamic network of class -diffnet-
    #  Name               : Brazilian Farmers
    #  Behavior           : Adoption of Hybrid Corn Seeds
    #  # of nodes         : 692 (1001, 1002, 1004, 1005, 1007, 1009, 1010, 1020, ...)
    #  # of time periods  : 21 (1946 - 1966)
    #  Type               : directed
    #  Final prevalence   : 1.00
    #  Static attributes  : village, idold, age, liveout, visits, contact, coo... (146)
    #  Dynamic attributes : -
    medInnovationsDiffNet
    # Dynamic network of class -diffnet-
    #  Name               : Medical Innovation
    #  Behavior           : Adoption of Tetracycline
    #  # of nodes         : 125 (1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, ...)
    #  # of time periods  : 18 (1 - 18)
    #  Type               : directed
    #  Final prevalence   : 1.00
    #  Static attributes  : city, detail, meet, coll, attend, proage, length, ... (58)
    #  Dynamic attributes : -
    kfamilyDiffNet
    # Dynamic network of class -diffnet-
    #  Name               : Korean Family Planning
    #  Behavior           : Family Planning Methods
    #  # of nodes         : 1047 (10002, 10003, 10005, 10007, 10010, 10011, 10012, 10014, ...)
    #  # of time periods  : 11 (1 - 11)
    #  Type               : directed
    #  Final prevalence   : 1.00
    #  Static attributes  : village, recno1, studno1, area1, id1, nmage1, nmag... (430)
    #  Dynamic attributes : -

Visualization methods

set.seed(12315)
x <- rdiffnet(
  300, t = 4, rgraph.args = list(k=8, p=.3),
  seed.graph = "small-world",
  seed.nodes = "central"
  )

plot(x)

plot_diffnet(x)

plot_diffnet2(x)

plot_diffnet2(x, add.map = "last", diffmap.alpha = .75, include.white = NULL)

plot_adopters(x)

plot_threshold(x)

plot_infectsuscep(x, K=2, logscale = FALSE)

plot_hazard(x)

Problems

  1. Using the diffnet object in data_intro.rmd, use the function plot_threshold specifying shapes and colors according to the variables ItrustMyFriends and Age. Do you see any pattern?
LS0tCnRpdGxlOiAiSW50cm9kdWN0aW9uIgphdXRob3I6ICJUaG9tYXMgVy4gVmFsZW50ZSBhbmQgR2VvcmdlIEcuIFZlZ2EgWW9uIgotLS0KCmBgYHtyIHNldHVwLCBlY2hvPUZBTFNFLCBtZXNzYWdlPUZBTFNFLCB3YXJuaW5nPUZBTFNFfQpsaWJyYXJ5KG5ldGRpZmZ1c2VSKQprbml0cjo6b3B0c19jaHVuayRzZXQoY29tbWVudCA9ICIjIikKCmBgYAoKCiMgTm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