QAP.MG | R Documentation |
Estimates a MRQAP model taking the multilevel/grouped nature of the into account. An application and detailed description of the multigroup extension of MRQAP can be found in Elmer and Stadtfeld (2020).
QAP.MG(
dvs,
ivs,
iv.list.per = "group",
family = "gaussian",
iv.names = iv.names,
mode = "yQAP",
samples = 1000,
diag = FALSE,
directed = TRUE,
cpu = 1,
round.to = 5,
logfilename = "QAP.log",
verbose = TRUE,
global.deltas = FALSE
)
dvs |
a list of matrices where each matrix represents the dependent network of one group. Cells of the matrix indicating the presence of a tie (1 = tie, 0 = no tie for binary variables) or the weight of a tie (for continuous tie variables) characterizing the dependent networks |
ivs |
a list of lists with where each sets of independent matrices are grouped by group and then independent variables. If the list is organized per independent network the argument iv.list.per = "iv" can be used to restructure the data. |
iv.list.per |
lists in the ivs argument are should be nested by group and independent matrices, if this is not the case (grouped by independent matrices and then groups) the argument iv.list.per = "iv" can be used to restructure the data. |
family |
family of the generalized linear model. default is "gaussian" for continuous dependent varaibles. F or binday dependent variables "binomial" is advised. |
iv.names |
names of the independent variables for the output object |
mode |
permutation method to be applied. default is "yQAP" for permuting the Y / dv variables."dspQAP" applies Dekker's semi partialing method (Dekker, Krackhard, & Snijders, 2007) |
samples |
number of permutations, default is 1000. |
diag |
boolean for using the diagonal values of matrices in the estimation. default is FALSE |
directed |
"directed" if the dependent network is directed (ties from A to B and B to A are possible), "undirected" if the dependent network is undirected (ties from A to B are identical to B to A). Default is "directed". |
cpu |
number of cpu's to be used for estimation, default is 1 |
round.to |
numeric, numer of digits in output table |
logfilename |
name of log file printing intermediate reports during the estimation procedure. |
verbose |
reports of what is happening under the hood during the call of the function, default is TRUE |
global.deltas |
during "dspQAP" estimation, should global or local delta values be used. default is TRUE |
return.perms |
should permuted networks be part of the output? default is FALSE |
Dekker, D., Krackhardt, D., & Snijders, T.A.B. (2007). “Sensitivity of MRQAP Tests to Collinearity and Autocorrelation Conditions.” Psychometrika, 72(4), 563-581.
Elmer, T., & Stadtfeld, C. (2020). “Depressive symptoms are associated with social isolation in face-to-face interaction networks”. Scientific Reports, 1–12. https://doi.org/10.1038/s41598-020-58297-9
Krackhardt, D. (1987). “QAP Partialling as a Test of Spuriousness.” Social Networks, 9 171-186.
Krackhardt, D. (1988). “Predicting With Networks: Nonparametric Multiple Regression Analyses of Dyadic Data.” Social Networks, 10, 359-382.
QAP
# create test data #
inspired by the example funciton in sna::netlm
ivnet1<-sna::rgraph(20,4)
ivnet2<-sna::rgraph(20,4)
dv1<-ivnet1[1,,]+4*ivnet1[2,,]+2*ivnet1[3,,] # Note that the fourth graph is unrelated
dv1 <- dv1 + rnorm(400,mean = 1, sd = 1)
dv2 <- 2*ivnet2[1,,]+3*ivnet2[2,,]+3*ivnet2[3,,]
dv2 <- dv2 + rnorm(400,mean = 1, sd = 1)
dvs <- list(dv1, dv2)
iv1 <- list(ivnet1[1,,],ivnet1[2,,],ivnet1[3,,], ivnet1[4,,])
iv2 <- list(ivnet2[1,,],ivnet2[2,,],ivnet2[3,,], ivnet2[4,,])
ivs <- list(iv1, iv2)
iv.names = c("intercept",paste0("IV",1:4))
QAP.MG(dvs, ivs, iv.names = c("intercept",paste0("IV",1:4)), samples = 3000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.