====== CONCOR in R ====== http://homepage.ntu.edu.tw/~wenthung/R_Network/Lab5.html #REPLICATE BREIGER ET AL. (1975) #INSTALL CONCOR devtools::install_github("aslez/concoR") #LIBRARIES library(concoR) library(sna) #LOAD DATA data(bank_wiring) bank_wiring #CHECK INITIAL CORRELATIONS (TABLE III) m0 <- cor(do.call(rbind, bank_wiring)) round(m0, 2) #IDENTIFY BLOCKS USING A 4-BLOCK MODEL (TABLE IV) blks <- concor_hca(bank_wiring, p = 2) blks #CHECK FIT USING SNA (TABLE V) #code below fails unless glabels are specified blk_mod <- blockmodel(bank_wiring, blks$block, glabels = names(bank_wiring), plabels = rownames(bank_wiring[[1]])) blk_mod plot(blk_mod)