View source: R/rewiring_stats_functions.R
rewiring_test | R Documentation |
When performing the rewiring test, some stats must be generated in order to proceed with the
rewiring method. dave_test()
performs a permutation test from a data matrix and a group membership.
This function is used in the runrewiring()
method.
rewiring_test(x, grp, perm = 500)
rewiring_test_pair_detail(x, grp, perm = 500)
x |
data matrix containing subjects as rows and genes as columns. |
grp |
array indicating the subject group membership. |
perm |
number of permutations for the test. |
list containing the pvalue associated to the rewiring test, the initial t-stat and the t-stat after the permutation test.
## We are going to generate a random matrix `x` and `grp` for the example.
## We will use 40 samples and 100 genes. First 25 samples will belong to one group
## and the rest (15) to the other.
mat <- matrix(stats::rnorm(40*100),40,100)
group_m <- c(rep(1,25),rep(0,15))
## Note: the `rewiring_test()` works with group membership (1,2) instead of (0,1)
results <- rewiring_test(x=mat,grp=1+group_m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.