- Introduced by
- Lawrence Hubert & James Schultz; David Krackhardt
- Year
- 1976 (QAP); 1988 (network application)
- Type
- Permutation-based test of association between two matrices
- Family
- Dyadic network inference
What does it do?
The quadratic assignment procedure (QAP) tests whether two relational matrices measured on the same set of actors are associated, for example whether advice ties align with friendship ties.
Because the cells of a network matrix are not independent, ordinary correlation tests give invalid p-values. QAP instead compares the observed matrix correlation with a reference distribution built by repeatedly relabeling the nodes of one matrix.
The intuition behind the method
Every cell of a network matrix shares a row actor and a column actor with other cells, so the usual assumption of independent observations fails. QAP asks a different question: how large a matrix correlation would appear if the two matrices had no actor-level correspondence? It answers by applying the same random permutation of node labels to the rows and columns of one matrix. This keeps that matrix's internal pattern of ties but breaks its alignment with the other matrix. The statistic is recomputed across many such permutations, and the observed value is judged against this shuffled distribution.
History
Lawrence Hubert and James Schultz presented quadratic assignment in 1976 as a general data-analysis strategy for proximity matrices, drawing on an operations-research paradigm. Their paper centers on a computational search heuristic applied to clustering, seriation, and scaling problems, and it is the origin of the general quadratic assignment paradigm rather than of the network correlation test itself. David Krackhardt's 1988 paper in Social Networks, titled Predicting with networks: Nonparametric multiple regression analysis of dyadic data, is the network application of node-permutation inference cited on this page; the bivariate correlation test is the single-predictor case of that approach.
When to use it
Use QAP correlation to test whether two relations defined on the same actor set are associated, such as friendship versus advice ties, or an observed network versus a hypothesized structure, when the question is bivariate and the inference must respect dyadic dependence. Use MRQAP instead when you have several predictor matrices and need a multiple regression. Do not use QAP when the goal is to model endogenous structure such as reciprocity or transitivity; an exponential random graph model addresses that question. QAP also assumes complete square matrices on a fixed node set, so it is a poor fit for sampled dyads or missing ties, and it cannot represent nodal attributes except as matrices.
Limitations and considerations
- The test addresses association only and does not model structural dependence such as reciprocity or transitivity within either matrix.
- The permutation null treats actors as exchangeable. If actors differ systematically in ways not captured by the matrices, the reference distribution can mislead.
- The bivariate test does not adjust for third matrices or for actor attributes that may confound the association; use MRQAP when such controls are needed.
- The coefficient is a descriptive measure of association, and the p-value only says whether it is unlikely under random relabeling.
- It requires complete matrices on a common, fixed node set; sampled or missing dyads must be handled before testing.
- Precise p-values need many permutations, and for large networks this makes the computation slow.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Gives permutation-based p-values for association between matrices without relying on the independence of dyads, which ordinary tests assume.
- The cross-product statistic sums over ordered pairs with i not equal to j and does not require symmetric matrices, so it applies to directed as well as undirected relations.
- Inference rests on the permutation distribution rather than a parametric distribution for the cell values.
- The same permutation logic is the building block for multiple-matrix regression (MRQAP).
Applications
- Testing whether friendship and advice networks in an organization overlap more than chance.
- Comparing an observed network against a theoretically predicted structure (e.g., a formal org chart).
- Assessing the correspondence between trade and military-alliance networks among nations.
- Evaluating whether spatial proximity predicts communication ties.
- Validating the similarity of networks measured by different instruments or informants.
How it works
How it works
Compute the association between the two matrices on the observed data, either as the cross-product sum over ordered pairs with i not equal to j, or as the Pearson correlation of the vectorized off-diagonal cells. Choose one statistic and use exactly the same one for the permuted matrices. This single number is the value against which the permuted statistics are compared.
Formula
\Gamma = \sum_{i\neq j} X_{ij}\,Y_{ij}\quad\text{or}\quad r_{XY}=\mathrm{corr}\bigl(\mathrm{vec}(X),\mathrm{vec}(Y)\bigr)Draw a random permutation of the node labels and apply it to the rows and columns of one matrix at the same time. Only one matrix needs to be permuted. This keeps that matrix's internal pattern of ties intact while removing any systematic correspondence with the second matrix, which is the null hypothesis of no association between the two relations.
Formula
X^{(p)}_{ij} = X_{\pi(i)\pi(j)},\quad \pi\sim \text{Uniform}(S_n)Recompute the same statistic (the cross-product sum or the correlation, as chosen) for each of B permuted matrices to form an empirical reference distribution under the null. Because whole matrices are relabeled rather than individual cells resampled, the reference distribution reflects the dependence among dyads, which an ordinary sampling distribution does not. B is usually set in the thousands so that the p-value is stable.
Formula
\Gamma^{(p)} = \sum_{i\neq j} X^{(p)}_{ij}\,Y_{ij},\quad p=1,\dots,BThe p-value is the proportion of permuted statistics whose absolute value is at least as large as the absolute value of the observed statistic, so the comparison is two-sided. The formula applies equally to the cross-product sum or the correlation, provided the same statistic is used for the observed and permuted values. A small value means the observed association is unlikely under random relabeling of the actors.
Formula
\hat{p} = \frac{1}{B}\sum_{p=1}^{B} \mathbb{1}\bigl(|\Gamma^{(p)}| \geq |\Gamma|\bigr)Common pitfalls
- Reporting an ordinary parametric p-value for the matrix correlation instead of the permutation p-value, which understates uncertainty for dyadic data.
- Using too few permutations, so the p-value is coarse and unstable near conventional thresholds.
- Including self-ties on the diagonal when they have no substantive meaning. The observed statistic excludes i equal to j, so the diagonal must be handled identically in the observed and permuted statistics.
- Reading a significant QAP correlation as evidence of a causal or generative mechanism; it indicates bivariate association only.
Frequently asked questions
Why can't I just use an ordinary correlation test on the two matrices?
Because network dyads are not independent: every cell shares actors with the rest of its row and column, so the effective sample size is far smaller than the number of cells. Ordinary tests assume independence and therefore report standard errors that are too small and p-values that are too optimistic. QAP's node-permutation null preserves the dependence structure, yielding valid inference.
What exactly is being permuted in QAP?
The labels (identities) of the nodes are permuted, and that permutation is applied to the rows and columns of one matrix together. This keeps the matrix's internal relational pattern intact while scrambling its alignment with the other matrix, which is precisely the null hypothesis of no association between the two relations.
How is QAP related to the Mantel test?
Both compare two matrices using a permutation reference distribution in which the objects of one matrix are relabeled, so the underlying logic is similar. QAP is the term used in the network literature, where it is applied to directed and undirected relations among actors and, in its regression form, to multiple predictor matrices (MRQAP).
Related methods
Sources
Krackhardt, D. (1988). Predicting with networks: Nonparametric multiple regression analysis of dyadic data. Social Networks, 10(4), 359–381.
Open DOI referenceHubert, L., & Schultz, J. (1976). Quadratic assignment as a general data analysis strategy. British Journal of Mathematical and Statistical Psychology, 29(2), 190–241.
Open DOI reference