Padgett networks

May 11, 2018

Extended family names. Pajek description as multi-relational network.

Different ordering of original vector data.

> library(sna)
> test <- read.paj("http://vlado.fmf.uni-lj.si/pub/networks/data/GD/gd98/A98.net")
> plot(test,main=test%n%'title')
>
> netM <- read.paj("C:/Users/batagelj/Documents/papers/2018/moskva/NetR/nets/padgett/padgettM.net")
> plot(netM,main=netM%n%'title')

> setwd("C:/Users/batagelj/Documents/papers/2018/moskva/NetR/nets/padgett")
> netB <- read.paj("padgettB.net")
> plot(netB,main=netB%n%'title')

> wealth <- read.csv("wealth.vec",skip=2,header=FALSE)
> plot(netB,main=netB%n%'title',label=netB%v%"vertex.names",vertex.cex=0.05*wealth$V1)
>
> plot(netM,main=netM%n%'title',label=netM%v%"vertex.names",vertex.cex=0.05*wealth$V1)
>
> nacf(netM,wealth$V1,type="moran",mode="graph")[2]
         1 
-0.3107353 
> nacf(netM,wealth$V1,type="geary",mode="graph")[2]
       1 
1.683607 
> cugBetSize <- cug.test(netB,
+                        centralization,
+                        FUN.arg=list(FUN=betweenness), 
+                        mode="graph", 
+                        cmode="size")
> cugBetEdges <- cug.test(netB,
+                         centralization,
+                         FUN.arg=list(FUN=betweenness), 
+                         mode="graph", 
+                         cmode="edges")
> cugBetDyad <- cug.test(netB,
+                        centralization,
+                        FUN.arg=list(FUN=betweenness), 
+                        mode="graph", 
+                        cmode="dyad.census")
> # Aggregate the findings...if you prefer.
> Betweenness <- c(cugBetSize$obs.stat, cugBetEdges$obs.stat, cugBetDyad$obs.stat)
> PctGreater <- c(cugBetSize$pgteobs, cugBetEdges$pgteobs, cugBetDyad$pgteobs)
> PctLess <- c(cugBetSize$plteobs, cugBetEdges$plteobs, cugBetDyad$plteobs)
> Betweenness <- cbind(Betweenness, PctGreater, PctLess)
> rownames(Betweenness) <- c("Size", "Edges", "Dyads")
> Betweenness
      Betweenness PctGreater PctLess
Size    0.2057143      0.000   1.000
Edges   0.2057143      0.727   0.274
Dyads   0.2057143      0.728   0.273
> 
> 
> par(mfrow=c(1,3))
> plot(cugBetSize, main="Betweenness \nConditioned on Size" )
> plot(cugBetEdges, main="Betweenness \nConditioned on Edges" )
> plot(cugBetDyad, main="Betweenness \nConditioned on Dyads" )
> par(mfrow=c(1,1))
> 
> 
> # Get the Correlation value
> gcor(netB,netM)
[1] 0.3718679
> # Is it significant?
> pCor <- qaptest(list(netB,netM),gcor,g1=1,g2=2,reps=1000)
> pCor

QAP Test Results

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

> plot(pCor, xlim=c(-0.25, 0.4))
>
> party <- read.csv("party.clu",skip=2,header=FALSE)$V1
> party
 [1] 1 3 3 2 2 1 2 2 1 1 2 1 1 3 2 1 
vlado/notes/snet/padg.txt · Last modified: 2018/05/12 05:04 by vlado
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki