A closer look into the S&P 500 stock network properties.
This is the same network that I used for Hw 7. The small network above is a filtered correlation network created from the S&P 500. I grabbed the close prices from all s&p 500 stocks for 2021. I then created a correlation matrix from those prices. I then created ties for stocks that were 98% correlated. This filtered down the list of 500 stocks to 32 stocks. I then filtered out any isolates.
I first need to change my network objects into adjacency matrixs.
small.mat <- as.matrix(as_adjacency_matrix(small_network))
small.cug <- sna::cug.test(small.mat,FUN=gtrans,mode="digraph",cmode="size", reps = 100)
small.cug
Univariate Conditional Uniform Graph Test
Conditioning Method: size
Graph Type: digraph
Diagonal Used: FALSE
Replications: 100
Observed Value: 0.4322034
Pr(X>=Obs): 1
Pr(X<=Obs): 0
plot(small.cug)
[1] "The T stat: -4.09960327592022"
There is a low probability the transitivity can be randomly generated.
small.cug <-cug.test(small.mat,FUN=centralization, FUN.arg=list(FUN=degree, cmode="indegree"), mode="digraph", cmode="size")
#plot vs simulation results
plot(small.cug)
paste("T Statistic: ",cug.t(small.cug))
[1] "T Statistic: -1.03322042697641"
There is a good probability that the degree could be randomly generated.
small.bet <-cug.test(small.mat,FUN=centralization, FUN.arg=list(FUN=betweenness, cmode="directed"), mode="digraph", cmode="size", reps=100)
#plot vs simulation results
plot(small.bet)
paste("T stat: ", cug.t(small.bet))
[1] "T stat: 37.733590672985"
There is a very small probability that the betweeness could be randomly generated.
small.trans <- cug.test(small.mat,FUN=gtrans,mode="digraph",cmode="dyad")
small.trans
Univariate Conditional Uniform Graph Test
Conditioning Method: dyad.census
Graph Type: digraph
Diagonal Used: FALSE
Replications: 1000
Observed Value: 0.4322034
Pr(X>=Obs): 0
Pr(X<=Obs): 1
plot(small.trans)
paste("T stat: ", cug.t(small.trans))
[1] "T stat: 7.6129532301842"
small.edge<-cug.test(small.mat,FUN=gtrans,mode="digraph",cmode="edges", reps=100)
small.edge
Univariate Conditional Uniform Graph Test
Conditioning Method: edges
Graph Type: digraph
Diagonal Used: FALSE
Replications: 100
Observed Value: 0.4322034
Pr(X>=Obs): 0
Pr(X<=Obs): 1
plot(small.edge)
paste("T stat: ", cug.t(small.edge))
[1] "T stat: 16.395883128983"
Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Sullivan (2022, May 11). Data Analytics and Computational Social Science: Inferential Network Statistics. Retrieved from https://pjsulliv34.github.io/Blog/posts/2022-04-24-inferential-network-statistics/
BibTeX citation
@misc{sullivan2022inferential, author = {Sullivan, Peter}, title = {Data Analytics and Computational Social Science: Inferential Network Statistics}, url = {https://pjsulliv34.github.io/Blog/posts/2022-04-24-inferential-network-statistics/}, year = {2022} }