netCor | R Documentation |
This function computes Mantel's permutation test for similarity of two matrices. It permutes the rows and columns of the second matrix randomly and calculates a Z-statistic.
netCor(x1, x2, nperm = 1000, graph = TRUE, alternative = "two.sided", ...)
x1 |
the first network, should be the product of |
x2 |
the second network, should be the product of |
nperm |
the number of times to permute the data. |
graph |
a logical indicating whether to produce a summary graph. |
alternative |
a character string defining the alternative hypothesis: "two.sided" (default), "less", "greater", or any unambiguous abbreviation of these. |
... |
further arguments to be passed to plot() (to add a title, change the axis labels, and so on). |
The function calculates a Z-statistic for the Mantel test, equal to the sum of the pairwise product of the lower triangles of the permuted matrices, for each permutation of rows and columns. It compares the permuted distribution with the Z-statistic observed for the actual data.
z.stat:
the Z-statistic (sum of rows*columns of lower triangle) of the data matrices.
p:
P-value (quantile of the observed Z-statistic in the permutation distribution).
alternative:
the alternative hypothesis.
data('mtcars')
net1 <- quickNet(mtcars)
net2 <- quickNet(mtcars^3)
netCor(net1, net2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.