R statnet - grp month - compare graphs across auto and baseline data

R network analysis files

Related files:

  • network descriptives

    • network-level

      • files

        • R scripts:

          • context_text/R/db_connect.r
          • context_text/R/sna/functions-sna.r
          • context_text/R/sna/sna-load_data.r
          • context_text/R/sna/igraph/*
          • context_text/R/sna/statnet/*
      • statnet/sna

        • sna::gden() - graph density
        • R scripts:

          • context_text/R/sna/statnet/sna-statnet-init.r
          • context_text/R/sna/statnet/sna-statnet-network-stats.r
          • context_text/R/sna/statnet/sna-qap.r
      • igraph

        • igraph::transitivity() - vector of transitivity scores for each node in a graph, plus network-level transitivity score.

          • Q - interpretation?
        • R scripts:

          • context_text/R/sna/statnet/sna-igraph-init.r
          • context_text/R/sna/statnet/sna-igraph-network-stats.r

Setup

Setup - working directories

Store important directories and file names in variables:


In [1]:
getwd()


'/home/jonathanmorgan/work/django/research/work/phd_work/methods/network_analysis/statnet'

In [2]:
# code files (in particular SNA and statnet function libraries, modest though they may be)
researchDirectory <- "/home/jonathanmorgan/work/django/research/"
contextAnalysisDirectory <- paste( researchDirectory, "/", 'context_analysis', sep = "" )
codeDirectory <- paste( contextAnalysisDirectory, "/", "R/sna", sep = "" )

# basic SNA functions
# - /home/jonathanmorgan/work/django/research/context_analysis/R/sna/functions-sna.r
#snaFunctionFilePath <- paste( codeDirectory, "/", 'functions-sna.r', sep = "" )

# statnet/sna functions
# - /home/jonathanmorgan/work/django/research/context_analysis/R/sna/stanet/functions-statnet.r
#statnetFunctionFilePath <- paste( codeDirectory, "/statnet/", 'functions-statnet.r', sep = "" )

# home directory
#homeDirectory <- getwd()
homeDirectory <- "/home/jonathanmorgan/work/django/research/work/phd_work/methods"

# data directories
dataDirectory <- paste( homeDirectory, "/data", sep = "" )
workspaceFileName <- "statnet-grp_month.RData"
workspaceFilePath <- paste( dataDirectory, "/", workspaceFileName )

In [3]:
# set working directory to data directory for now.
setwd( dataDirectory )
getwd()


'/home/jonathanmorgan/work/django/research/work/phd_work/methods/data'

Setup - import SNA functions

source the file functions-sna.r.


In [4]:
# basic SNA functions
# - /home/jonathanmorgan/work/django/research/context_analysis/R/sna/functions-sna.r
snaFunctionFilePath <- paste( codeDirectory, "/", 'functions-sna.r', sep = "" )

In [5]:
source( snaFunctionFilePath )

Setup - import statnet functions

source the file statnet/functions-statnet.r.


In [6]:
# statnet/sna functions
# - /home/jonathanmorgan/work/django/research/context_analysis/R/sna/stanet/functions-statnet.r
statnetFunctionFilePath <- paste( codeDirectory, "/statnet/", 'functions-statnet.r', sep = "" )

In [7]:
source( statnetFunctionFilePath )


Loading required package: statnet.common

Attaching package: ‘statnet.common’

The following object is masked from ‘package:base’:

    order

Loading required package: network
network: Classes for Relational Data
Version 1.13.0.1 created on 2015-08-31.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

sna: Tools for Social Network Analysis
Version 2.4 created on 2016-07-23.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
 For citation information, type citation("sna").
 Type help(package="sna") to get started.

Setup - network data - render and store network data

First, need render to render network data and upload it to your server.

Directions for rendering network data are in 2017.11.14-work_log-prelim-network_analysis.ipynb. You want a tab-delimited matrix that includes both the network and attributes of nodes as columns, and you want it to include a header row.

Once you render your network data files, you should place them on the server.

High level data file layout:

  • tab-delimited.
  • first row and first column are labels
  • last 2 columns are traits of nodes (person_id and person_type)
  • each row and column after first until the trait columns represents a person found in one of the articles.
  • The people are in the same order from top to bottom and left to right.
  • Where the row and column of two people meet, and one of the people is an author, the nunber in the cell where they meet is the number of times the non-author was quoted in an article by the author. Does not include more basic two-mode co-location ties (appeared in same article, even if not an author and/or not quoted).

Files and their location on server:

data - grp_month

This is data from the Grand Rapids Press articles from December of 2009, coded by both humans and OpenCalais.

Files:

  • automated full month - sourcenet_data-20171205-022551-grp_month-automated.tab
  • human full month - sourcenet_data-20171115-043102-grp_month-human.tab
  • automated week 1 subset - sourcenet_data-20171206-031358-grp_month-automated-week1_subset.tab
  • human week 1 subset - sourcenet_data-20171206-031319-grp_month-human-week1_subset.tab
  • automated week 2 subset - sourcenet_data-20180326-040445-grp_month-automated-week2_subset.tab
  • human week 2 subset - sourcenet_data-20180326-034401-grp_month-human-week2_subset.tab
  • automated week 3 subset - sourcenet_data-20180326-040736-grp_month-automated-week3_subset.tab
  • human week 3 subset - sourcenet_data-20180326-034548-grp_month-human-week3_subset.tab

Location in Dropbox: Dropbox/academia/MSU/program_stuff/prelim_paper/data/network_analysis/2017.11.14/network/new_coders/grp_month

Location on server: /home/jonathanmorgan/work/django/research/work/phd_work/data/network/grp_month

Setup - load workspace

You must load this file's workspace, from a previous run:


In [8]:
# assumes that you've already set working directory above to the
#     working directory.
setwd( dataDirectory )
load( workspaceFileName )

Compare grp_week_1 and grp_week_2 using QAP

Now, compare the automated and human-coded networks from a week 1 and week 2 to each other, to look at similarity of weeks over time (I'd expect it to be small).

Based on: context_text/R/sna/statnet/sna-qap.r

week_1-to-week_2 - a2b - automated-to-baseline


In [10]:
# setup
outputPrefix <- "week_1-to-week_2 a2b"

In [11]:
w1w2a2bOutput <- compareMatricesQAP( gw1AutomatedNetworkMatrix, gw2HumanNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 04:35:07
----> week_1-to-week_2 a2b graph correlation = 0.0388791393875694 ( @ 2019-07-25 04:35:09 )
----> week_1-to-week_2 a2b QAP correlation analysis complete at 2019-07-25 04:38:31.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.03887914 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0004186863 
		1stQ:	 -0.0004186863 
		Med:	 -0.0004186863 
		Mean:	 -3.175389e-05 
		3rdQ:	 -0.0004186863 
		Max:	 0.005627133 

----> week_1-to-week_2 a2b graph covariance = 1.89039422311724e-05 ( @ 2019-07-25 04:38:32 )
----> week_1-to-week_2 a2b QAP covariance analysis complete at 2019-07-25 04:41:49.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 1.890394e-05 
	Replications: 1000 
	Distribution Summary:
		Min:	 -2.03575e-07 
		1stQ:	 -2.03575e-07 
		Med:	 -2.03575e-07 
		Mean:	 -7.413888e-10 
		3rdQ:	 -2.03575e-07 
		Max:	 5.675661e-06 

----> week_1-to-week_2 a2b graph hamming distance = 1196 ( @ 2019-07-25 04:41:49 )
----> week_1-to-week_2 a2b QAP hamming distance analysis complete at 2019-07-25 04:44:34.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 1196 
	Replications: 1000 
	Distribution Summary:
		Min:	 1216 
		1stQ:	 1228 
		Med:	 1228 
		Mean:	 1227.376 
		3rdQ:	 1228 
		Max:	 1228 

==> End of  compareMatricesQAP  at  2019-07-25 04:44:34

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( w1w2a2bOutput, outputPrefix, TRUE )

week_1-to-week_2 - b2a - baseline-to-automated


In [12]:
# setup
outputPrefix <- "week_1-to-week_2 b2a"

In [13]:
w1w2b2aOutput <- compareMatricesQAP( gw1HumanNetworkMatrix, gw2AutomatedNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 04:44:34
----> week_1-to-week_2 b2a graph correlation = 0.0397098150333047 ( @ 2019-07-25 04:44:34 )
----> week_1-to-week_2 b2a QAP correlation analysis complete at 2019-07-25 04:47:47.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.03970982 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0004459904 
		1stQ:	 -0.0004459904 
		Med:	 -0.0004459904 
		Mean:	 7.196546e-06 
		3rdQ:	 -0.0004459904 
		Max:	 0.0110271 

----> week_1-to-week_2 b2a graph covariance = 2.03487842371895e-05 ( @ 2019-07-25 04:47:47 )
----> week_1-to-week_2 b2a QAP covariance analysis complete at 2019-07-25 04:50:46.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 2.034878e-05 
	Replications: 1000 
	Distribution Summary:
		Min:	 -2.28542e-07 
		1stQ:	 -2.28542e-07 
		Med:	 -2.28542e-07 
		Mean:	 -6.600886e-09 
		3rdQ:	 -2.28542e-07 
		Max:	 5.650694e-06 

----> week_1-to-week_2 b2a graph hamming distance = 1274 ( @ 2019-07-25 04:50:47 )
----> week_1-to-week_2 b2a QAP hamming distance analysis complete at 2019-07-25 04:53:50.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 1274 
	Replications: 1000 
	Distribution Summary:
		Min:	 1294 
		1stQ:	 1306 
		Med:	 1306 
		Mean:	 1305.332 
		3rdQ:	 1306 
		Max:	 1306 

==> End of  compareMatricesQAP  at  2019-07-25 04:53:50

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( w1w2b2aOutput, outputPrefix, TRUE )

Compare grp_week_1 and grp_week_3 using QAP

Now, compare the automated and human-coded networks from a week 1 and week 3 to each other, to look at similarity of weeks over time (I'd expect it to be small).

Based on: context_text/R/sna/statnet/sna-qap.r

week_1-to-week_3 - a2b - automated-to-baseline


In [14]:
outputPrefix <- "week_1-to-week_3 a2b"

In [15]:
w1w3a2bOutput <- compareMatricesQAP( gw1AutomatedNetworkMatrix, gw3HumanNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 04:53:50
----> week_1-to-week_3 a2b graph correlation = 0.0256046850980302 ( @ 2019-07-25 04:53:51 )
----> week_1-to-week_3 a2b QAP correlation analysis complete at 2019-07-25 04:57:02.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.02560469 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0004027144 
		1stQ:	 -0.0004027144 
		Med:	 -0.0004027144 
		Mean:	 -3.535993e-05 
		3rdQ:	 -0.0004027144 
		Max:	 0.00935006 

----> week_1-to-week_3 a2b graph covariance = 1.15763968028605e-05 ( @ 2019-07-25 04:57:02 )
----> week_1-to-week_3 a2b QAP covariance analysis complete at 2019-07-25 05:00:10.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 1.15764e-05 
	Replications: 1000 
	Distribution Summary:
		Min:	 -1.820754e-07 
		1stQ:	 -1.820754e-07 
		Med:	 -1.820754e-07 
		Mean:	 -2.333599e-08 
		3rdQ:	 -1.820754e-07 
		Max:	 4.227352e-06 

----> week_1-to-week_3 a2b graph hamming distance = 1140 ( @ 2019-07-25 05:00:10 )
----> week_1-to-week_3 a2b QAP hamming distance analysis complete at 2019-07-25 05:03:15.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 1140 
	Replications: 1000 
	Distribution Summary:
		Min:	 1152 
		1stQ:	 1164 
		Med:	 1164 
		Mean:	 1163.64 
		3rdQ:	 1164 
		Max:	 1164 

==> End of  compareMatricesQAP  at  2019-07-25 05:03:15

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( w1w3a2bOutput, outputPrefix, TRUE )

week_1-to-week_3 - b2a - baseline-to-automated


In [16]:
outputPrefix <- "week_1-to-week_3 b2a"

In [17]:
w1w3b2aOutput <- compareMatricesQAP( gw1HumanNetworkMatrix, gw3AutomatedNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 05:03:15
----> week_1-to-week_3 b2a graph correlation = 0.0276643456334622 ( @ 2019-07-25 05:03:15 )
----> week_1-to-week_3 b2a QAP correlation analysis complete at 2019-07-25 05:06:38.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.02766435 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0004184268 
		1stQ:	 -0.0004184268 
		Med:	 -0.0004184268 
		Mean:	 5.273967e-05 
		3rdQ:	 -0.0004184268 
		Max:	 0.008942497 

----> week_1-to-week_3 b2a graph covariance = 1.30311828399446e-05 ( @ 2019-07-25 05:06:38 )
----> week_1-to-week_3 b2a QAP covariance analysis complete at 2019-07-25 05:09:49.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 1.303118e-05 
	Replications: 1000 
	Distribution Summary:
		Min:	 -1.970983e-07 
		1stQ:	 -1.970983e-07 
		Med:	 -1.970983e-07 
		Mean:	 1.325874e-09 
		3rdQ:	 -1.970983e-07 
		Max:	 4.212329e-06 

----> week_1-to-week_3 b2a graph hamming distance = 1196 ( @ 2019-07-25 05:09:49 )
----> week_1-to-week_3 b2a QAP hamming distance analysis complete at 2019-07-25 05:12:44.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 1196 
	Replications: 1000 
	Distribution Summary:
		Min:	 1212 
		1stQ:	 1224 
		Med:	 1224 
		Mean:	 1223.492 
		3rdQ:	 1224 
		Max:	 1224 

==> End of  compareMatricesQAP  at  2019-07-25 05:12:44

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( w1w3b2aOutput, outputPrefix, TRUE )

Compare grp_week_2 and grp_week_3 using QAP

Now, compare the automated and human-coded networks from a week 2 and week 3 to each other, to look at similarity of weeks over time (I'd expect it to be small).

Based on: context_text/R/sna/statnet/sna-qap.r

week_2-to-week_3 - a2b - automated-to-baseline


In [18]:
outputPrefix <- "week_2-to-week_3 a2b"

In [19]:
w2w3a2bOutput <- compareMatricesQAP( gw2AutomatedNetworkMatrix, gw3HumanNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 05:12:44
----> week_2-to-week_3 a2b graph correlation = 0.0231018634814177 ( @ 2019-07-25 05:12:44 )
----> week_2-to-week_3 a2b QAP correlation analysis complete at 2019-07-25 05:16:40.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.02310186 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0003984947 
		1stQ:	 -0.0003984947 
		Med:	 -0.0003984947 
		Mean:	 -1.241742e-05 
		3rdQ:	 -0.0003984947 
		Max:	 0.009673087 

----> week_2-to-week_3 a2b graph covariance = 1.01141986496361e-05 ( @ 2019-07-25 05:16:40 )
----> week_2-to-week_3 a2b QAP covariance analysis complete at 2019-07-25 05:20:15.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 1.01142e-05 
	Replications: 1000 
	Distribution Summary:
		Min:	 -1.744645e-07 
		1stQ:	 -1.744645e-07 
		Med:	 -1.744645e-07 
		Mean:	 -9.845883e-09 
		3rdQ:	 -1.744645e-07 
		Max:	 5.704772e-06 

----> week_2-to-week_3 a2b graph hamming distance = 1110 ( @ 2019-07-25 05:20:15 )
----> week_2-to-week_3 a2b QAP hamming distance analysis complete at 2019-07-25 05:23:18.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 1110 
	Replications: 1000 
	Distribution Summary:
		Min:	 1126 
		1stQ:	 1138 
		Med:	 1138 
		Mean:	 1137.648 
		3rdQ:	 1138 
		Max:	 1138 

==> End of  compareMatricesQAP  at  2019-07-25 05:23:18

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( w2w3a2bOutput, outputPrefix, TRUE )

week_2-to-week_3 - b2a - baseline-to-automated


In [20]:
outputPrefix <- "week_2-to-week_3 b2a"

In [21]:
w2w3b2aOutput <- compareMatricesQAP( gw2HumanNetworkMatrix, gw3AutomatedNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 05:23:18
----> week_2-to-week_3 b2a graph correlation = 0.0301755980515345 ( @ 2019-07-25 05:23:19 )
----> week_2-to-week_3 b2a QAP correlation analysis complete at 2019-07-25 05:26:33.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.0301756 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0003886943 
		1stQ:	 -0.0003886943 
		Med:	 -0.0003886943 
		Mean:	 -2.19228e-05 
		3rdQ:	 -0.0003886943 
		Max:	 0.009799403 

----> week_2-to-week_3 b2a graph covariance = 1.30600535831945e-05 ( @ 2019-07-25 05:26:33 )
----> week_2-to-week_3 b2a QAP covariance analysis complete at 2019-07-25 05:29:43.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 1.306005e-05 
	Replications: 1000 
	Distribution Summary:
		Min:	 -1.682276e-07 
		1stQ:	 -1.682276e-07 
		Med:	 -1.682276e-07 
		Mean:	 8.004373e-10 
		3rdQ:	 -1.682276e-07 
		Max:	 4.241199e-06 

----> week_2-to-week_3 b2a graph hamming distance = 1088 ( @ 2019-07-25 05:29:43 )
----> week_2-to-week_3 b2a QAP hamming distance analysis complete at 2019-07-25 05:32:35.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 1088 
	Replications: 1000 
	Distribution Summary:
		Min:	 1112 
		1stQ:	 1120 
		Med:	 1120 
		Mean:	 1119.592 
		3rdQ:	 1120 
		Max:	 1120 

==> End of  compareMatricesQAP  at  2019-07-25 05:32:35

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( w2w3b2aOutput, outputPrefix, TRUE )

Compare grp_month and grp_week_1 using QAP

Now, compare the automated and human-coded networks from the full month and week 1 against each other, to see what more time gets you.

Based on: context_text/R/sna/statnet/sna-qap.r

month-to-week_1 - a2b - automated-to-baseline


In [22]:
outputPrefix <- "month-to-week_1 a2b"

In [23]:
mw1a2bOutput <- compareMatricesQAP( gmAutomatedNetworkMatrix, gw1HumanNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 05:32:35
----> month-to-week_1 a2b graph correlation = 0.478538505658302 ( @ 2019-07-25 05:32:35 )
----> month-to-week_1 a2b QAP correlation analysis complete at 2019-07-25 05:35:33.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.4785385 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0008536133 
		1stQ:	 -0.0008536133 
		Med:	 -0.0008536133 
		Mean:	 -4.414794e-05 
		3rdQ:	 0.0004562012 
		Max:	 0.005695459 

----> month-to-week_1 a2b graph covariance = 0.000536992218843336 ( @ 2019-07-25 05:35:33 )
----> month-to-week_1 a2b QAP covariance analysis complete at 2019-07-25 05:38:25.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.0005369922 
	Replications: 1000 
	Distribution Summary:
		Min:	 -9.578826e-07 
		1stQ:	 -9.578826e-07 
		Med:	 -9.578826e-07 
		Mean:	 -3.484255e-08 
		3rdQ:	 5.119264e-07 
		Max:	 1.22704e-05 

----> month-to-week_1 a2b graph hamming distance = 2000 ( @ 2019-07-25 05:38:26 )
----> month-to-week_1 a2b QAP hamming distance analysis complete at 2019-07-25 05:41:14.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 2000 
	Replications: 1000 
	Distribution Summary:
		Min:	 3188 
		1stQ:	 3204 
		Med:	 3208 
		Mean:	 3205.64 
		3rdQ:	 3208 
		Max:	 3208 

==> End of  compareMatricesQAP  at  2019-07-25 05:41:14

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( mw1a2bOutput, outputPrefix, TRUE )

month-to-week_1 - b2a - baseline-to-automated


In [24]:
outputPrefix <- "month-to-week_1 b2a"

In [25]:
mw1b2aOutput <- compareMatricesQAP( gmHumanNetworkMatrix, gw1AutomatedNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 05:41:14
----> month-to-week_1 b2a graph correlation = 0.486904338082859 ( @ 2019-07-25 05:41:14 )
----> month-to-week_1 b2a QAP correlation analysis complete at 2019-07-25 05:44:14.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.4869043 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0008116987 
		1stQ:	 -0.0008116987 
		Med:	 -0.0008116987 
		Mean:	 -6.665183e-05 
		3rdQ:	 0.0005355832 
		Max:	 0.008619274 

----> month-to-week_1 b2a graph covariance = 0.000531185347569327 ( @ 2019-07-25 05:44:15 )
----> month-to-week_1 b2a QAP covariance analysis complete at 2019-07-25 05:47:11.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.0005311853 
	Replications: 1000 
	Distribution Summary:
		Min:	 -8.855178e-07 
		1stQ:	 -8.855178e-07 
		Med:	 -8.855178e-07 
		Mean:	 -2.714933e-08 
		3rdQ:	 5.842912e-07 
		Max:	 1.087295e-05 

----> month-to-week_1 b2a graph hamming distance = 2070 ( @ 2019-07-25 05:47:11 )
----> month-to-week_1 b2a QAP hamming distance analysis complete at 2019-07-25 05:49:58.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 2070 
	Replications: 1000 
	Distribution Summary:
		Min:	 3234 
		1stQ:	 3254 
		Med:	 3258 
		Mean:	 3255.7 
		3rdQ:	 3258 
		Max:	 3258 

==> End of  compareMatricesQAP  at  2019-07-25 05:49:58

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( mw1b2aOutput, outputPrefix, TRUE )

Compare grp_month and grp_week_2 using QAP

Now, compare the automated and human-coded networks from the full month and week 2 against each other, to see what more time gets you.

Based on: context_text/R/sna/statnet/sna-qap.r

month-to-week_2 - a2b - automated-to-baseline


In [26]:
outputPrefix <- "month-to-week_2 a2b"

In [27]:
mw2a2bOutput <- compareMatricesQAP( gmAutomatedNetworkMatrix, gw2HumanNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 05:49:58
----> month-to-week_2 a2b graph correlation = 0.483895955658828 ( @ 2019-07-25 05:49:58 )
----> month-to-week_2 a2b QAP correlation analysis complete at 2019-07-25 05:52:56.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.483896 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0007929573 
		1stQ:	 -0.0007929573 
		Med:	 -0.0007929573 
		Mean:	 -3.456175e-05 
		3rdQ:	 0.0006325983 
		Max:	 0.007760376 

----> month-to-week_2 a2b graph covariance = 0.000498917493879292 ( @ 2019-07-25 05:52:56 )
----> month-to-week_2 a2b QAP covariance analysis complete at 2019-07-25 05:55:55.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.0004989175 
	Replications: 1000 
	Distribution Summary:
		Min:	 -8.17573e-07 
		1stQ:	 -8.17573e-07 
		Med:	 -8.17573e-07 
		Mean:	 -4.44535e-08 
		3rdQ:	 6.52236e-07 
		Max:	 6.531472e-06 

----> month-to-week_2 a2b graph hamming distance = 2008 ( @ 2019-07-25 05:55:56 )
----> month-to-week_2 a2b QAP hamming distance analysis complete at 2019-07-25 05:58:44.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 2008 
	Replications: 1000 
	Distribution Summary:
		Min:	 3084 
		1stQ:	 3100 
		Med:	 3104 
		Mean:	 3101.872 
		3rdQ:	 3104 
		Max:	 3104 

==> End of  compareMatricesQAP  at  2019-07-25 05:58:44

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( mw2a2bOutput, outputPrefix, TRUE )

month-to-week_2 - b2a - baseline-to-automated


In [28]:
outputPrefix <- "month-to-week_2 b2a"

In [29]:
mw2b2aOutput <- compareMatricesQAP( gmHumanNetworkMatrix, gw2AutomatedNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 05:58:44
----> month-to-week_2 b2a graph correlation = 0.475029272978571 ( @ 2019-07-25 05:58:44 )
----> month-to-week_2 b2a QAP correlation analysis complete at 2019-07-25 06:01:42.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.4750293 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0008031936 
		1stQ:	 -0.0008031936 
		Med:	 -0.0008031936 
		Mean:	 -6.161842e-05 
		3rdQ:	 0.0005881294 
		Max:	 0.01171871 

----> month-to-week_2 b2a graph covariance = 0.000501826182375643 ( @ 2019-07-25 06:01:42 )
----> month-to-week_2 b2a QAP covariance analysis complete at 2019-07-25 06:04:34.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.0005018262 
	Replications: 1000 
	Distribution Summary:
		Min:	 -8.485026e-07 
		1stQ:	 -8.485026e-07 
		Med:	 -8.485026e-07 
		Mean:	 2.750359e-08 
		3rdQ:	 6.213064e-07 
		Max:	 9.440161e-06 

----> month-to-week_2 b2a graph hamming distance = 2144 ( @ 2019-07-25 06:04:35 )
----> month-to-week_2 b2a QAP hamming distance analysis complete at 2019-07-25 06:07:10.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 2144 
	Replications: 1000 
	Distribution Summary:
		Min:	 3212 
		1stQ:	 3228 
		Med:	 3232 
		Mean:	 3230.032 
		3rdQ:	 3232 
		Max:	 3232 

==> End of  compareMatricesQAP  at  2019-07-25 06:07:10

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( mw2b2aOutput, outputPrefix, TRUE )

Compare grp_month and grp_week_3 using QAP

Now, compare the automated and human-coded networks from the full month and week 3 against each other, to see what more time gets you.

Based on: context_text/R/sna/statnet/sna-qap.r

month-to-week_3 - a2b - automated-to-baseline


In [30]:
outputPrefix <- "month-to-week_3 a2b"

In [31]:
mw3a2bOutput <- compareMatricesQAP( gmAutomatedNetworkMatrix, gw3HumanNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 06:07:10
----> month-to-week_3 a2b graph correlation = 0.405504542903472 ( @ 2019-07-25 06:07:10 )
----> month-to-week_3 a2b QAP correlation analysis complete at 2019-07-25 06:10:18.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.4055045 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0007627079 
		1stQ:	 -0.0007627079 
		Med:	 -0.0007627079 
		Mean:	 2.376415e-05 
		3rdQ:	 0.000770376 
		Max:	 0.008435796 

----> month-to-week_3 a2b graph covariance = 0.000388768161699877 ( @ 2019-07-25 06:10:19 )
----> month-to-week_3 a2b QAP covariance analysis complete at 2019-07-25 06:13:23.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.0003887682 
	Replications: 1000 
	Distribution Summary:
		Min:	 -7.312287e-07 
		1stQ:	 -7.312287e-07 
		Med:	 -7.312287e-07 
		Mean:	 7.361953e-10 
		3rdQ:	 7.385803e-07 
		Max:	 1.102724e-05 

----> month-to-week_3 a2b graph hamming distance = 2096 ( @ 2019-07-25 06:13:23 )
----> month-to-week_3 a2b QAP hamming distance analysis complete at 2019-07-25 06:16:04.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 2096 
	Replications: 1000 
	Distribution Summary:
		Min:	 3020 
		1stQ:	 3036 
		Med:	 3040 
		Mean:	 3038.292 
		3rdQ:	 3040 
		Max:	 3040 

==> End of  compareMatricesQAP  at  2019-07-25 06:16:04

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( mw3a2bOutput, outputPrefix, TRUE )

month-to-week_3 - b2a - baseline-to-automated


In [32]:
outputPrefix <- "month-to-week_3 b2a"

In [33]:
mw3b2aOutput <- compareMatricesQAP( gmHumanNetworkMatrix, gw3AutomatedNetworkMatrix, outputPrefix )


==> Start of  compareMatricesQAP  at  2019-07-25 06:16:04
----> month-to-week_3 b2a graph correlation = 0.407912811805851 ( @ 2019-07-25 06:16:04 )
----> month-to-week_3 b2a QAP correlation analysis complete at 2019-07-25 06:18:57.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.4079128 
	Replications: 1000 
	Distribution Summary:
		Min:	 -0.0007535538 
		1stQ:	 -0.0007535538 
		Med:	 -0.0007535538 
		Mean:	 3.199379e-05 
		3rdQ:	 0.0007600253 
		Max:	 0.01135508 

----> month-to-week_3 b2a graph covariance = 0.000396116673198478 ( @ 2019-07-25 06:18:57 )
----> month-to-week_3 b2a QAP covariance analysis complete at 2019-07-25 06:22:00.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 0 
	p(f(perm) <= f(d)): 1 

Test Diagnostics:
	Test Value (f(d)): 0.0003961167 
	Replications: 1000 
	Distribution Summary:
		Min:	 -7.317623e-07 
		1stQ:	 -7.317623e-07 
		Med:	 -7.317623e-07 
		Mean:	 -2.478416e-08 
		3rdQ:	 7.380467e-07 
		Max:	 6.617283e-06 

----> month-to-week_3 b2a graph hamming distance = 2206 ( @ 2019-07-25 06:22:00 )
----> month-to-week_3 b2a QAP hamming distance analysis complete at 2019-07-25 06:24:38.  Summary:
QAP Test Results

Estimated p-values:
	p(f(perm) >= f(d)): 1 
	p(f(perm) <= f(d)): 0 

Test Diagnostics:
	Test Value (f(d)): 2206 
	Replications: 1000 
	Distribution Summary:
		Min:	 3134 
		1stQ:	 3146 
		Med:	 3150 
		Mean:	 3148.208 
		3rdQ:	 3150 
		Max:	 3150 

==> End of  compareMatricesQAP  at  2019-07-25 06:24:38

In [ ]:
# also output plots of distributions of QAP values?
displayCompareMatricesQAPOutput( mw3b2aOutput, outputPrefix, TRUE )

Save workspace image

Save all the information in the current image, in case we need/want it later.


In [34]:
# help( save.image )
save.image( file = workspace_file_name )