requiredPerms: How many permutations do I need to test at my desired...

Description Usage Arguments Value Examples

View source: R/pperm.R

Description

How many permutations do I need to test at my desired significance level?

Usage

1
requiredPerms(alpha, alternative = "greater")

Arguments

alpha

desired significance threshold.

alternative

a character string specifying the alternative hypothesis, must be one of "greater" (default), "less", or "two.sided". You can specify just the initial letter.

Value

The minimum number of permutations required to detect any significant associations at the provided alpha. The minimum p-value will always be smaller than alpha.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data("NetRep")

# Set up input lists for each input matrix type across datasets. The list
# elements can have any names, so long as they are consistent between the
# inputs.
network_list <- list(discovery=discovery_network, test=test_network)
data_list <- list(discovery=discovery_data, test=test_data)
correlation_list <- list(discovery=discovery_correlation, test=test_correlation)
labels_list <- list(discovery=module_labels)

# How many permutations are required to Bonferroni adjust for the 4 modules 
# in the example data? 
nPerm <- requiredPerms(0.05/4) 

# Note that we recommend running at least 10,000 permutations to make sure 
# that the null distributions are representative.

preservation <- modulePreservation(
 network=network_list, data=data_list, correlation=correlation_list, 
 moduleAssignments=labels_list, nPerm=nPerm, discovery="discovery", 
 test="test"
)

InouyeLab/NetRep documentation built on Oct. 8, 2020, 2:32 a.m.