—
title: “Example 5”
author: “sheng huo”
date: “5/4/2018”
output: html_document
—
“`{r setup, include=FALSE}
library(knitr)
setwd(“/Users/NOAH/Desktop/CSC 495/week6/ex5/ex5”)
read_chunk(“example05.R”)
knitr::opts_chunk$set(echo = TRUE)
“`
## CUG tests
In this example, we work with the two Lord of the Rings networks.
### Step 1: Load the necessary libraries and data
“`{r C1, results=”hide”, warning=FALSE, message=FALSE}
“`
### Step 2: Load the data and summarize
“`{r C2}
“`
## Look at the power law fit for weighted degree
### Step 3: Create data frame
“`{r C3}
“`
### Step 4: Visualize
“`{r C4}
library(mcclust)
coms = list(my.leading.eigenvector.community, my.fastgreedy.community, my.walktrap.community.5, my.walktrap.community.10)
mat <- matrix(rep(0, 16), nrow = 4, ncol = 4) for(i in 1:4) { for(j in (i+1):4) { mat[i, j] = } } ``` ### Step 5: Fit to power law distribution ```{r C5} ``` ### Step 6: Compare with BA ```{r C6} ``` ### Step 7: Create fitted curve data ```{r C7} ``` ### Step 8: Comparative plot with fitted curve ```{r C8} ``` ### Step 9: Load the CUG utilities ```{r C9} ``` ### Step 10: Test global transitivity for LOTR1 ```{r C10} ``` ### Step 11: Show results ```{r C11} ``` ### Step 12: Test global transitivity for LOTR3 ```{r C12} ``` ### Step 13: Test assortativity by "race" LOTR1 This doesn't meet p < 0.1 standard of statistical significance. ```{r C13} ``` ### Step 14: Test assortativity by "race" LOTR3 ```{r C14} ```