It reminds me those endless discussions about similarities and differences between PCA and EFA:-)

I think it also opens up links between networks and Partial Least Squares, canonical correlation analysis, etc., don’t you think? ]]>

Karalunas, S. L., Fair, D., Musser, E. D., Aykes, K., Iyer, S. P., & Nigg, J. T. (2014). Subtyping Attention-Deficit/Hyperactivity Disorder Using Temperament Dimensions : Toward Biologically Based Nosologic Criteria. JAMA Psychiatry, 97239(9), 1015–1024. http://doi.org/10.1001/jamapsychiatry.2014.763

]]>`library('qgraph')`

library('IsingFit')

library('bootnet')

library('igraph')

network1 < - estimateNetwork(data1, default="IsingFit")

graph1 < - plot(network1, layout="spring", cut=0, filetype="pdf", filename="network")

I then transferred the network into igraph and ran spinglass 100 times, each time changing the seed.

`g = as.igraph(graph1, attributes=TRUE)`

matrix_spinglass < - matrix(NA, nrow=1,ncol=100)

for (i in 1:100) {

set.seed(i)

spinglass < - spinglass.community(g)

matrix_spinglass[1,i] < - max(spinglass$membership)

}

The results differed from each other, as you can see e.g. from the mean:

`mean(as.vector(matrix_spinglass)) #5.87`

max(as.vector(matrix_spinglass)) #7

min(as.vector(matrix_spinglass)) #5

median(as.vector(matrix_spinglass)) #6

I think this is correct — if there are inconsistencies please do let me know.

]]>I’m following your advice to set.seed() prior to using the spinglass.community command, but I’m not sure I’m doing it correctly. Shouldn’t I see a different computation and graphic output if I set a diffferent seed, because I’m noticing the same output regardless of seed.

rnorm(20)

set.seed(2)

rnorm(20)

#Now if we want the same random numbers

#we can just set the seed to the same thing

set.seed(2)

g = as.igraph(graph1, attributes=TRUE)

sgc <- spinglass.community(g)

Thanks, Rick

]]>By the way, I’d love to see your results if you’re willing to share. Glad this methodology is applied to other fields, we usually model people as rows, you model them as columns.

]]>