netcancor {sna} | R Documentation

## Canonical Correlation for Labeled Graphs

### Description

`netcancor` finds the canonical correlation(s) between the graph sets `x` and `y`, testing the result using either conditional uniform graph (CUG) or quadratic assignment procedure (QAP) null hypotheses.

### Usage

    netcancor(y, x, mode="digraph", diag=FALSE, nullhyp="cugtie",
        reps=1000)

### Arguments

`y` | one or more input graphs.
`x` | one or more input graphs.
`mode` | string indicating the type of graph being evaluated. "digraph" indicates that edges should be interpreted as directed; "graph" indicates that edges are undirected. `mode` is set to "digraph" by default.
`diag` | boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. `diag` is `FALSE` by default.
`nullhyp` | string indicating the particular null hypothesis against which to test the observed estimands. A value of "cug" implies a conditional uniform graph test (see `cugtest`) controlling for order only; "cugden" controls for both order and tie probability; "cugtie" controls for order and tie distribution (via bootstrap); and "qap" implies that the QAP null hypothesis (see `qaptest`) should be used.
`reps` | integer indicating the number of draws to use for quantile estimation. (Relevant to the null hypothesis test only - the analysis itself is unaffected by this parameter.) Note that, as for all Monte Carlo procedures, convergence is slower for more extreme quantiles.

### Details

The `netcancor` routine is actually a front-end to the `cancor` routine for computing canonical correlations between sets of vectors. `netcancor` itself vectorizes the network variables (as per its graph type) and manages the appropriate null hypothesis tests; the actual canonical correlation is handled by `cancor`.

Canonical correlation itself is a multivariate generalization of the product-moment correlation. Specifically, the analysis seeks linear combinations of the variables in `y` which are well-explained by linear combinations of the variables in `x`. The network version of this technique is performed elementwise on the adjacency matrices of the graphs in question; as usual, the result should be interpreted with an eye to the relationship between the type of data used and the assumptions of the underlying model.

Intelligent printing and summarizing of netcancor objects is provided by `print.netcancor` and `summary.netcancor`.

### Value

An object of class `netcancor` with the following properties:

`xdist` | Array containing the distribution of the X coefficients under the null hypothesis test.
`ydist` | Array containing the distribution of the Y coefficients under the null hypothesis test.
`cdist` | Array containing the distribution of the canonical correlation coefficients under the null hypothesis test.
`cor` | Vector containing the observed canonical correlation coefficients.
`xcoef` | Vector containing the observed X coefficients.
`ycoef` | Vector containing the observed Y coefficients.
`cpgreq` | Vector containing the estimated upper tail quantiles (p>=obs) for the observed canonical correlation coefficients under the null hypothesis.
`cpleeq` | Vector containing the estimated lower tail quantiles (p<=obs) for the observed canonical correlation coefficients under the null hypothesis.
`xpgreq` | Matrix containing the estimated upper tail quantiles (p>=obs) for the observed X coefficients under the null hypothesis.
`xpleeq` | Matrix containing the estimated lower tail quantiles (p<=obs) for the observed X coefficients under the null hypothesis.
`ypgreq` | Matrix containing the estimated upper tail quantiles (p>=obs) for the observed Y coefficients under the null hypothesis.
`ypleeq` | Matrix containing the estimated lower tail quantiles (p<=obs) for the observed Y coefficients under the null hypothesis.
`cnames` | Vector containing names for the canonical correlation coefficients.
`xnames` | Vector containing names for the X vars.
`ynames` | Vector containing names for the Y vars.
`xcenter` | Values used to adjust the X variables.
`xcenter` | Values used to adjust the Y variables.
`nullhyp` | String indicating the null hypothesis employed.

### Note

This will eventually be replaced with a superior cancor procedure with more interpretable output; the new version will handle arbitrary labeling as well.

### Author(s)

Carter T. Butts buttsc@uci.edu

### References

Butts, C.T., and Carley, K.M. (2001). ``Multivariate Methods for Interstructural Analysis.'' CASOS working paper, Carnegie Mellon University.

### See Also

`gcor`, `cugtest`, `qaptest`, `cancor`

### Examples

    #Generate a valued seed structure
    cv<-matrix(rnorm(100),nrow=10,ncol=10)
    #Produce two sets of valued graphs
    x<-array(dim=c(3,10,10))
    x[1,,]<-3*cv+matrix(rnorm(100,0,0.1),nrow=10,ncol=10)
    x[2,,]<--1*cv+matrix(rnorm(100,0,0.1),nrow=10,ncol=10)
    x[3,,]<-x[1,,]+2*x[2,,]+5*cv+matrix(rnorm(100,0,0.1),nrow=10,ncol=10)
    y<-array(dim=c(2,10,10))
    y[1,,]<--5*cv+matrix(rnorm(100,0,0.1),nrow=10,ncol=10)
    y[2,,]<--2*cv+matrix(rnorm(100,0,0.1),nrow=10,ncol=10)
    #Perform a canonical correlation analysis
    nc<-netcancor(y,x,reps=100)
    summary(nc)

[Package sna version 1.1 Index]