Skip to content

QAPLogit formulas ​

Dyadic logistic model ​

For a binary dyadic outcome Yij and dyadic predictors Xij1,…,Xijp, the model is:

Pr(Yij=1)=logit−1(β0+∑k=1pβkXijk)

Equivalently:

log⁡(Pr(Yij=1)1−Pr(Yij=1))=β0+∑k=1pβkXijk

Dyad extraction ​

For directed networks, the default dyad set is:

{(i,j):i≠j}

For undirected networks, the default dyad set is the upper triangle:

{(i,j):i<j}

Self-dyads are excluded by default.

QAP node-label permutations ​

For each permutation π of node labels, the dependent matrix is permuted as:

Y(π)=PπYPπT

The dyadic predictors remain fixed. The model is then re-fit on the permuted outcome to obtain a permutation distribution of coefficients.

Empirical p-values ​

The initial implementation uses a plus-one empirical p-value:

p=1+∑b=1BI(|Tb|≥|Tobs|)B+1

where:

  • Tobs is the observed coefficient;
  • Tb is the coefficient from permutation b;
  • B is the number of permutations.

This plus-one correction avoids returning zero p-values from a finite permutation sample.