qaptest                 package:sna                 R Documentation

_P_e_r_f_o_r_m _Q_u_a_d_r_a_t_i_c _A_s_s_i_g_n_m_e_n_t _P_r_o_c_e_d_u_r_e (_Q_A_P) _H_y_p_o_t_h_e_s_i_s _T_e_s_t_s _f_o_r _G_r_a_p_h-_L_e_v_e_l _S_t_a_t_i_s_t_i_c_s

_D_e_s_c_r_i_p_t_i_o_n:

     `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.

_U_s_a_g_e:

     qaptest(dat, FUN, reps=1000, ...)

_A_r_g_u_m_e_n_t_s:

     dat: Data array to be analyzed.  By assumption, the first
          dimension of the array indexes the graph, with the next two
          indexing the actors.  Though this could in principle be an
          array containing only one graph, this is rarely if ever
          sensible in a QAP-test context.

     FUN: Function to generate the test statistic.  `FUN' must accept
          `dat' and the specified `g' arguments, and should return a
          real number. 

    reps: Integer indicating the number of draws to use for quantile
          estimation.  Note that, as for all Monte Carlo procedures,
          convergence is slower for more extreme quantiles.  By
          default, `reps'=1000. 

     ...: Additional arguments to `FUN'. 

_D_e_t_a_i_l_s:

     The null hypothesis of the QAP test is that the observed
     graph-level statistic on graphs G_1,G_2,... was drawn from the
     distribution of said statistic evaluated (uniformly) on the set of
     all relabelings of G_1,G_2,....  Pragmatically, this test is
     performed by repeatedly (randomly) relabeling the input graphs,
     recalculating the test statistic, and then evaluating the fraction
     of draws greater than or equal to (and less than or equal to) the
     observed value.  This accumulated fraction approximates the
     integral of the distribution of the test statistic over the set of
     unlabeled input graphs.

     The `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 the hypothesis is undirected, then one rejects if
     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.

     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}]
     |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.

_V_a_l_u_e:

     An object of class `qaptest', containing

 testval: The observed value of the test statistic. 

    dist: A vector containing the Monte Carlo draws.  

   pgreq: The proportion of draws which were greater than or equal to
          the observed value. 

   pleeq: The proportion of draws which were less than or equal to the
          observed value. 

_A_u_t_h_o_r(_s):

     Carter T. Butts ctb@andrew.cmu.edu

_R_e_f_e_r_e_n_c_e_s:

     Anderson, B.S.; Butts, C.T.; and Carley, K.M. (1999). ``The
     Interaction of Size and Density with Graph-Level Indices.'' Social
     Networks, 21(3), 239-267.

     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.

_S_e_e _A_l_s_o:

     `cugtest'

_E_x_a_m_p_l_e_s:

     #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)

