MulaiMulai sekarang secara gratis

Transitivity randomizations

As you did for the average path length, let's investigate if the global transitivity of the Forrest Gump network is significantly higher than we would expect by chance for random networks of the same size and density. You can compare Forrest Gump's global transitivity to 1000 other random networks.

Latihan ini adalah bagian dari kursus

Network Analysis in R

Lihat Kursus

Petunjuk latihan

  • One thousand random networks are stored in the list object gl. Using lapply() and transitivity() calculate the global transitivity of each of these networks. Assign these results to gl.tr.
  • Using unlist() convert gl.tr to a numeric vector gl.trs.
  • Investigate the summary statistics of the transitivities of the random networks using summary().
  • Calculate the proportion of random graphs that have a transitivity higher than the transitivity of Forrest Gump's network, which you previously calculated and assigned to g.tr.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

library(igraph)

# Calculate average transitivity of 1000 random graphs
gl.tr <- ___(gl, ___)
gl.trs <- ___(gl.tr)

# Get summary statistics of transitivity scores
___(gl.trs)

# Calculate the proportion of graphs with a transitivity score higher than Forrest Gump's network
mean(gl.trs > ___)
Edit dan Jalankan Kode