I am following this tutorial for Multiple Regression - Quadratic Assignment Procedure http://www.umasocialmedia.com/socialnetworks/lecture-9-patterns-in-social-networks/. It is used to study the multiplexity of nodes i.e age, gender attribute. I have tried to execute the given code for given context. In this tutorial they find similarity on basis of gender, same political party, country and number of bills cosponsor together. First they read 4 CSV files and convert them into matrix format. When I tried to execute, got this error
Error in predicting_matrices[1, , ] <- gender_matrix : number of items to replace is not a multiple of replacement length
getwd()
library(sna)
#Load Same-County Network
county_network=read.csv(file.choose(),header=TRUE)
county_matrix=as.matrix(county_network)
#Load Same-Gender Network
gender_network=read.csv(file.choose(),header=TRUE)
gender_matrix=as.matrix(gender_network)
#Load Same-Party Network
party_network=read.csv(file.choose(),header=TRUE)
party_matrix=as.matrix(party_network)
#Load Number-Joint-Cosponsorships Network
cosp_network=read.csv(file.choose(),header=TRUE)
cosp_matrix=as.matrix(cosp_network)
#Join The Predicting Matrices Together
predicting_matrices <- array (NA, c(3, length(county_network[1,]), length(county_network[1,])))
predicting_matrices[1,,] <- county_matrix
Error in predicting_matrices[1, , ] <- county_matrix :
number of items to replace is not a multiple of replacement length
predicting_matrices[2,,] <- gender_matrix
Error in predicting_matrices[1, , ] <- gender_matrix :
number of items to replace is not a multiple of replacement length
predicting_matrices[3,,] <- party_matrix
Error in predicting_matrices[1, , ] <- party_matrix :
number of items to replace is not a multiple of replacement length
#Now Run a QAP Regression called model and Show the Results
model <- netlm(cosp_matrix,predicting_matrices)
Error in netlm(cosp_matrix, predicting_matrices) :
Homogeneous graph orders required in netlm.