Description Usage Arguments Value Author(s) References Examples
MGC K Sample Testing provides a wrapper for MGC Sample testing under the constraint that the Ys here are categorical labels with K possible sample ids. This function uses a 0-1 loss for the Ys (one-hot-encoding)).
| 1 | mgc.ksample(X, Y, mgc.opts = list(), ...)
 | 
| X | is interpreted as: 
 | 
| Y | 
 | 
| mgc.opts | Arguments to pass to MGC, as a named list. See  | 
| ... | trailing args. | 
A list containing the following:
|  | P-value of MGC | 
|  | is the sample MGC statistic within  | 
|  | P-value of the local correlations by double matrix index | 
|  | the local correlations | 
|  | the optimal scale identified by MGC | 
Eric Bridgeford
Youjin Lee, et al. "Network Dependence Testing via Diffusion Maps and Distance-Based Correlations." ArXiv (2019).
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run: 
library(mgc)
library(MASS)
n = 100; d = 2
# simulate 100 samples, where first 50 have mean [0,0] and second 50 have mean [1,1]
Y <- c(replicate(n/2, 0), replicate(n/2, 1))
X <- do.call(rbind, lapply(Y, function(y) {
    return(rnorm(d) + y)
}))
# p value is small
mgc.ksample(X, Y, mgc.opts=list(nperm=100))$p.value
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.