qaptest
tests an arbitrary graph-level statistic (computed on dat
by FUN
) against a QAP null hypothesis, via Monte Carlo simulation of likelihood quantiles. Note that fair amount of flexibility is possible regarding QAP tests on functions of such statistics (see an equivalent discussion with respect to CUG null hypothesis tests in Anderson et al. (1999)). See below for more details.qaptest(dat, FUN, reps=1000, ...)
FUN
must accept dat
and the specified g
arguments, and should return a real number.reps
=1000.FUN
.qaptest
, containingThe qaptest
procedure returns a qaptest
object containing the estimated likelihood (distribution of the test statistic under the null hypothesis), the observed value of the test statistic on the input data, and the one-tailed p-values (estimated quantiles) associated with said observation. As usual, the (upper tail) null hypothesis is rejected for significance level alpha if p>=observation is less than alpha (or p<=observation, for="" the="" lower="" tail);="" if="" hypothesis="" is="" undirected,="" then="" one="" rejects="" either="" p<="observation" or="" p="">=observation is less then alpha/2. Standard caveats regarding the use of null hypothesis testing procedures are relevant here: in particular, bear in mind that a significant result does not necessarily imply that the likelihood ratio of the null model and the alternative hypothesis favors the latter.=observation,>
In interpreting a QAP test, it is important to bear in mind the nature of the QAP null hypothesis. The QAP test should not be interpreted as evaluating underlying structural differences; indeed, QAP is more accurately understood as testing differences induced by a particular vertex labeling controlling for underlying structure. Where there is substantial automorphism in the underling structures, QAP will tend to given non-significant results. (In fact, it is impossible to obtain a one-tailed significance level in excess of $\max_{g \in {G,H}} \frac{|Aut(g)|}{|Perm(g)|}$ when using a QAP test on a bivariate graph statistic $f(G,H)$, where Aut(g) and Perm(g) are the automorphism and permutation groups on g, respectively. This follows from the fact that all members of Aut(g) will induce the same values of $f()$.) By turns, significance under QAP does not necessarily imply that the observed structural relationship is unusual relative to what one would expect from typical structures with (for instance) the sizes and densities of the graphs in question. In contexts in which one's research question implies a particular labeling of vertices (e.g., "within this group of individuals, do friends also tend to give advice to one another"), QAP can be a very useful way of ruling out spurious structural influences (e.g., some respondents tend to indiscriminately nominate many people (without regard to whom), resulting in a structural similarity which has nothing to do with the identities of those involved). Where one's question does not imply a labeled relationship (e.g., is the shape of this group's friendship network similar to that of its advice network), the QAP null hypothesis is inappropriate.
Hubert, L.J., and Arabie, P. (1989). ``Combinatorial Data Analysis: Confirmatory Comparisons Between Sets of Matrices.'' Applied Stochastic Models and Data Analysis, 5, 273-325.
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.
cugtest
#Generate three graphs
g<-array(dim=c(3,10,10))
g[1,,]<-rgraph(10)
g[2,,]<-rgraph(10,tprob=g[1,,]*0.8)
g[3,,]<-1; g[3,1,2]<-0 #This is nearly a clique
#Perform qap tests of graph correlation
q.12<-qaptest(g,gcor,g1=1,g2=2)
q.13<-qaptest(g,gcor,g1=1,g2=3)
#Examine the results
summary(q.12)
plot(q.12)
summary(q.13)
plot(q.13)
Run the code above in your browser using DataLab